pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

gnunet: gnunetuser service



Module Name:	pkgsrc-wip
Committed By:	nikita <nikita%NetBSD.org@localhost>
Pushed By:	nikita
Date:		Sat Apr 9 17:07:38 2022 +0200
Changeset:	036f6db18a1a4b92a5342d5bba0c5db55a59c41c

Modified Files:
	gnunet/TODO
	gnunet/files/gnunetuser.in

Log Message:
gnunet: gnunetuser service

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=036f6db18a1a4b92a5342d5bba0c5db55a59c41c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 gnunet/TODO                |  1 -
 gnunet/files/gnunetuser.in | 19 +++++++++++--------
 2 files changed, 11 insertions(+), 9 deletions(-)

diffs:
diff --git a/gnunet/TODO b/gnunet/TODO
index 46ed07f47e..25996594bd 100644
--- a/gnunet/TODO
+++ b/gnunet/TODO
@@ -6,4 +6,3 @@
       /usr/pkg/lib//gnunet/libexec/gnunet-rest-server -c /home/nikita/.config/gnunet.conf
 - build on linux and freebsd
   - currently broken on Linux due to bluez-libs being too old and not building.
-- should we log to varbase/log/gnunet?
\ No newline at end of file
diff --git a/gnunet/files/gnunetuser.in b/gnunet/files/gnunetuser.in
index d645df9f18..95b31dc396 100755
--- a/gnunet/files/gnunetuser.in
+++ b/gnunet/files/gnunetuser.in
@@ -34,14 +34,15 @@ pidfile="/tmp/gnunet-${gnunetuser_user}-runtime/gnunet-service-arm.sock"
 
 start_cmd="gnunet_start"
 start_precmd="gnunet_precmd"
+restart_cmd="gnunet_restart"
 stop_cmd="gnunet_stop"
 
 gnunet_env="HOME=${gnunetuser_user_home} USER=${gnunetuser_user} TMP=/tmp GNUNET_PREFIX=@PREFIX@"
 
 check_pidfile()
 {
-    pid=$(pgrep -U "$gnunetuser_user" "${command}"$)
-    echo -n "${pid}"
+	pid=$(pgrep -U "$gnunetuser_user" "${command}"$)
+	echo -n "${pid}"
 }
 
 gnunet_precmd()
@@ -60,19 +61,21 @@ gnunet_start()
 	eval $doit
 }
 
+gnunet_restart()
+{
+	@ECHO@ "Restarting ${name}."
+	doit="@SU@ -m ${gnunetuser_user} -c '${gnunet_env} ${command} ${command_args} -r'"
+	eval $doit
+}
+
 # stopping this is broken (with one service hanging around until you KILL it).
 gnunet_stop()
 {
 	@ECHO@ "Stopping ${name}."
 	doit="@SU@ -m ${gnunetuser_user} -c '${gnunet_env} ${command} ${command_args} -e'"
-	eval $doit &
 	pkill -f gnunet-rest-server
 	kill -9 $(pgrep -f gnunet-rest-server)
-	# kill `cat ${pidfile}` 2>/dev/null
-	# check_pidfile
-	# kill ${pid}
-	# sleep 1
-	# @RM@ -rf "/tmp/gnunet-${gnunetuser_user}-runtime" 2>/dev/null 2>&1
+	eval $doit
 }
 
 if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then


Home | Main Index | Thread Index | Old Index