On Thu, Jan 10, 2002 at 11:28:46AM +0530, MDK wrote:
> +++ Rohan Almeida [linux-india] <09/01/02 18:46 +0530>:
> > I want to execute a  command when the system goes down
> > I'm using rh 7.1. This command should run whenever the 
> > system halts or reboots, or  user presses alt+ctrl_del
> > Which file should i modify Or should i create symbolic 
> > link in rc.d dir??
> 
> Can you do it this way. edit  /etc/inittab  and  add the 
> scriptname you want to  execute  before the  shutdown -h 
> entry
> 
> <scriptname> ; shutdown -h now
> 
> correct me if I am wrong
> 
---end quoted text---

MDK,

   This is not universal. The shut-down process need not
be routed through the "shutdown" command per se.  It  is
possible to close down using  halt which is normally not 
a symlink, and in most distros a seperate elf binary.

   Both these however, are designed to execute the  run-
level 0 scripts. That is the place where additional bits
can be put. The problem is the location of the  shutdown
(runlevel 0) scripts is distro specific. Under BSD style
distros, the file to tackle is /etc/rc.d/rc.0  which  in
some distros may be symlinked to rc.6.  Under Sys-V type
distros, the location is normally the K files within the
/etc/rc.d dirs. You need to know your  distro quirks, if
you need to go about adding to shut down scripts.

   Nothing is needed to be changed at /etc/inittab level
unless you want to change the  three-finger-salute  from
the default reboot to halt.
   
Bish
        

:
####[ Linux One Stanza Tip (LOST) ]############################

Sub : Hard Disk Upgrade                              LOST #037

Do you want to upgrade your Hard Disk ?   The following HOWTO 
is a must :
http://www.linuxdoc.org/HOWTO/mini/Hard-Disk-Upgrade/index.html

####<[EMAIL PROTECTED]>########################################
:

_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to