Outils pour utilisateurs

Outils du site


welcome:ubuntu:small_tricks

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édentes Révision précédente
Prochaine révision
Révision précédente
welcome:ubuntu:small_tricks [2023/01/08 14:59]
arnaud [Attendre la fin du script]
welcome:ubuntu:small_tricks [2023/01/08 15:11] (Version actuelle)
arnaud [Attendre la fin du script]
Ligne 84: Ligne 84:
 <note important>Ceci est un brouillon!</note> <note important>Ceci est un brouillon!</note>
 https://unix.stackexchange.com/questions/599372/kill-systemd-oneshot-service-after-timeout \\ https://unix.stackexchange.com/questions/599372/kill-systemd-oneshot-service-after-timeout \\
-https://trstringer.com/simple-vs-oneshot-systemd-service/+https://trstringer.com/simple-vs-oneshot-systemd-service/ \\ 
 +https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/
  
 +<code>
 +$ sudo cat /etc/systemd/system/le-service.service 
 +[Unit]
 +After=network-online.target
 +Wants=network-online.target
  
 +[Service]
 +Type=oneshot
 +TimeoutStartSec=10s
 +ExecStart=/usr/local/bin/le-script.sh
 +
 +[Install]
 +WantedBy=default.target
 +</code>
 +Il faut un "TimeoutStartSec" et non un "TimeoutStopSec" car "Behavior of oneshot is similar to simple; however, the service manager will consider the unit started after the main process exits."
  
 ====== Terminal ====== ====== Terminal ======
welcome/ubuntu/small_tricks.1673189948.txt.gz · Dernière modification: 2023/01/08 14:59 de arnaud

DokuWiki Appliance - Powered by TurnKey Linux