summaryrefslogtreecommitdiff
path: root/sysutils/cbsd/files/cbsdd.in
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils/cbsd/files/cbsdd.in')
-rw-r--r--sysutils/cbsd/files/cbsdd.in22
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"