diff -ruN cbsd.bak/Makefile cbsd/Makefile --- cbsd.bak/Makefile 2016-10-24 22:38:05.114401000 +0300 +++ cbsd/Makefile 2016-10-24 22:37:39.000000000 +0300 @@ -1,7 +1,8 @@ -# $FreeBSD: head/sysutils/cbsd/Makefile 424311 2016-10-20 08:40:27Z vg $ +# $FreeBSD: head/sysutils/cbsd/Makefile 423966 2016-10-14 13:26:37Z vg $ PORTNAME= cbsd PORTVERSION= 11.0.4 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= olevole@olevole.ru diff -ruN cbsd.bak/files/cbsdd.in cbsd/files/cbsdd.in --- cbsd.bak/files/cbsdd.in 2016-10-24 22:38:05.209240000 +0300 +++ cbsd/files/cbsdd.in 2016-10-24 22:35:47.000000000 +0300 @@ -48,6 +48,7 @@ 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_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"