Re: Starting daemon using ssh
From: Greg Wooledge (wooledg_at_eeg.ccf.org)
Date: 11/04/04
- Previous message: Dan Lowe: "Re: Starting daemon using ssh"
- In reply to: Binninger, Martin: "Starting daemon using ssh"
- Next in thread: Kieran.Tully AT acm.org: "Re: Starting daemon using ssh"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 4 Nov 2004 07:51:28 -0500 To: "Binninger, Martin" <martin.binninger@burdadigital.de>
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
> daemon.
This question seems to come up at least once a month.
imadev:~$ time ssh localhost 'sleep 20 &'
wooledg@localhost's password:
real 0m22.757s
user 0m0.080s
sys 0m0.020s
imadev:~$ time ssh localhost 'sleep 20 >/dev/null 2>&1 &'
wooledg@localhost's password:
real 0m2.298s
user 0m0.080s
sys 0m0.020s
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:
#!/bin/sh
PATH=....
export PATH
exec >>/var/log/whatever 2>&1
case "$1" in
start) .... ;;
stop) .... ;;
....
esac
- Previous message: Dan Lowe: "Re: Starting daemon using ssh"
- In reply to: Binninger, Martin: "Starting daemon using ssh"
- Next in thread: Kieran.Tully AT acm.org: "Re: Starting daemon using ssh"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|