From 194059e45f95532c226bfbd29b2e43c2659a1552 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 28 Aug 2021 12:27:14 +0200 Subject: -add files from madmurphy so that other distros may benefit --- contrib/services/systemd/Makefile.am | 5 ++++- contrib/services/systemd/gnunet-user.service | 11 +++++++++++ contrib/services/systemd/gnunet.service | 16 +++++++--------- contrib/services/systemd/sysusers-gnunet.conf | 4 ++++ contrib/services/systemd/tmpfiles-gnunet.conf | 10 ++++++++++ 5 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 contrib/services/systemd/gnunet-user.service create mode 100644 contrib/services/systemd/sysusers-gnunet.conf create mode 100644 contrib/services/systemd/tmpfiles-gnunet.conf (limited to 'contrib') diff --git a/contrib/services/systemd/Makefile.am b/contrib/services/systemd/Makefile.am index 39a6f2a81..ec2ff7704 100644 --- a/contrib/services/systemd/Makefile.am +++ b/contrib/services/systemd/Makefile.am @@ -1,7 +1,10 @@ pkginitdir= $(pkgdatadir)/services/systemd pkginit_DATA = \ - gnunet.service + gnunet.service \ + gnunet-user.service \ + sysusers-gnunet.conf \ + tmpfiles-gnunet.conf EXTRA_DIST = \ $(pkginit_DATA) diff --git a/contrib/services/systemd/gnunet-user.service b/contrib/services/systemd/gnunet-user.service new file mode 100644 index 000000000..c9d3be0ad --- /dev/null +++ b/contrib/services/systemd/gnunet-user.service @@ -0,0 +1,11 @@ +# Typically to be place into /usr/lib/systemd/user/gnunet.service +[Unit] +Description=GNUnet user service +After=network.target + +[Service] +Type=simple +ExecStart=/usr/lib/gnunet/libexec/gnunet-service-arm -c ~/.config/gnunet.conf + +[Install] +WantedBy=multi-user.target diff --git a/contrib/services/systemd/gnunet.service b/contrib/services/systemd/gnunet.service index 1c458cea6..25b3c2f0e 100644 --- a/contrib/services/systemd/gnunet.service +++ b/contrib/services/systemd/gnunet.service @@ -1,15 +1,13 @@ -# Copyright (C) 2019 GNUnet e.V. -# -# Copying and distribution of this file, with or without modification, -# are permitted in any medium without royalty provided the copyright -# notice and this notice are preserved. This file is offered as-is, -# without any warranty. - +# Typically placed into /usr/lib/systemd/system/gnunet.service [Unit] -Description=Service that runs a GNUnet for the user gnunet +Description=GNUnet system service After=network.target [Service] -User=gnunet Type=simple +User=gnunet ExecStart=/usr/lib/gnunet/libexec/gnunet-service-arm -c /etc/gnunet.conf +StateDirectory=gnunet + +[Install] +WantedBy=multi-user.target diff --git a/contrib/services/systemd/sysusers-gnunet.conf b/contrib/services/systemd/sysusers-gnunet.conf new file mode 100644 index 000000000..b7b8abeed --- /dev/null +++ b/contrib/services/systemd/sysusers-gnunet.conf @@ -0,0 +1,4 @@ +# Typically placed into /usr/lib/sysusers.d/gnunet.conf +g gnunet - +u gnunet - "GNUnet system account" /var/lib/gnunet +g gnunetdns - diff --git a/contrib/services/systemd/tmpfiles-gnunet.conf b/contrib/services/systemd/tmpfiles-gnunet.conf new file mode 100644 index 000000000..ffffa3284 --- /dev/null +++ b/contrib/services/systemd/tmpfiles-gnunet.conf @@ -0,0 +1,10 @@ +# Typically placed into /usr/lib/tmpfiles.d/gnunet.conf +d /var/lib/gnunet 0700 gnunet gnunet - - +z /usr/lib/gnunet/gnunet-helper-dns 4750 root gnunetdns - - +z /usr/lib/gnunet/gnunet-service-dns 2750 gnunet gnunetdns - - +z /usr/lib/gnunet/libexec/gnunet-helper-vpn 4750 root root - - +z /usr/lib/gnunet/libexec/gnunet-helper-transport-wlan 4750 root root - - +z /usr/lib/gnunet/libexec/gnunet-helper-transport-bluetooth 4750 root root - - +z /usr/lib/gnunet/libexec/gnunet-helper-exit 4750 root root - - +z /usr/lib/gnunet/libexec/gnunet-helper-nat-server 4750 root root - - +z /usr/lib/gnunet/libexec/gnunet-helper-nat-client 4750 root root - - -- cgit v1.2.3