[Ilugc] Re: need help on taking backup
- From: lug@xxxxxxxxxxxxxxxxxx (Chandrashekar Babu)
- Date: Fri Nov 26 11:19:43 2004
prem kumar vk writes:
i'm trying to run a particular process before shutting down the system.
it should run each time before the machine goes down.
i would like to know in which location should i keep the file.
If you are using Redhat/Fedora/Mandrake Linux, make your script/program
executable, and copy the same into /etc/init.d/ directory. After this, you
might either wish to manually create a symbolic link to this script to
/etc/rc0.d/ and /etc/rc6.d/ directory (or /etc/rc.d/rc0.d/ and
/etc/rc.d/rc6.d/ directory) or use your favourite service management tool
(like ntsysv, redhat-config-services or other tools) and enable
your script to be executed on runlevel 0 (system halt) and runlevel 6
(system reboot).
If you do create a symbolic link to your script manually, make sure that the
name of your script starts as S67 or something like that (S stands for
"Start" and 67 is the numeric order that determines when the script must be
run).
If you are using Slackware or similar distro, you might simply edit
/etc/rc.d/rc.6 and add a line to execute your script, before the
block that umounts your filesystems.
Cheers,
Chandrashekar Babu.
Other related posts: