PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > execute a program during a system shutdown or reboot
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

execute a program during a system shutdown or reboot

Réponse
 
LinkBack Outils de la discussion
Vieux 25/03/2008, 22h07   #1
bharath venk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut execute a program during a system shutdown or reboot

hi,
i wanna to how to make program to run automatically when is
about to shutdown or reboot
  Réponse avec citation
Vieux 25/03/2008, 22h19   #2
Bill Marcum
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: execute a program during a system shutdown or reboot

On 2008-03-25, bharath venk <bharathv6.project@gmail.com> wrote:
>
>
> hi,
> i wanna to how to make program to run automatically when is
> about to shutdown or reboot


Put the script in /etc/init.d and place symbolic links in the /etc/rc?.d
directories.
  Réponse avec citation
Vieux 26/03/2008, 03h00   #3
Wayne
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: execute a program during a system shutdown or reboot

bharath venk wrote:
> hi,
> i wanna to how to make program to run automatically when is
> about to shutdown or reboot


This depends on your OS. For Fedora which uses a standard Sys V
init system, create your script in /etc/init.d. Then make
symlinks to that script in /etc/rc0.d and /etc/rc6.d. (On Fedora
these directories are symlinks; the real pathnames are /etc/rc.d/*.)

Be sure to name the symlink so it runs last, but before the
disks are unmounted, etc. I recommend the following names:

/etc/init.d/shutdownhook
/etc/rc[06].d/K99zz-shutdownhook

IIRC this won't work for SuSE. While that use a Sys V init
I seem to remember they cleverly wrote their "rc" program
to compare services running in the current the services
that should be running in the new runlevel, then turned off
the ones that should be off (in reverse order of startup)
and then turned on any that should be on. Thus SuSE only
uses the S##scripts and ignores any K##scripts. (I haven't
checked this in years, it might be different now.)

Now if you use Solaris or some other distros/flavors, you may
not use Sys V init system at all. You should check your
system's documentation for an answer, or post your question
in a more appropriate forum.

-Wayne
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h37.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08713 seconds with 11 queries