diff --git a/package/quagga/quagga.mk b/package/quagga/quagga.mk index 22e90add2c..1bbc72dee7 100644 --- a/package/quagga/quagga.mk +++ b/package/quagga/quagga.mk @@ -75,6 +75,8 @@ endif define QUAGGA_INSTALL_INIT_SYSTEMD $(INSTALL) -D -m 644 package/quagga/quagga_tmpfiles.conf \ $(TARGET_DIR)/usr/lib/tmpfiles.d/quagga.conf + $(INSTALL) -D -m 644 package/quagga/quagga@.service \ + $(TARGET_DIR)/usr/lib/systemd/system/quagga@.service endef $(eval $(autotools-package)) diff --git a/package/quagga/quagga@.service b/package/quagga/quagga@.service new file mode 100644 index 0000000000..797af32e12 --- /dev/null +++ b/package/quagga/quagga@.service @@ -0,0 +1,17 @@ +[Unit] +Description=Quagga %i routing daemon +ConditionFileIsExecutable=/usr/sbin/%i +Wants=quagga@zebra.service + +[Service] +Type=simple +EnvironmentFile=/etc/default/quagga-%i +PrivateTmp=true +# Systemd doesn't like having %i in the executable path. +ExecStart=/usr/bin/env /usr/sbin/%i $OPTS -f /etc/quagga/%i.conf +ExecReload=/bin/kill -HUP $MAINPID +Restart=on-failure + +[Install] +WantedBy=multi-user.target +