[svlug] daemonize a bash script

Sanatan Rai sanatan at gmail.com
Fri Jun 9 16:31:26 PDT 2006


Take a look at one of the scripts in /etc/init.d

For example, sendmail has the function start()

which has a line:
daemon --check sm-client /usr/sbin/sendmail -L sm-msp-queue -Ac \
                        -q $SMQUEUE $SENDMAIL_OPTARG

calling the system function daemon()

It seems to me that this the approach you might want if the
nohup/disown alternatives are not satisfactory. Might want to look up
Kernighan and Pike review shell functions...

--Sanatan
-- 
Sanatan Rai
Flat 10, Horselydown Mansions,
Lafone Street, London SE1 2NA
+44-20-7403-2479.




More information about the svlug mailing list