aboutsummaryrefslogtreecommitdiff
path: root/net/gnunet/files/gnunet.init
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2015-07-03 00:07:41 +0200
committerDaniel Golle <daniel@makrotopia.org>2015-07-07 09:36:05 +0200
commit7b6e9387905427ba231991d0d8d94fb24ee1da02 (patch)
treec9b68c73b9ec15175d0a433740bedd86cb52fdf3 /net/gnunet/files/gnunet.init
parentcf5f2586b03b6da1e426e488224c2ae2668efc3d (diff)
gnunet: bump source, improve packaging
* fix two typos in Makefile * package transports seperately * enable all installed transports by default * use logfile so we don't stdio-choke gnunet-service-arm -> should use syslog instead... Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'net/gnunet/files/gnunet.init')
-rw-r--r--net/gnunet/files/gnunet.init19
1 files changed, 15 insertions, 4 deletions
diff --git a/net/gnunet/files/gnunet.init b/net/gnunet/files/gnunet.init
index 66e2600d4..3d9fc1875 100644
--- a/net/gnunet/files/gnunet.init
+++ b/net/gnunet/files/gnunet.init
@@ -8,6 +8,7 @@ USE_PROCD=1
PROG=/usr/lib/gnunet/libexec/gnunet-service-arm
GNUNET_HOME=/var/run/gnunet
+LOGFILE=$GNUNET_HOME/gnunet.log
CONFIGFILE=$GNUNET_HOME/gnunet.conf
SUID_ROOT_HELPERS="exit nat-server nat-client transport-bluetooth transport-wlan vpn"
@@ -37,10 +38,20 @@ prepare_config() {
touch $CONFIGFILE
chown root:gnunet $CONFIGFILE
chmod 0640 $CONFIGFILE
- gnunet-config -c /tmp/run/gnunet/gnunet.conf -s PATHS -o GNUNET_HOME -V $GNUNET_HOME
+ gnunet-config -c $CONFIGFILE -s PATHS -o GNUNET_HOME -V $GNUNET_HOME
+ # enable gns2dns service
defaultservices=$( gnunet-config -c /tmp/run/gnunet/gnunet.conf -s arm -o DEFAULTSERVICES )
- defaultservices="$defaultservices gns2dns"
- gnunet-config -c /tmp/run/gnunet/gnunet.conf -s arm -o DEFAULTSERVICES -V "$defaultservices"
+ defaultservices="$defaultservices dns2gns"
+ # enable all installed transport plugins
+ gnunet-config -c $CONFIGFILE -s arm -o DEFAULTSERVICES -V "$defaultservices"
+ transport_plugins=$(gnunet-config -c $CONFIGFILE -s transport -o PLUGINS)
+ for transplug in /usr/lib/gnunet/libgnunet_plugin_transport_*.so; do
+ transplug=$( echo $transplug |
+ sed -ne 's!^.*_transport_\(.*\)\.so$!\1!p' )
+ [ -n "$( echo $transport_plugins | grep $transplug )" ] ||
+ transport_plugins="$transport_plugins $transplug"
+ done
+ gnunet-config -c $CONFIGFILE -s transport -o PLUGINS -V "$transport_plugins"
}
start_service() {
@@ -49,7 +60,7 @@ start_service() {
procd_open_instance
procd_set_param user gnunet
- procd_set_param command $PROG -c $CONFIGFILE
+ procd_set_param command $PROG -c $CONFIGFILE -l $LOGFILE
procd_set_param respawn
procd_close_instance
}