Ok,i have had a look at the scripts,and i added my script /etc/init.d.It works fine with service start.and chkconfig on.
My question now is.how would i gou about to notify my daemon when the system shuts down?I know i should do a chkconfig off,or put the script in /etc/rc6.d.but what can i do to tell the deamon(say its a simple while(1) loop),that it must stop what its doing,and shut the service down.I assume i must have some interrupt checker of some kind?Can anyone give me some info how i need to go about getting this working?
example..Say this my daemon
while (1) do
print "Deamon is running";
What must i put inside this loop to realize,it should should stop(beacuse of a sutdown or service stop).