Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] "chia start" doesn't exit if invoked via ssh #16396

Open
cross opened this issue Sep 22, 2023 · 7 comments
Open

[Bug] "chia start" doesn't exit if invoked via ssh #16396

cross opened this issue Sep 22, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@cross
Copy link
Contributor

cross commented Sep 22, 2023

What happened?

From one host, I deploy commands to a farm of chia harvesters. "chia stop" and other commands exit as I'd expect, but "chia start harvester" does not. It completes, reporting success, then just hangs. Eventually I will have to cancel/timeout the session.

me@localhost ~> ssh chiauser@hostname chia start harvester
chiauser@hostname's password: 
Daemon not started yet
Starting daemon
chia_harvester: started

At this point, the ssh session just remains open. The daemon and harvester are running, but the shell doesn't exit. I presume this is something to do with not properly daemon-izing the processes, holding a controlling terminal.

Version

2.0.1

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

No response

@cross cross added the bug Something isn't working label Sep 22, 2023
@cross
Copy link
Contributor Author

cross commented Sep 22, 2023

If I log into another terminal and chia stop all -d, the ssh will exit. chia stop all beforehand left that ssh remaining open. That confirms it's the daemon, not the harvester, that is the thing holding the tty.

@emlowe emlowe self-assigned this Sep 27, 2023
@wiryonolau
Copy link

you can run in tmux, or pass it to backgorund worker

chia start harvester &

Or use systemd

@cross
Copy link
Contributor Author

cross commented Oct 2, 2023

True, but when invoking via ssh those are harder. I think it's just an issue of it needing to release its controlling terminal before the parent exits. It's an edge condition, but shouldn't be too hard to fix.

@cai1111
Copy link

cai1111 commented Oct 12, 2023

nohup chia start harvester &

@cross
Copy link
Contributor Author

cross commented Oct 13, 2023

That doesn't work either, at least not via ssh. (adding \& to ssh has no effect)

cross@hostname ~> ssh user@chiahost nohup chia start harvester
user@chiahost's password: 
Daemon not started yet
Starting daemon
chia_harvester: started

and then it hangs.

@cai1111
Copy link

cai1111 commented Oct 17, 2023

ssh user@chiahost "sh -c 'nohup chia start harvester > /dev/null 2>&1 &'"

@wjblanke
Copy link
Contributor

We are leaving this open for a fix, but tbh it is pretty low priority at the moment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants