I'm currently using the skeleton in /etc/init.d to start a daemon when my computer boots. I need the daemon to run three instances. In my skeleton, I have changed the code in the start function to:
cd dir1 ; start-stop-daemon -b --start --quiet --pidfile ${PIDFILE}1 --exec $DAEMON --
$DAEMON_ARGS
|| retu 2 ;
cd dir2 ; start-stop-daemon -b --start --quiet --pidfile ${PIDFILE}1 --exec $DAEMON --
$DAEMON_ARGS
|| retu 2 ;
cd dir3 ; start-stop-daemon -b --start --quiet --pidfile ${PIDFILE}1 --exec $DAEMON --
$DAEMON_ARGS
|| retu 2 ;
Because my DAEMON variable points to a binary that I control, I know without a shadow of a doubt that each instance at least runs for a bit. But when the system comes up finally, I can only ever see one instance of the process ruing. I also looked at the man page of start-stop-daemon and it is not supposed to kill an already ruing instance if --pidfile is specified. I am also using -b, and I have tested my daemon script where I execute it directly with run.sh start. After this, I can see three processes ruing as I expect.
How do I get all three instances to stay?
