Tuesday, May 22, 2012

Few Debian Upgrades/Changes

I was looking for an internal issue and could see few changes in Debian Machines as compare to other linux machines.
To put our own services (like running scripts) at shutdown of system we create the script under /etc/init.d. For e.g. /etc/init.d/CA-BADAL. Provides permissions to this script.
This script based on the run levels 0-6 (I guess) has to be placed under /etc/rc* folder.
Normally in non-debian we create a symbolic link under this rc* folder using following command:
 'ln -s /etc/init.d/CA-BADAL /etc/rc0.d/CA-BADAL'
And then we just run the 'touch' command to this script under folder /var/log/subsys, for e.g:
 'touch /var/log/susbsys/CA-DSM'
Now the script should execute when you shutdown the machine.
But in Debian instead of above two process of creating symbolic link and creating blank copy under syslog you need to execute the 'insserv' command. for e.g.
 'insserv /etc/init.d/CA-BADAL'
Not this script shall run when you shutdown the Debian Machine.

One more thing I am seeing in Debian is that its removing the content of /tmp folder whenever we do a fresh reboot. Hasn't researched this but may be I am missing something.

Please refer the link below for further information on 'insserv':
http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot

No comments: