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
wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
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
./package/install
Check if your vi /etc/inttab contains svscanboot. For example:
SV:123456:respawn:/command/svscanboot
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
	
#!/bin/sh
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
./run
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

E-08907 Hospitalet de Llobregat (Barcelona)

 Tel Europe: +34 932 202 088
 Tel US: +1 415 429 5995
 Mail: info@project-open.com