tuto:linux:lancer_des_services_avec_start-stop-daemon
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
tuto:linux:lancer_des_services_avec_start-stop-daemon [2009/03/15 12:40] – root | tuto:linux:lancer_des_services_avec_start-stop-daemon [2009/03/31 18:36] (Version actuelle) – root | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== DEMONS ====== | ||
+ | |||
====== NOM ====== | ====== NOM ====== | ||
start-stop-daemon - lance ou arrête des démons-systèmes | start-stop-daemon - lance ou arrête des démons-systèmes | ||
- | SYNOPSIS | + | ===== SYNOPSIS |
start-stop-daemon -S|--start options [--] arguments | start-stop-daemon -S|--start options [--] arguments | ||
Ligne 82: | Ligne 84: | ||
* **-V | --version** | * **-V | --version** | ||
Affiche le numéro de version et se termine. | Affiche le numéro de version et se termine. | ||
+ | |||
+ | |||
+ | ===== Exemples ===== | ||
+ | |||
Exemple de démarrage du démon ajaxterm : | Exemple de démarrage du démon ajaxterm : | ||
Ligne 88: | Ligne 94: | ||
Exemple d' | Exemple d' | ||
start-stop-daemon --stop --pidfile $PIDFILE | start-stop-daemon --stop --pidfile $PIDFILE | ||
+ | |||
+ | Exemple Apache : | ||
+ | |||
+ | #! /bin/bash | ||
+ | # | ||
+ | # apache | ||
+ | # | ||
+ | | ||
+ | NAME=apache | ||
+ | PATH=/ | ||
+ | DAEMON=/ | ||
+ | SUEXEC=/ | ||
+ | PIDFILE=/ | ||
+ | CONF=/ | ||
+ | APACHECTL=/ | ||
+ | | ||
+ | trap "" | ||
+ | export LANG=C | ||
+ | export PATH | ||
+ | | ||
+ | test -f $DAEMON || exit 0 | ||
+ | test -f $APACHECTL || exit 0 | ||
+ | | ||
+ | # ensure we don't leak environment vars into apachectl APACHECTL=" | ||
+ | | ||
+ | if egrep -q -i " | ||
+ | exit 0 | ||
+ | fi | ||
+ | | ||
+ | case " | ||
+ | start) | ||
+ | echo -n " | ||
+ | start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON | ||
+ | ;; | ||
+ | | ||
+ | stop) | ||
+ | echo -n " | ||
+ | start-stop-daemon --stop --pidfile $PIDFILE --oknodo --exec $DAEMON | ||
+ | ;; | ||
+ | |||
+ | reload) | ||
+ | echo -n " | ||
+ | start-stop-daemon --stop --pidfile $PIDFILE --signal USR1 --exec $DAEMON | ||
+ | ;; | ||
+ | | ||
+ | reload-modules) | ||
+ | echo -n " | ||
+ | start-stop-daemon --stop --pidfile $PIDFILE --oknodo --retry 30 | ||
+ | start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON | ||
+ | ;; | ||
+ | | ||
+ | restart) | ||
+ | $0 reload-modules | ||
+ | exit $? | ||
+ | ;; | ||
+ | | ||
+ | force-reload) | ||
+ | $0 reload-modules | ||
+ | exit $? | ||
+ | ;; | ||
+ | | ||
+ | *) | ||
+ | echo " | ||
+ | {start|stop|reload|reload-modules|force-reload|restart}" | ||
+ | exit 1 | ||
+ | ;; | ||
+ | esac | ||
+ | | ||
+ | if [ $? == 0 ]; then | ||
+ | echo . | ||
+ | exit 0 | ||
+ | else | ||
+ | echo failed | ||
+ | exit 1 | ||
+ | fi | ||
tuto/linux/lancer_des_services_avec_start-stop-daemon.1237120822.txt.gz · Dernière modification : 2009/03/15 12:40 de root