summaryrefslogtreecommitdiff
path: root/packages/systemd/ndpisrvd.service.in
diff options
context:
space:
mode:
Diffstat (limited to 'packages/systemd/ndpisrvd.service.in')
-rw-r--r--packages/systemd/ndpisrvd.service.in7
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/systemd/ndpisrvd.service.in b/packages/systemd/ndpisrvd.service.in
index 0fd3ba8e7..89f87a682 100644
--- a/packages/systemd/ndpisrvd.service.in
+++ b/packages/systemd/ndpisrvd.service.in
@@ -4,11 +4,10 @@ After=network.target
[Service]
Type=simple
-ExecStart=@CMAKE_INSTALL_PREFIX@/bin/nDPIsrvd -c ${COLLECTOR_PATH}
-ExecStopPost=/bin/rm -f /var/run/ndpisrvd-collector
+ExecStartPre=/bin/sh -c 'test -r "@CMAKE_INSTALL_PREFIX@/etc/nDPId/nDPIsrvd.conf" || cp -v "@CMAKE_INSTALL_PREFIX@/share/nDPId/ndpisrvd.conf.example" "@CMAKE_INSTALL_PREFIX@/etc/nDPId/nDPIsrvd.conf"'
+ExecStartPre=/bin/sh -c 'mkdir -p /run/nDPIsrvd && chown root:root /run/nDPIsrvd && chmod 0775 /run/nDPIsrvd'
+ExecStart=@CMAKE_INSTALL_PREFIX@/bin/nDPIsrvd -f @CMAKE_INSTALL_PREFIX@/etc/nDPId/nDPIsrvd.conf -u ndpisrvd -c /run/nDPIsrvd/collector -s /run/nDPIsrvd/distributor -G ndpid:ndpisrvd-distributor
Restart=on-failure
-Environment=COLLECTOR_PATH=/var/run/ndpisrvd-collector
-EnvironmentFile=@CMAKE_INSTALL_PREFIX@/etc/default/ndpid
[Install]
WantedBy=multi-user.target