From owner-svn-ports-all@freebsd.org Sun Oct 30 09:22:16 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDB22C25365; Sun, 30 Oct 2016 09:22:16 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6E9474D; Sun, 30 Oct 2016 09:22:16 +0000 (UTC) (envelope-from jhale@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u9U9MF9F060897; Sun, 30 Oct 2016 09:22:15 GMT (envelope-from jhale@FreeBSD.org) Received: (from jhale@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u9U9MFZO060895; Sun, 30 Oct 2016 09:22:15 GMT (envelope-from jhale@FreeBSD.org) Message-Id: <201610300922.u9U9MFZO060895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhale set sender to jhale@FreeBSD.org using -f From: "Jason E. Hale" Date: Sun, 30 Oct 2016 09:22:15 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r424939 - in head/sysutils/cbsd: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Oct 2016 09:22:17 -0000 Author: jhale Date: Sun Oct 30 09:22:15 2016 New Revision: 424939 URL: https://svnweb.freebsd.org/changeset/ports/424939 Log: 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) Modified: head/sysutils/cbsd/Makefile head/sysutils/cbsd/files/cbsdd.in Modified: head/sysutils/cbsd/Makefile ============================================================================== --- head/sysutils/cbsd/Makefile Sun Oct 30 09:04:18 2016 (r424938) +++ head/sysutils/cbsd/Makefile Sun Oct 30 09:22:15 2016 (r424939) @@ -2,6 +2,7 @@ PORTNAME= cbsd PORTVERSION= 11.0.4 +PORTREVISION= 1 CATEGORIES= sysutils MAINTAINER= olevole@olevole.ru Modified: head/sysutils/cbsd/files/cbsdd.in ============================================================================== --- head/sysutils/cbsd/files/cbsdd.in Sun Oct 30 09:04:18 2016 (r424938) +++ head/sysutils/cbsd/files/cbsdd.in Sun Oct 30 09:22:15 2016 (r424939) @@ -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"