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. Test case: on a server make this script: ``` #!/bin/sh echo "Start" service couchdb2 restart echo "Done" ``` 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.
More simply This command exits: ssh root@10.10.10.10 "service couchdb2 restart > /dev/null" This command never exits: ssh root@10.10.30.20 "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 fine here. Let me know how that works for you.
(In reply to Dave Cottlehuber from comment #3) Hey Dave, 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 via https://github.com/skunkwerks/ports/commit/63c8ee999d3b27695d2b6e7e565be69918668fc5.diff 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.
Approved.
(In reply to Dave Cottlehuber from comment #5) Awesome, I've already pushed the config out to my fleet of servers. Cheers, Reshad
A commit references this bug: Author: dch Date: Fri Dec 21 20:51:19 UTC 2018 New revision: 488025 URL: https://svnweb.freebsd.org/changeset/ports/488025 Log: 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. PR: 234100 Reported by: Reshad Patuck <reshadpatuck1@gmail.com> Reviewed by: Reshad Patuck <reshadpatuck1@gmail.com> Approved by: jrm (mentor) Changes: head/databases/couchdb2/Makefile head/databases/couchdb2/files/patch-rel_overlay_etc_vm.args
closed in r488025. Thanks again Reshad!