diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-11-20 12:25:44 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-11-20 12:27:40 +0100 |
commit | d5266b7f44e0b9c02ef1fc3166ba59431ab43230 (patch) | |
tree | 97231a3ff6e4b30715847e827fe0f8d07f4449ea /packages | |
parent | 82934b7271ad11332cdc291188e6b51e9534c301 (diff) |
Support simple config file reading via systemd environment file.
* cfg file path defaults to PREFIX/etc/default/ndpid
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'packages')
-rw-r--r-- | packages/systemd/default.cfg | 2 | ||||
-rw-r--r-- | packages/systemd/ndpid@.service | 12 | ||||
-rw-r--r-- | packages/systemd/ndpid@.service.in | 14 | ||||
-rw-r--r-- | packages/systemd/ndpisrvd.service.in (renamed from packages/systemd/ndpisrvd.service) | 4 |
4 files changed, 19 insertions, 13 deletions
diff --git a/packages/systemd/default.cfg b/packages/systemd/default.cfg new file mode 100644 index 000000000..8598da168 --- /dev/null +++ b/packages/systemd/default.cfg @@ -0,0 +1,2 @@ +COLLECTOR_PATH=/var/run/ndpisrvd-collector +NDPID_ARGS="-A -z" diff --git a/packages/systemd/ndpid@.service b/packages/systemd/ndpid@.service deleted file mode 100644 index ab8110111..000000000 --- a/packages/systemd/ndpid@.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=nDPId Service on interface %i -After=ndpisrvd.service -Requires=ndpisrvd.service - -[Service] -Type=simple -ExecStart=/usr/sbin/nDPId -i %i -A -z -c /var/run/ndpisrvd-collector -Restart=on-failure - -[Install] -WantedBy=multi-user.target diff --git a/packages/systemd/ndpid@.service.in b/packages/systemd/ndpid@.service.in new file mode 100644 index 000000000..cfbb4110f --- /dev/null +++ b/packages/systemd/ndpid@.service.in @@ -0,0 +1,14 @@ +[Unit] +Description=nDPId Service on interface %i +After=ndpisrvd.service +Requires=ndpisrvd.service + +[Service] +Type=simple +ExecStart=@CMAKE_INSTALL_PREFIX@/sbin/nDPId $NDPID_ARGS -i %i -c ${COLLECTOR_PATH} +Restart=on-failure +Environment=COLLECTOR_PATH=/var/run/ndpisrvd-collector NDPID_ARGS="-A -z" +EnvironmentFile=@CMAKE_INSTALL_PREFIX@/etc/default/ndpid + +[Install] +WantedBy=multi-user.target diff --git a/packages/systemd/ndpisrvd.service b/packages/systemd/ndpisrvd.service.in index cc6bb83c7..0fd3ba8e7 100644 --- a/packages/systemd/ndpisrvd.service +++ b/packages/systemd/ndpisrvd.service.in @@ -4,9 +4,11 @@ After=network.target [Service] Type=simple -ExecStart=/usr/bin/nDPIsrvd -c /var/run/ndpisrvd-collector +ExecStart=@CMAKE_INSTALL_PREFIX@/bin/nDPIsrvd -c ${COLLECTOR_PATH} ExecStopPost=/bin/rm -f /var/run/ndpisrvd-collector Restart=on-failure +Environment=COLLECTOR_PATH=/var/run/ndpisrvd-collector +EnvironmentFile=@CMAKE_INSTALL_PREFIX@/etc/default/ndpid [Install] WantedBy=multi-user.target |