aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/Makefile.am4
-rwxr-xr-xcontrib/scripts/gnunet-bugreport (renamed from contrib/scripts/report.sh)2
-rw-r--r--contrib/services/openrc/gnunet.initd82
3 files changed, 86 insertions, 2 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 56fcb9aea..a3cc081b7 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -32,9 +32,11 @@ dist_pkgdata_DATA = \
32 gns/gns-form.xslt \ 32 gns/gns-form.xslt \
33 branding/logo/gnunet-logo.pdf \ 33 branding/logo/gnunet-logo.pdf \
34 branding/logo/gnunet-logo-color.png \ 34 branding/logo/gnunet-logo-color.png \
35 scripts/report.sh \
36 testing_hostkeys.ecc 35 testing_hostkeys.ecc
37 36
37bin_PROGRAMS = \
38 scripts/gnunet-bugreport
39
38if MINGW 40if MINGW
39tap32_DATA = \ 41tap32_DATA = \
40 3rdparty/Windows/openvpn-tap32/tapw32/tap0901.sys \ 42 3rdparty/Windows/openvpn-tap32/tapw32/tap0901.sys \
diff --git a/contrib/scripts/report.sh b/contrib/scripts/gnunet-bugreport
index 7fbb2f46c..f17cb7636 100755
--- a/contrib/scripts/report.sh
+++ b/contrib/scripts/gnunet-bugreport
@@ -233,7 +233,7 @@ gcc -o $TMPFILE $TMPFILE.c 2> /dev/null && $TMPFILE || echo "Not found"
233rm -f $TMPFILE $TMPFILE.bin 233rm -f $TMPFILE $TMPFILE.bin
234 234
235 235
236echo -n "GNUtls : " 236echo -n "GnuTLS : "
237TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX` 237TMPFILE=`mktemp /tmp/gnutls-version-testXXXXXX`
238cat - >$TMPFILE.c <<EOF 238cat - >$TMPFILE.c <<EOF
239#include <gnutls/gnutls.h> 239#include <gnutls/gnutls.h>
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 @@
1#!/sbin/openrc-run
2# Copyright 1999-2016 Gentoo Foundation
3# Distributed under the terms of the GNU General Public License v2
4
5if [ -d /run ] ; then
6 PIDFILE=${PIDFILE:-/run/gnunet/arm-service.pid}
7else
8 PIDFILE=${PIDFILE:-/var/run/gnunet/arm-service.pid}
9fi
10
11depend() {
12 # FIXME: refine?
13 need net
14}
15
16GNUNET_PATH="/usr"
17GNUNET_HOME="/var/lib/gnunet"
18SUID_ROOT_HELPERS="exit nat-server nat-client transport-bluetooth transport-wlan vpn"
19
20chmodown_execbin() {
21 if [ -x $1 ]; then
22 if [ "$3" ]; then
23 chown $3 $1 2>/dev/null && chmod $2 $1
24 else
25 chmod $2 $1
26 fi
27 fi
28}
29
30checkconfig() {
31 if [ -n "$(find ${GNUNET_HOME}/.local/share/gnunet -maxdepth 1 -name gnunet.conf -perm +0044)" ] ; then
32 eerror "${conf} must not be world or group readable. Try:"
33 eerror " chmod 600 ${conf}"
34 eerror " chown gnunet:gnunet ${conf}"
35 return 1
36 fi
37 mkdir -p ${GNUNET_HOME}/.cache/gnunet
38
39 # taken from dangole's lede config.. thx!
40 local libexec="${GNUNET_PATH}/lib/gnunet/libexec" # why not /usr/libexec/gnunet ?
41 # not reliable enough:
42 #[ -e ${libexec}/.permfix ] && return
43 for helper in $SUID_ROOT_HELPERS; do
44 chmodown_execbin ${libexec}/gnunet-helper-$helper u+s
45 done
46 chmodown_execbin ${libexec}/gnunet-helper-dns 4750 root:gnunetdns
47 chmodown_execbin ${libexec}/gnunet-service-dns 2750 gnunet:gnunetdns
48 #touch ${libexec}/.permfix
49}
50
51start() {
52 checkconfig || return 1
53
54 local piddir=$(dirname ${PIDFILE})
55 if [ ! -d ${piddir} ] ; then
56 ebegin "Making ${piddir}"
57 mkdir -p ${piddir}
58 eend $?
59 ebegin "Changing permissions of ${piddir}"
60 chown gnunet:gnunet ${piddir}
61 eend $?
62 fi
63
64 ebegin "Starting ${SVCNAME}"
65 # shouldn't be necessary... but
66 start-stop-daemon --start --user gnunet --name gnunet --pidfile ${PIDFILE} \
67 --exec ${GNUNET_PATH}/lib/gnunet/libexec/gnunet-service-arm -- -d
68 # flags to be passed to the process appear after the double-dash
69 eend $?
70}
71
72stop() {
73 ebegin "Stopping ${SVCNAME}"
74 start-stop-daemon --stop --signal QUIT --pidfile ${PIDFILE}
75 sleep 1
76 killall -u gnunet
77 sleep 1
78 rm -rf /tmp/gnunet-gnunet-runtime >/dev/null 2>&1
79 rm -rf /tmp/gnunet-system-runtime >/dev/null 2>&1
80 eend $?
81}
82