start script bash when system start,stop,reeboot, how ??
Hi, I have 3 script BASH.
I want start this script when the system start,stop and reeboot. Can I do it?? How?? Thanks a lot! |
Make a script called foo that takes the arguments start, stop and restart. Put it in the directory /etc/init.d/
Here I'm assuming that your default runlevel is 2 (Debian and I guess Ubuntu default), so make a link: Code:
ln -s /etc/init.d/foo /etc/rc2.d/S99foo Cheers, Evo2. |
This link might be worth reading.
http://tldp.org/HOWTO/From-PowerUp-T...t-HOWTO-6.html |
The boot script system varies from distro to distro. In a system using /etc/init.d/ and /etc/rc[0-6S].d/ directories it is the K* symlinks that are run with the "stop" argument during shutdown. Which distro are you using?
|
Quote:
|
All times are GMT -5. The time now is 08:02 AM. |