Hey, I noticed running service couchdb2 start via ssh keeps the ssh connection open, even after it is done.
This is not a problem when running without a parent shell.
on a server make this script:
service couchdb2 restart
now ssh to the server and run the script (without a shell)
ssh myserver.com sh /path/to/script.sh
The script will run and both Start and Done will be printed but the ssh will remain open even though the script is done.
Changing the script to pipe the service command to /dev/null fixed this.
This command exits:
ssh email@example.com "service couchdb2 restart > /dev/null"
This command never exits:
ssh firstname.lastname@example.org "service couchdb2 restart"
Both of them restart the server successfully
Hmm what’s in your vm.args and your [log] section of local.ini? btw I don’t have this on my end https://hackmd.io/s/Byp9sBQA7 specifically notes the noinput
Thanks for the bug report Reshad, I'm back at a keyboard and can replicate this
too. A cleaner solution might be to add `-detached` to your vm.args, it seems
Let me know how that works for you.
(In reply to Dave Cottlehuber from comment #3)
adding `-detached` to vm.args does seem to solve the problem.
Should we add this to the port as a default??
Created attachment 200255 [details]
suppress stdin when running as daemon
jrm@ can you +1 this when ready to land?
reshad this resolves new installs but I can't do anything to modify existing/deployed configs. I think this is sufficient though.
(In reply to Dave Cottlehuber from comment #5)
Awesome, I've already pushed the config out to my fleet of servers.
A commit references this bug:
Date: Fri Dec 21 20:51:19 UTC 2018
New revision: 488025
databases/couchdb2: detach stdout from daemon invocation
When CouchDB is started whithout a parent tty, for example, via ssh,
the daemon invocation retains a connection to stdout, thus blocking
disconnection of the ssh command.
The Erlang VM provides a `-detach` flag for avoiding this situation.
Add additional notes on debugging to the config file to aid users.
Reported by: Reshad Patuck <email@example.com>
Reviewed by: Reshad Patuck <firstname.lastname@example.org>
Approved by: jrm (mentor)
closed in r488025. Thanks again Reshad!