From owner-freebsd-rc@FreeBSD.ORG Sun Dec 9 19:01:12 2007 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B12E16A420; Sun, 9 Dec 2007 19:01:12 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id CAB0113C4CC; Sun, 9 Dec 2007 19:01:11 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost.infracaninophile.co.uk [IPv6:::1]) by smtp.infracaninophile.co.uk (8.14.2/8.14.1) with ESMTP id lB9J166b042170; Sun, 9 Dec 2007 19:01:06 GMT (envelope-from m.seaman@infracaninophile.co.uk) Message-ID: <475C3B71.3040105@infracaninophile.co.uk> Date: Sun, 09 Dec 2007 19:01:05 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.9 (X11/20071122) MIME-Version: 1.0 To: freebsd-rc@FreeBSD.org References: <47548755.6080707@FreeBSD.org> In-Reply-To: <47548755.6080707@FreeBSD.org> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (smtp.infracaninophile.co.uk [IPv6:::1]); Sun, 09 Dec 2007 19:01:06 +0000 (GMT) X-Virus-Scanned: ClamAV 0.91.2/5056/Sun Dec 9 10:55:13 2007 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on happy-idiot-talk.infracaninophile.co.uk Cc: Doug Barton Subject: Re: bin/118325: [patch] new periodic script to test statuses of daemons started via rc system X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Dec 2007 19:01:12 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 In his response to bin/118325 where I had submitted a periodic script to test the status of all the services started through the rc system Doug Barton wrote: > First some meta-feedback. I am disturbed to hear that some of our > system scripts don't support the 'status' argument. I'm moderately > disturbed that some of the ones that don't start services return > something that could be interpreted as meaningful for it. Could you > work up a list for both categories, and send it to > freebsd-rc@freebsd.org? Bonus points if you include patches. :) I've delved a bit further into this. 'status' is not one of the standard commands provided via run_rc_command() in /etc/rc.subr. However, if the action of the rc script is to start up a long running process -- so that ${name}_pidfile or ${name}_procname are set, then there is a default status action to check if a process is running. Thus the majority of rc scripts do in fact provide a 'status' command, but by no means all. Out of the standard rc scripts in /etc/rc.d (FreeBSD 7.0-BETA3) the following scripts do not provide 'status': abi accounting addswap adjkerntz archdep atm1 atm2 atm3 auto_linklocal bgfsck bluetooth bridge ccd cleanvar cleartmp devfs dmesg dumpon encswap fsck gbde geli geli2 hostid hostname initrandom ip6fw ipfs ipfw ipnat ipsec jail kernel kldxref ldconfig local localpkg mdconfig mdconfig2 mixer motd mountcritlocal mountcritremote mountlate netif network_ipv6 nfsclient nfsserver nisdomain nsswitch ntpdate pfsync pppoed pwcheck quota random root routing savecore securelevel sppp swap1 syscons sysctl ugidfw virecover zfs This contrasts with rc scripts provided for ported software: virtually all of those start up daemon processes and hence provide a status command automatically. Where the action of the script is not to start up long-running processes there are three standard rc scripts that provide an alternate status command via extra_commands: ip6addrctl, ipfilter, pf. All of these print out various useful information in response to a status command. In the other direction, one of the standard scripts sets 'command' when not starting up a long running process, and so causing the standard 'status' command to be enabled -- newsyslog. Compare this to accounting or ldconfig. This patch: % diff -u newsyslog.orig newsyslog - --- newsyslog.orig 2007-12-09 17:18:03.000000000 +0000 +++ newsyslog 2007-12-09 17:18:53.000000000 +0000 @@ -12,14 +12,14 @@ name="newsyslog" rcvar=`set_rcvar` required_files="/etc/newsyslog.conf" - -command="/usr/sbin/${name}" +newsyslog_command="/usr/sbin/${name}" start_cmd="newsyslog_start" stop_cmd=":" newsyslog_start() { echo -n "Creating and/or trimming log files:" - - ${command} ${rc_flags} + ${newsyslog_command} ${rc_flags} echo "." } changes the output from the rather misleading: % ./newsyslog.orig status newsyslog is not running. to the more typical: % ./newsyslog status ./newsyslog: unknown directive 'status'. Usage: ./newsyslog [fast|force|one](start|stop|restart|rcvar) Of the other rc scripts I picked out as needing special treatment: othermta doesn't really use the rc.subr machinery, and now that rcorder will start up MTAs installed from ports at the correct point anyhow, I don't really see the need for it, except as a backwards compatibility thing. bsdstats.sh behaves like newsyslog: % /usr/local/etc/rc.d/bsdstats.sh status bsdstats is not running. but this I will take up with the port's maintainer off-line. There are probably a number of other ports that inadvertently trick the rc system into thinking it has started a daemon when it hasn't: I haven't looked. Matthew - -- Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHXDtx8Mjk52CukIwRCAvvAKCFUTxAGDRYyIVwOg/uArHgKj4gvgCeO5kf thOs4fcXLhlN8sqvM2xkevs= =3n4Y -----END PGP SIGNATURE----- From owner-freebsd-rc@FreeBSD.ORG Mon Dec 10 11:07:11 2007 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67AD316A417 for ; Mon, 10 Dec 2007 11:07:11 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 5702513C447 for ; Mon, 10 Dec 2007 11:07:11 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id lBAB7BqN073470 for ; Mon, 10 Dec 2007 11:07:11 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id lBAB7AX3073466 for freebsd-rc@FreeBSD.org; Mon, 10 Dec 2007 11:07:10 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 10 Dec 2007 11:07:10 GMT Message-Id: <200712101107.lBAB7AX3073466@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2007 11:07:11 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/98758 rc [jail] [patch] Templatize 'jail_fstab' in /etc/rc.d/ja o conf/98846 rc [jail] [patch] Templatize 'jail_rootdir' in /etc/rc.d/ o conf/105689 rc syslogd starts too late at boot o conf/107155 rc [ppp] /etc/rc.d/ppp-user does not bring up pppoe at bo o conf/107364 rc pf fails to start on bootup after system update from F o conf/118255 rc savecore never finding kernel core dumps (rcorder prob 6 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/48870 rc [PATCH] rc.network: allow to cancel interface status d o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/73677 rc [patch] add support for powernow states to power_profi o conf/74817 rc [patch] network.subr: fixed automatic configuration of o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/79196 rc [PATCH] configurable dummynet loading from /etc/rc.co o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/85363 rc syntax error in /etc/rc.d/devfs o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o conf/88913 rc [patch] wrapper support for rc.subr o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/89870 rc [patch] feature request to make netif verbose rc.conf o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/95162 rc [patch] Missing feature in rc.subr o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/102913 rc [jail] [patch] /etc/rc.d/named killall in jailed OS o conf/103486 rc [rc.d] [jail] [patch] rc.d/jail: mount fstab after dev o conf/103489 rc [rc.d] [jail] [patch] named_chroot_autoupdate doesn't o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/105145 rc [PATCH] add redial function to rc.d/ppp o conf/105568 rc [patch] Add more flexibility to rc.conf, to choose "_e o conf/106009 rc [patch] Fix pppoed startup script to process multiply o conf/109562 rc [rc.d] [patch] Make rc.d/devfs usable from command-lin o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/114119 rc [jail] [patch] /etc/rc.d/jail improvements for network o conf/117935 rc [patch] ppp fails to start at boot because of missing 31 problems total.