diff options
author | Jason E. Hale <jhale@FreeBSD.org> | 2016-10-30 09:22:15 +0000 |
---|---|---|
committer | Jason E. Hale <jhale@FreeBSD.org> | 2016-10-30 09:22:15 +0000 |
commit | 5a9ae1f20c1781fc73542e403003c1c70be75fed (patch) | |
tree | 072b3c9bbcff42b33e409b5592cf6aac7a3bf499 /sysutils/cbsd/files | |
parent | - Add LICENSE (diff) |
Fix rc.d script for status query
Bump PORTREVISION so new script is installed
PR: 213707
Reported by: Dusan Vejnovic <freebsd@dussan.org>
Patched by: Oleg Ginzburg <olevole@olevole.ru> (maintainer)
Notes
Notes:
svn path=/head/; revision=424939
Diffstat (limited to 'sysutils/cbsd/files')
-rw-r--r-- | sysutils/cbsd/files/cbsdd.in | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/sysutils/cbsd/files/cbsdd.in b/sysutils/cbsd/files/cbsdd.in index d4aa6072b702..e21ba93bf724 100644 --- a/sysutils/cbsd/files/cbsdd.in +++ b/sysutils/cbsd/files/cbsdd.in @@ -48,6 +48,7 @@ fi start_precmd=${name}_prestart stop_precmd=${name}_prestop stop_cmd=${name}_stop +status_cmd="${name}_status" reload_cmd=${name}_reload extra_commands="reload" @@ -79,14 +80,31 @@ cbsdd_prestop() cbsdd_stop() { - [ -f "${pidfile}" ] && kill -9 $( /bin/cat ${pidfile} ) + if [ -f "${pidfile}" ]; then + kill -9 $( /bin/cat ${pidfile} ) + /bin/rm -f ${pidfile} + fi } cbsdd_reload() { - [ -f "${pidfile}" ] && kill -9 $( /bin/cat ${pidfile} ) > /dev/null 2>&1 + if [ -f "${pidfile}" ]; then + kill -9 $( /bin/cat ${pidfile} ) > /dev/null 2>&1 + /bin/rm -f ${pidfile} + fi run_rc_command "start" exit 0 } +cbsdd_status() +{ + if [ -f "${pidfile}" ]; then + pids=$( /bin/cat ${pidfile} ) + echo "${name} is running as pid ${pids}." + else + echo "${name} is not running." + return 1 + fi +} + run_rc_command "$1" |