Automate Startup & RESPAWN using DAEMONTOOLS

Courtesy of Sol-G Saint-Vil 

Issue commands below to install gcc and wget on your systems:
yum install –y gcc
Then create folder setup and wget source code:
mkdir -p /package
chmod 1755 /package
cd /package
tar -xzvf daemontools-0.76.tar.gz
rm daemontools-0.76.tar.gz
Finally, install Daemontools:
cd /package
cd admin/daemontools-0.76
vi src/conf-cc
Add this line after gcc -02
-include /usr/include/errno.h
Then save it and type what’s below
Check if your vi /etc/inttab contains svscanboot. For example:
Create service directory for your AOLserver instance and call it aolserver
mkdir /service/aolserver
Once created you'll also see supervise directory under it. Change to the new directory (aolserver)
cd /service/aolserver
Now use ‘vi run’ (without the quotes) to create a script called ‘run’ while in the aolserver directory
vi run
Copy and paste the code below into your ‘run’ file
exec /usr/local/aolserver451_rc2/bin/nsd -it /web/projop/etc/config.tcl -u projop -g projop
*Note: In order to paste you must first tap the ‘i’ key (insert) *Note: Once pasted, you must hit the ‘Esc’ key and then ‘:’ (colon) then type ‘wq’ (all without the quotes, in order to save). Make run script executable:
chmod +x run
Execute arun script and confirm that it starts your server
Then cd back to root and issue these lines:
echo "start on runlevel [12345]" > /etc/init/svscan.conf
echo "respawn" >> /etc/init/svscan.conf
echo "exec /command/svscanboot" >> /etc/init/svscan.conf
Issue these command:
initctl reload-configuration
initctl start svscan
That’s it. Now you can check it using command below:
ps -ef | grep svscan
  Contact Us
  Project Open Business Solutions S.L.

Calle Aprestadora 19, 12o-2a

08902 Hospitalet de Llobregat (Barcelona)


 Tel Europe: +34 609 953 751
 Tel US: +1 415 200 2465