SystemD - lingering

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/

mkdir -p ~/.config/systemd/user restorecon -rv ~/.config/
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus export XDG_RUNTIME_DIR=/run/user/$(id -u)
[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
systemctl --user daemon-reload systemctl --user enable plop.service