diff options
author | Sami Kerola <kerolasa@iki.fi> | 2018-10-16 22:31:24 +0100 |
---|---|---|
committer | Sami Kerola <kerolasa@iki.fi> | 2018-10-16 22:31:53 +0100 |
commit | 9ee32729d9d64258042af7270b72cfd38ce51ea4 (patch) | |
tree | 6a290b2ebc10f684765562468b3d09a2f8fad7e8 | |
parent | 46d08f2080ad61b1d2fb2e5817fa04e5ca0db76b (diff) | |
download | iputils-9ee32729d9d64258042af7270b72cfd38ce51ea4.tar.gz |
build-sys: add rdisc systemd file
And move installation directory to sbin.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | meson.build | 11 | ||||
-rw-r--r-- | systemd/rdisc.service.in | 27 |
2 files changed, 38 insertions, 0 deletions
diff --git a/meson.build b/meson.build index bc92e6e..7cb56be 100644 --- a/meson.build +++ b/meson.build @@ -217,7 +217,18 @@ endif if build_rinfod == true executable('rdisc', ['rdisc.c', git_version_h], + install_dir: 'sbin', install: true) + if systemd.found() + subs = configuration_data() + subs.set('sbindir', join_paths(get_option('prefix'), get_option('sbindir'))) + unit_file = configure_file( + input: 'systemd/rdisc.service.in', + output: 'rdisc@.service', + configuration: subs + ) + install_data(unit_file, install_dir: systemdunitdir) + endif endif if build_arping == true diff --git a/systemd/rdisc.service.in b/systemd/rdisc.service.in new file mode 100644 index 0000000..4e2a1ec --- /dev/null +++ b/systemd/rdisc.service.in @@ -0,0 +1,27 @@ +[Unit] +Description=Network Router Discovery Daemon +Documentation=man:rdisc(8) +Requires=network.target +After=network.target + +[Service] +EnvironmentFile=-/etc/sysconfig/rdisc +ExecStart=@sbindir@/rdisc -f -t $OPTIONS $SEND_ADDRESS $RECEIVE_ADDRESS + +AmbientCapabilities=CAP_NET_RAW +PrivateTmp=yes +PrivateUsers=yes +ProtectSystem=strict +ProtectHome=yes +ProtectControlGroups=yes +ProtectKernelTunables=yes +ProtectKernelModules=yes +MemoryDenyWriteExecute=yes +RestrictRealtime=yes +RestrictNamespaces=yes +SystemCallArchitectures=native +LockPersonality=yes +NoNewPrivileges=yes + +[Install] +WantedBy=multi-user.target |