From 51d1dccb42f68f995da2164b5afcd2cfe428d018 Mon Sep 17 00:00:00 2001 From: MichaIng Date: Mon, 21 Sep 2020 23:58:30 +0200 Subject: [PATCH] Avoid daemon forking with systemd systemd units allow to run processes in foreground while daemonization is done on systemd service level when using Type=simple (default). This allows systemd to reliably track the service state, signals and could catch outputs, i.e. it is possible to remove "--quiet" to have Tautulli logging to systemd journal (journalctl) additionally or alternatively to log files. In case of Type=forking, a PID file is required to allow system reliably determine the service state, which would be an alternative, but has no real advantage. The solution with "GuessMainPID=no" allows systemd to correctly determine the service active state, but e.g. when it is killed, it is seen as "Succeeded." since systemd cannot track the exit code or signal. --- init-scripts/init.systemd | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/init-scripts/init.systemd b/init-scripts/init.systemd index 7cb27b66..c27b27df 100644 --- a/init-scripts/init.systemd +++ b/init-scripts/init.systemd @@ -52,9 +52,7 @@ Wants=network-online.target After=network-online.target [Service] -ExecStart=/usr/bin/python3 /opt/Tautulli/Tautulli.py --config /opt/Tautulli/config.ini --datadir /opt/Tautulli --quiet --daemon --nolaunch -GuessMainPID=no -Type=forking +ExecStart=/usr/bin/python3 /opt/Tautulli/Tautulli.py --config /opt/Tautulli/config.ini --datadir /opt/Tautulli --quiet --nolaunch User=tautulli Group=tautulli Restart=on-abnormal