From 85b9a47a0de0b27589eccf033ceb8497d06afc8e Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Fri, 22 Feb 2019 22:39:41 -0800 Subject: [PATCH 1/3] Add note on how to restart automatically If Tautulli ever crashes due to a failure of some sort the policies mentioned here will automatically restart it, with the caveat that they will _always_ restart it, even if it is going to crash right away again! --- init-scripts/init.systemd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/init-scripts/init.systemd b/init-scripts/init.systemd index 040f1121..0afce887 100644 --- a/init-scripts/init.systemd +++ b/init-scripts/init.systemd @@ -41,6 +41,11 @@ # - WantedBy= specifies which target (i.e. runlevel) to start Tautulli for. # multi-user.target equates to runlevel 3 (multi-user text mode) # graphical.target equates to runlevel 5 (multi-user X11 graphical mode) +# +# - Uncomment the two lines Restart= and RestartSec= below to allow Tautulli +# to restart if it crashes. +# Warning! If your setup is broken and Tautulli crashes on startup, these +# lines will cause it to restart forever until you stop it! [Unit] Description=Tautulli - Stats for Plex Media Server usage @@ -53,6 +58,8 @@ GuessMainPID=no Type=forking User=tautulli Group=tautulli +# Restart=on-abnormal +# RestartSec=5 [Install] WantedBy=multi-user.target From b243ac5f5c83c4f232328b51f78c3dbc33084f21 Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Sun, 24 Feb 2019 13:53:34 -0800 Subject: [PATCH 2/3] Add burst failure protection If the process fails 3 times within 90 seconds of a start attempt consider it permanently failed and stop all further attempts to restart it automatically. --- init-scripts/init.systemd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init-scripts/init.systemd b/init-scripts/init.systemd index 0afce887..8e300d63 100644 --- a/init-scripts/init.systemd +++ b/init-scripts/init.systemd @@ -44,8 +44,6 @@ # # - Uncomment the two lines Restart= and RestartSec= below to allow Tautulli # to restart if it crashes. -# Warning! If your setup is broken and Tautulli crashes on startup, these -# lines will cause it to restart forever until you stop it! [Unit] Description=Tautulli - Stats for Plex Media Server usage @@ -60,6 +58,8 @@ User=tautulli Group=tautulli # Restart=on-abnormal # RestartSec=5 +StartLimitInterval=90 +StartLimitBurst=3 [Install] WantedBy=multi-user.target From a646cc36a18e25e4e34dca7aa1d47cba8eb20d3b Mon Sep 17 00:00:00 2001 From: Landon Abney Date: Sun, 24 Feb 2019 13:58:19 -0800 Subject: [PATCH 3/3] Enable by default With the protections from an infinite restart loop in place this should be safe to enable by default. --- init-scripts/init.systemd | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/init-scripts/init.systemd b/init-scripts/init.systemd index 8e300d63..577e5e85 100644 --- a/init-scripts/init.systemd +++ b/init-scripts/init.systemd @@ -41,9 +41,6 @@ # - WantedBy= specifies which target (i.e. runlevel) to start Tautulli for. # multi-user.target equates to runlevel 3 (multi-user text mode) # graphical.target equates to runlevel 5 (multi-user X11 graphical mode) -# -# - Uncomment the two lines Restart= and RestartSec= below to allow Tautulli -# to restart if it crashes. [Unit] Description=Tautulli - Stats for Plex Media Server usage @@ -56,8 +53,8 @@ GuessMainPID=no Type=forking User=tautulli Group=tautulli -# Restart=on-abnormal -# RestartSec=5 +Restart=on-abnormal +RestartSec=5 StartLimitInterval=90 StartLimitBurst=3