From 4db0e1d340293011e6a0c097d7cf6b9b2b8716aa Mon Sep 17 00:00:00 2001 From: Koen Wilde Date: Sat, 9 Jan 2016 13:31:45 +0100 Subject: [PATCH] Fix status command in FreeBSD init script If the init script is called with `status`, the rc.subr(8) routines check if the first argument associated with the pid in the pidfile is equal to `procname`. By default, `procname` is equal to the value of `command`. In our case, `command` contains a space (i.e. has multiple arguments), so `procname` can never be equal to the first argument of the command associated with the pid. Set `procname` to the first argument of `command` to fix the `status` command of the init script. --- scripts/init/freebsd/gogs | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/init/freebsd/gogs b/scripts/init/freebsd/gogs index 42258c405c..eb57157476 100644 --- a/scripts/init/freebsd/gogs +++ b/scripts/init/freebsd/gogs @@ -22,6 +22,7 @@ load_rc_config $name : ${gogs_directory:="/home/git"} command="${gogs_directory}/gogs web" +procname="$(echo $command |cut -d' ' -f1)" pidfile="${gogs_directory}/${name}.pid"