Outils pour utilisateurs

Outils du site


tech:systemd_lancer_un_script_a_l_arret

Ceci est une ancienne révision du document !


Systemd lancer un script à l'arrêt

Source : http://unix.stackexchange.com/questions/39226/how-to-run-a-script-with-systemd-right-before-shutdown

/etc/systemd/system/jbshutdown.service
[Unit]
Description=Exec before shutdown
 
[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/bin/true
ExecStop=/root/bin/shutdown.sh
 
[Install]
WantedBy=multi-user.target
chmod +x /root/bin/shutdown.sh
systemctl enable jbshutdown.service
systemctl start jbshutdown.service

Le lien symbolique suivant sera crée /etc/systemd/system/multi-user.target.wants/jbshutdown.service

tech/systemd_lancer_un_script_a_l_arret.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki