From a733d536adeaf6afed3bb96bbc7f822f49802bd3 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Thu, 7 Nov 2024 11:32:31 +0100 Subject: Added env check `NDPID_STARTED_BY_SYSTEMD` to prevent logging to `stderr` in such a case * removed `nDPId` shutdown on poll/epoll error * fixed `chmod_chown()` rv check Signed-off-by: Toni Uhlig --- packages/systemd/ndpid@.service.in | 1 + packages/systemd/ndpisrvd.service.in | 2 ++ 2 files changed, 3 insertions(+) (limited to 'packages/systemd') diff --git a/packages/systemd/ndpid@.service.in b/packages/systemd/ndpid@.service.in index b59a6612c..5bdd0f1bb 100644 --- a/packages/systemd/ndpid@.service.in +++ b/packages/systemd/ndpid@.service.in @@ -8,6 +8,7 @@ Type=simple ExecStartPre=/bin/sh -c 'test -r "@CMAKE_INSTALL_PREFIX@/etc/nDPId/%i.conf" || cp -v "@CMAKE_INSTALL_PREFIX@/share/nDPId/ndpid.conf.example" "@CMAKE_INSTALL_PREFIX@/etc/nDPId/%i.conf"' ExecStart=@CMAKE_INSTALL_PREFIX@/sbin/nDPId -f @CMAKE_INSTALL_PREFIX@/etc/nDPId/%i.conf -i %i -u ndpid -c /run/nDPIsrvd/collector Restart=on-failure +Environment="NDPID_STARTED_BY_SYSTEMD=" [Install] WantedBy=multi-user.target diff --git a/packages/systemd/ndpisrvd.service.in b/packages/systemd/ndpisrvd.service.in index 89f87a682..b74e9af38 100644 --- a/packages/systemd/ndpisrvd.service.in +++ b/packages/systemd/ndpisrvd.service.in @@ -6,8 +6,10 @@ After=network.target Type=simple 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' +ExecStopPost=/bin/sh -c 'rm -f /run/nDPIsrvd/collector /run/nDPIsrvd/distributor' 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="NDPID_STARTED_BY_SYSTEMD=" [Install] WantedBy=multi-user.target -- cgit v1.2.3