From 5a9ae1f20c1781fc73542e403003c1c70be75fed Mon Sep 17 00:00:00 2001 From: "Jason E. Hale" Date: Sun, 30 Oct 2016 09:22:15 +0000 Subject: Fix rc.d script for status query Bump PORTREVISION so new script is installed PR: 213707 Reported by: Dusan Vejnovic Patched by: Oleg Ginzburg (maintainer) --- sysutils/cbsd/Makefile | 1 + sysutils/cbsd/files/cbsdd.in | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) (limited to 'sysutils/cbsd') diff --git a/sysutils/cbsd/Makefile b/sysutils/cbsd/Makefile index fe805e55d879..78f8d21845a6 100644 --- a/sysutils/cbsd/Makefile +++ b/sysutils/cbsd/Makefile @@ -2,6 +2,7 @@ PORTNAME= cbsd PORTVERSION= 11.0.4 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= olevole@olevole.ru 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" -- cgit v1.2.3