]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: add PIDFile option in frr.service 7368/head
authorEmanuele Bovisio <emanuele.bovisio@eolo.it>
Thu, 22 Oct 2020 15:04:24 +0000 (17:04 +0200)
committerEmanuele Bovisio <emanuele.bovisio@eolo.it>
Fri, 30 Oct 2020 15:33:20 +0000 (16:33 +0100)
when type is forking, it is recommended to also use the PIDFile= option,
so that systemd can reliably identify the main process of the service.

Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
configure.ac
tools/.gitignore
tools/frr.service [deleted file]
tools/frr.service.in [new file with mode: 0644]
tools/frr@.service [deleted file]
tools/frr@.service.in [new file with mode: 0644]

index 8e86ba87ff78190bcffdde39e7c9ba05c0268851..6ce8dbc190632d190d288a40e13271e73970ea1a 100755 (executable)
@@ -2466,6 +2466,8 @@ AC_CONFIG_FILES([tools/frr], [chmod +x tools/frr])
 AC_CONFIG_FILES([tools/watchfrr.sh], [chmod +x tools/watchfrr.sh])
 AC_CONFIG_FILES([tools/frrinit.sh], [chmod +x tools/frrinit.sh])
 AC_CONFIG_FILES([tools/frrcommon.sh])
+AC_CONFIG_FILES([tools/frr.service])
+AC_CONFIG_FILES([tools/frr@.service])
 
 AC_CONFIG_COMMANDS([lib/route_types.h], [
        dst="${ac_abs_top_builddir}/lib/route_types.h"
index 85dae7fd36f0fd42b68dfd71825b8d58d20f4055..63a5b61c353258d0d229ba311f94cd31948f403d 100644 (file)
@@ -6,3 +6,5 @@
 /watchfrr.sh
 /frrinit.sh
 /frrcommon.sh
+/frr.service
+/frr@.service
diff --git a/tools/frr.service b/tools/frr.service
deleted file mode 100644 (file)
index aa45f42..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-[Unit]
-Description=FRRouting
-Documentation=https://frrouting.readthedocs.io/en/latest/setup.html
-Wants=network.target
-After=network-pre.target systemd-sysctl.service
-Before=network.target
-OnFailure=heartbeat-failed@%n.service
-
-[Service]
-Nice=-5
-Type=forking
-NotifyAccess=all
-StartLimitInterval=3m
-StartLimitBurst=3
-TimeoutSec=2m
-WatchdogSec=60s
-RestartSec=5
-Restart=on-abnormal
-LimitNOFILE=1024
-ExecStart=/usr/lib/frr/frrinit.sh start
-ExecStop=/usr/lib/frr/frrinit.sh stop
-ExecReload=/usr/lib/frr/frrinit.sh reload
-
-[Install]
-WantedBy=multi-user.target
diff --git a/tools/frr.service.in b/tools/frr.service.in
new file mode 100644 (file)
index 0000000..836ce06
--- /dev/null
@@ -0,0 +1,26 @@
+[Unit]
+Description=FRRouting
+Documentation=https://frrouting.readthedocs.io/en/latest/setup.html
+Wants=network.target
+After=network-pre.target systemd-sysctl.service
+Before=network.target
+OnFailure=heartbeat-failed@%n.service
+
+[Service]
+Nice=-5
+Type=forking
+NotifyAccess=all
+StartLimitInterval=3m
+StartLimitBurst=3
+TimeoutSec=2m
+WatchdogSec=60s
+RestartSec=5
+Restart=on-abnormal
+LimitNOFILE=1024
+PIDFile=@CFG_STATE@/watchfrr.pid
+ExecStart=@CFG_SBIN@/frrinit.sh start
+ExecStop=@CFG_SBIN@/frrinit.sh stop
+ExecReload=@CFG_SBIN@/frrinit.sh reload
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tools/frr@.service b/tools/frr@.service
deleted file mode 100644 (file)
index 0fa41c7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-[Unit]
-Description=FRRouting
-Documentation=https://frrouting.readthedocs.io/en/latest/setup.html
-Wants=network.target
-After=network-pre.target systemd-sysctl.service
-Before=network.target
-OnFailure=heartbeat-failed@%n.service
-
-[Service]
-Nice=-5
-Type=forking
-NotifyAccess=all
-StartLimitInterval=3m
-StartLimitBurst=3
-TimeoutSec=2m
-WatchdogSec=60s
-RestartSec=5
-Restart=on-abnormal
-LimitNOFILE=1024
-ExecStart=/usr/lib/frr/frrinit.sh start %I
-ExecStop=/usr/lib/frr/frrinit.sh stop %I
-ExecReload=/usr/lib/frr/frrinit.sh reload %I
-
-[Install]
-WantedBy=multi-user.target
diff --git a/tools/frr@.service.in b/tools/frr@.service.in
new file mode 100644 (file)
index 0000000..1e5d252
--- /dev/null
@@ -0,0 +1,26 @@
+[Unit]
+Description=FRRouting
+Documentation=https://frrouting.readthedocs.io/en/latest/setup.html
+Wants=network.target
+After=network-pre.target systemd-sysctl.service
+Before=network.target
+OnFailure=heartbeat-failed@%n.service
+
+[Service]
+Nice=-5
+Type=forking
+NotifyAccess=all
+StartLimitInterval=3m
+StartLimitBurst=3
+TimeoutSec=2m
+WatchdogSec=60s
+RestartSec=5
+Restart=on-abnormal
+LimitNOFILE=1024
+PIDFile=@CFG_STATE@/%I/watchfrr.pid
+ExecStart=@CFG_SBIN@/frrinit.sh start %I
+ExecStop=@CFG_SBIN@/frrinit.sh stop %I
+ExecReload=@CFG_SBIN@/frrinit.sh reload %I
+
+[Install]
+WantedBy=multi-user.target