Re: Starting daemon using ssh
From: Greg Wooledge (wooledg_at_eeg.ccf.org)
Date: Thu, 4 Nov 2004 07:51:28 -0500 To: "Binninger, Martin" <email@example.com>
On Tue, Nov 02, 2004 at 08:19:39AM +0100, Binninger, Martin wrote:
> While trying, to start a daemon on a remote machine using ssh, the client
> doesn't return to the local prompt after performing the start-up of the
This question seems to come up at least once a month.
imadev:~$ time ssh localhost 'sleep 20 &'
imadev:~$ time ssh localhost 'sleep 20 >/dev/null 2>&1 &'
imadev:~$ ps -ef | grep sleep
wooledg 26650 11055 0 07:49:21 pts/1 0:00 grep sleep
wooledg 26648 1 0 07:49:17 ? 0:00 sleep 20
Any more questions?
Fix your daemon-starting scripts. Don't leave file descriptors
hanging. Redirect everything to a logfile. In Bourne shell syntax,
you can do that like this:
exec >>/var/log/whatever 2>&1
case "$1" in
start) .... ;;
stop) .... ;;