[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 03/19: Add GPL2 licensed openrc service file
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 03/19: Add GPL2 licensed openrc service file |
Date: |
Wed, 13 Jun 2018 11:18:21 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnunet.
commit 52de9c044b048de3f1ba4d6d4d59dc62a6fab5f9
Author: Nils Gillmann <address@hidden>
AuthorDate: Tue Jun 5 08:54:29 2018 +0000
Add GPL2 licensed openrc service file
Signed-off-by: Nils Gillmann <address@hidden>
---
contrib/services/openrc/gnunet.initd | 82 ++++++++++++++++++++++++++++++++++++
1 file changed, 82 insertions(+)
diff --git a/contrib/services/openrc/gnunet.initd
b/contrib/services/openrc/gnunet.initd
new file mode 100644
index 000000000..c042e3de1
--- /dev/null
+++ b/contrib/services/openrc/gnunet.initd
@@ -0,0 +1,82 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+if [ -d /run ] ; then
+ PIDFILE=${PIDFILE:-/run/gnunet/arm-service.pid}
+else
+ PIDFILE=${PIDFILE:-/var/run/gnunet/arm-service.pid}
+fi
+
+depend() {
+ # FIXME: refine?
+ need net
+}
+
+GNUNET_PATH="/usr"
+GNUNET_HOME="/var/lib/gnunet"
+SUID_ROOT_HELPERS="exit nat-server nat-client transport-bluetooth
transport-wlan vpn"
+
+chmodown_execbin() {
+ if [ -x $1 ]; then
+ if [ "$3" ]; then
+ chown $3 $1 2>/dev/null && chmod $2 $1
+ else
+ chmod $2 $1
+ fi
+ fi
+}
+
+checkconfig() {
+ if [ -n "$(find ${GNUNET_HOME}/.local/share/gnunet -maxdepth 1 -name
gnunet.conf -perm +0044)" ] ; then
+ eerror "${conf} must not be world or group readable. Try:"
+ eerror " chmod 600 ${conf}"
+ eerror " chown gnunet:gnunet ${conf}"
+ return 1
+ fi
+ mkdir -p ${GNUNET_HOME}/.cache/gnunet
+
+ # taken from dangole's lede config.. thx!
+ local libexec="${GNUNET_PATH}/lib/gnunet/libexec" # why
not /usr/libexec/gnunet ?
+ # not reliable enough:
+ #[ -e ${libexec}/.permfix ] && return
+ for helper in $SUID_ROOT_HELPERS; do
+ chmodown_execbin ${libexec}/gnunet-helper-$helper u+s
+ done
+ chmodown_execbin ${libexec}/gnunet-helper-dns 4750 root:gnunetdns
+ chmodown_execbin ${libexec}/gnunet-service-dns 2750 gnunet:gnunetdns
+ #touch ${libexec}/.permfix
+}
+
+start() {
+ checkconfig || return 1
+
+ local piddir=$(dirname ${PIDFILE})
+ if [ ! -d ${piddir} ] ; then
+ ebegin "Making ${piddir}"
+ mkdir -p ${piddir}
+ eend $?
+ ebegin "Changing permissions of ${piddir}"
+ chown gnunet:gnunet ${piddir}
+ eend $?
+ fi
+
+ ebegin "Starting ${SVCNAME}"
+ # shouldn't be necessary... but
+ start-stop-daemon --start --user gnunet --name gnunet --pidfile
${PIDFILE} \
+ --exec ${GNUNET_PATH}/lib/gnunet/libexec/gnunet-service-arm -- -d
+ # flags to be passed to the process appear after the double-dash
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --signal QUIT --pidfile ${PIDFILE}
+ sleep 1
+ killall -u gnunet
+ sleep 1
+ rm -rf /tmp/gnunet-gnunet-runtime >/dev/null 2>&1
+ rm -rf /tmp/gnunet-system-runtime >/dev/null 2>&1
+ eend $?
+}
+
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (8503c6fa2 -> 9417d4af8), gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 01/19: contrib: rename scripts/report.sh to scripts/gnunet-bugreport and install it., gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 09/19: doc: create system specific folder and move files into it, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 04/19: gnunet-bugreport: GNUtls->GnuTLS, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 05/19: README rework part 1, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 11/19: Fix the link to the preliminary documentation, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 02/19: extend the list of known package maintainers, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 08/19: guix-env.scm: Add python2-future., gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 10/19: README: Mention further reading material, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 03/19: Add GPL2 licensed openrc service file,
gnunet <=
- [GNUnet-SVN] [gnunet] 13/19: doc: Add new files to Makefile., gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 14/19: some changes and work in user handbook., gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 17/19: fix, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 19/19: mariadb, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 16/19: seems like mysql is currently broken in Guix, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 18/19: fix, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 07/19: doc: stagging file 'FROM_SOURCE' with old repetive instructions, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 15/19: Merge branch 'master' of gnunet.org:gnunet, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 12/19: documentation: user + developer changes, gnunet, 2018/06/13
- [GNUnet-SVN] [gnunet] 06/19: documentation: Remove installation, gnunet, 2018/06/13