Outils pour utilisateurs

Outils du site


tech:systemd_service_script_en_boucle_infinie_respawn

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
tech:systemd_service_script_en_boucle_infinie_respawn [2025/11/11 20:53] Jean-Baptistetech:systemd_service_script_en_boucle_infinie_respawn [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>SystemD}}
 +
 +# SystemD service script en boucle infinie respawn
 +
 +
 +`/etc/systemd/system/startPeriodicCheck.service`
 +~~~ini
 +[Unit]
 +Description=startPeriodicCheck
 +
 +[Service]
 +#ExecStartPre=/bin/sleep 30
 +ExecStart=/bin/curl 127.1/WebCoding/services/PeriodicCheck.php
 +KillMode=process
 +Restart=always
 +RestartSec=10s
 +
 +[Install]
 +WantedBy=multi-user.target
 +~~~
 +
 +~~~bash
 +systemctl daemon-reload
 +systemctl start startPeriodicCheck
 +systemctl enable startPeriodicCheck
 +~~~
 +
 +Dans notre exemple une crontab aurait très bien pu faire l'affaire.
 +
 +Ou encore :
 +
 +`/etc/systemd/system/plop.service`
 +~~~ini
 +[Unit]
 +Description=Plop
 +After=getty.target
 +
 +[Service]
 +User=user1
 +Group=user1
 +# Default : Type=simple
 +Type=simple
 +ExecStart=/home/user1/bin/plop
 +Restart=always
 +
 +[Install]
 +WantedBy=multi-user.target
 +~~~
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki