Outils pour utilisateurs

Outils du site


tech:systemd_-_lingering

Différences

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

Lien vers cette vue comparative

Prochaine révision
Révision précédente
tech:systemd_-_lingering [2025/03/24 15:06] – créée - modification externe 127.0.0.1tech:systemd_-_lingering [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon SystemD CA}}
 +
 +# SystemD - lingering
 +
 +~~~bash
 +loginctl disable-linger jean
 +loginctl enable-linger jean
 +loginctl show-user $(id -u)
 +~~~
 +
 +L'activation du lingering crée un fichier vide au nom de l'utilisateur dans le dossier `/var/lib/systemd/linger/`
 +
 +
 +~~~bash
 +mkdir -p ~/.config/systemd/user
 +restorecon -rv ~/.config/
 +~~~
 +
 +`~/.bashrc`
 +~~~bash
 +export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
 +export XDG_RUNTIME_DIR=/run/user/$(id -u)
 +~~~
 +
 +
 +`~/.config/systemd/user/plop.service`
 +~~~ini
 +[Unit]
 +Description=Script plop
 +After=syslog.target network.target network-online.target
 +Wants=network.target network-online.target
 +
 +[Service]
 +Type=oneshot
 +RemainAfterExit=yes
 +ExecStart=/opt/plop/bin/init.sh start
 +ExecStop=/opt/plop/bin/init.sh stop
 +RemainAfterExit=yes
 +
 +[Install]
 +WantedBy=default.target
 +~~~
 +
 +~~~bash
 +systemctl --user daemon-reload
 +systemctl --user enable plop.service
 +~~~
 +
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki