From owner-freebsd-rc@FreeBSD.ORG Mon Jan 4 10:30:59 2010 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 68B85106568F; Mon, 4 Jan 2010 10:30:59 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4174A8FC0C; Mon, 4 Jan 2010 10:30:59 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o04AUxPv036760; Mon, 4 Jan 2010 10:30:59 GMT (envelope-from gavin@freefall.freebsd.org) Received: (from gavin@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o04AUxTN036754; Mon, 4 Jan 2010 10:30:59 GMT (envelope-from gavin) Date: Mon, 4 Jan 2010 10:30:59 GMT Message-Id: <201001041030.o04AUxTN036754@freefall.freebsd.org> To: gavin@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: gavin@FreeBSD.org Cc: Subject: Re: conf/135338: [rc.d] pf startup order seems broken [regression] 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, 04 Jan 2010 10:30:59 -0000 Old Synopsis: pf startup order seems broken New Synopsis: [rc.d] pf startup order seems broken [regression] Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: gavin Responsible-Changed-When: Mon Jan 4 10:30:20 UTC 2010 Responsible-Changed-Why: Submitter believes this is a regression introduced with r193198 http://www.freebsd.org/cgi/query-pr.cgi?pr=135338 From owner-freebsd-rc@FreeBSD.ORG Mon Jan 4 11:07:05 2010 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 0640A10656A5 for ; Mon, 4 Jan 2010 11:07:05 +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 E72AE8FC1F for ; Mon, 4 Jan 2010 11:07:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o04B74Iv065003 for ; Mon, 4 Jan 2010 11:07:04 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o04B74iS065001 for freebsd-rc@FreeBSD.org; Mon, 4 Jan 2010 11:07:04 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 4 Jan 2010 11:07:04 GMT Message-Id: <201001041107.o04B74iS065001@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, 04 Jan 2010 11:07:05 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/141909 rc [rc.subr] [patch] add rc.conf.d support to /usr/local o conf/141907 rc [rc.d] Bug if mtu (maybe others?) is set as first argu o conf/141678 rc [patch] A minor enhancement to how /etc/rc.d/jail dete o conf/141275 rc [request] dhclient(8) rc script should print something o conf/141258 rc /etc/rc.d/tmp may act incorrectly based on unprivleged o conf/140440 rc [patch] allow local command files in rc.{suspend,resum o conf/140261 rc [patch] Improve flexibility of mdconfig2 startup scrip o conf/138208 rc [rc] [patch] Making rc.firewall (workstation) IPv6 awa o conf/137629 rc [rc] background_dhclient rc.conf option causing double o conf/137470 rc [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameter o conf/136875 rc [request] _flags appending o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/135338 rc [rc.d] pf startup order seems broken [regression] o conf/134918 rc [patch] rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/134006 rc [patch] Unload console screensaver kernel modules if s o conf/133987 rc [rc.d] defaultroute broken with DHCP in some cases o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/132483 rc rc.subr(8) [patch] setfib(1) support for rc.subr o conf/132476 rc [rc.d] [patch] add support setfib(1) in rc.d/routing o conf/130414 rc [patch] rc services started with onestart are not stop o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/127917 rc [patch] dumpon rejects on start with physmem>swap even o bin/126562 rc rcorder(8) fails to run unrelated startup scripts when o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped o bin/126324 rc [patch] rc.d/tmp: Prevent mounting /tmp in second tim o conf/124747 rc [patch] savecore can't create dump from encrypted swap o conf/124248 rc [jail] [patch] add support for nice value for rc.d/jai o conf/123734 rc [patch] Chipset VIA CX700 requires extra initializatio o conf/123222 rc [patch] Add rtprio(1)/idprio(1) support to rc.subr(8). o conf/122477 rc [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring o conf/122170 rc [patch] [request] New feature: notify admin via page o o kern/121566 rc [nfs] [request] [patch] ethernet iface should be broug o conf/120431 rc [patch] devfs.rules are not initialized under certain o conf/120406 rc [devd] [patch] Handle newly attached pcm devices (eg. o conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses o conf/118255 rc savecore never finding kernel core dumps (rcorder prob o conf/117935 rc [patch] ppp fails to start at boot because of missing o conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/109562 rc [rc.d] [patch] [request] Make rc.d/devfs usable from c o conf/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p o conf/105689 rc [ppp] [request] syslogd starts too late at boot o conf/105568 rc [patch] [request] Add more flexibility to rc.conf, to o conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/56934 rc [patch] rc.firewall rules for natd expect an interface o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/44170 rc [patch] Add ability to run multiple pppoed(8) on start 67 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Jan 4 12:32:53 2010 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 67C841065745; Mon, 4 Jan 2010 12:32:53 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3F6488FC0A; Mon, 4 Jan 2010 12:32:53 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o04CWrjX048499; Mon, 4 Jan 2010 12:32:53 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o04CWrT1048495; Mon, 4 Jan 2010 12:32:53 GMT (envelope-from linimon) Date: Mon, 4 Jan 2010 12:32:53 GMT Message-Id: <201001041232.o04CWrT1048495@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/142304: rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack examples in /etc/defaults/rc.conf 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, 04 Jan 2010 12:32:53 -0000 Old Synopsis: mdconfig and mdconfig2 rc.d scripts lack examples in /etc/defaults/rc.conf New Synopsis: rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack examples in /etc/defaults/rc.conf Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Mon Jan 4 12:32:06 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=142304 From owner-freebsd-rc@FreeBSD.ORG Tue Jan 5 08:18:33 2010 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 30F6A1065676 for ; Tue, 5 Jan 2010 08:18:33 +0000 (UTC) (envelope-from ykrapiva@gmail.com) Received: from mail-ew0-f226.google.com (mail-ew0-f226.google.com [209.85.219.226]) by mx1.freebsd.org (Postfix) with ESMTP id B80268FC12 for ; Tue, 5 Jan 2010 08:18:32 +0000 (UTC) Received: by ewy26 with SMTP id 26so13956948ewy.3 for ; Tue, 05 Jan 2010 00:18:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer; bh=GTwSXWqB3o19eXiqlSPUQ8O3aLCriCFqawcwFaLZtYo=; b=eazEmYVFvo3WF4XdjKISLBTMIRIgWEPM6wxQDchYgCs3yJ2q34saQcKMMB5UrvgqsT bAINgmPjWQsgXJg4kE8QVXQ1wkNMNupCiskAux+Q+Bc6YWcXdrvUWGIge1KARj7pB4SX 6BhN7AGBycT3irEYHXVbP1cHCka+1dcul2EQM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer; b=UuI5aX25Qflto1b+EUC+Sm8MmSzqteB836RSNr7NA+dtWVsWOcQzyXN25kihZ6hkhP CY2J8gLIQ1lJ8w+mK2u4uNz3gZHjcokq3m6xMFIUFcTxS+05T5yTOC5d6GN9k5evIrfY jrhos6lbNf70dYIcIGwQQpmrKgaFG1eG0Og5E= Received: by 10.213.99.138 with SMTP id u10mr4301248ebn.12.1262677916487; Mon, 04 Jan 2010 23:51:56 -0800 (PST) Received: from ?77.52.109.96? ([77.52.109.96]) by mx.google.com with ESMTPS id 14sm13121454ewy.15.2010.01.04.23.51.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 04 Jan 2010 23:51:55 -0800 (PST) From: Yevgen Krapiva To: freebsd-rc@freebsd.org Date: Tue, 05 Jan 2010 09:51:51 +0200 Message-ID: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 FreeBSD GNOME Team Port Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Need help with shutdowning a java process 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: Tue, 05 Jan 2010 08:18:33 -0000 Hi all, I have the following rc script: .. name="openjsip_location_service" .. # Execution command runcmd="java -cp $CLASSPATH -Djava.security.policy=conf/policy.all -Djava.rmi.server.codebase=\"file://$OPENJSIP_REMOTE_LIB file://$JAIN_SIP_API_LIB\" openjsip.locationservice.LocationService conf/location-service.properties" pidfile="/var/run/${name}.pid" command="/usr/sbin/daemon" flags="-p ${pidfile} $runcmd" # When I run java from /usr/local/bin I run javavm indeed (convenient wrapper for switching Java VMs). # So I need to get the correct processname from output of 'ps' command # Subvert the check_pidfile procname check. if [ -f $pidfile ]; then read rc_pid junk < $pidfile if [ ! -z "$rc_pid" ]; then procname=`ps -o command= $rc_pid` echo rc_pid=$rc_pid echo procname=$procname fi fi run_rc_command "$1" The service starts well but I can't check the status or shutdown it. root@etc/rc.d #./openjsip-location-service onestatus rc_pid=34459 procname=/usr/local/diablo-jdk1.6.0/bin/java -cp :/usr/local/share/openjsip/lib/jain-sdp-1.0.115.jar:/usr/local/share/openjsip/lib/jain-sip-api-1.2.jar:/usr/local/share/openjsip/lib/jai ./openjsip-location-service: WARNING: no shebang line in /usr/local/diablo-jdk1.6.0/bin/java openjsip_location_service is not running. What does it want from me saying that "./openjsip-location-service: WARNING: no shebang line in /usr/local/diablo-jdk1.6.0/bin/java" ? Can anybody help ? From owner-freebsd-rc@FreeBSD.ORG Tue Jan 5 17:56:09 2010 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 16B4B106566B for ; Tue, 5 Jan 2010 17:56:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id BEEA48FC0A for ; Tue, 5 Jan 2010 17:56:08 +0000 (UTC) Received: (qmail 15762 invoked by uid 399); 5 Jan 2010 17:56:08 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 5 Jan 2010 17:56:08 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B437D3D.6070209@FreeBSD.org> Date: Tue, 05 Jan 2010 09:56:13 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Yevgen Krapiva References: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua> In-Reply-To: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua> X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: Need help with shutdowning a java process 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: Tue, 05 Jan 2010 17:56:09 -0000 To start with, you should really read the article at http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html, I think it would help you get a picture of how some of this should look. Some more comments below. Yevgen Krapiva wrote: > Hi all, > > I have the following rc script: > > .. > name="openjsip_location_service" > .. > # Execution command > runcmd="java -cp $CLASSPATH -Djava.security.policy=conf/policy.all > -Djava.rmi.server.codebase=\"file://$OPENJSIP_REMOTE_LIB > file://$JAIN_SIP_API_LIB\" openjsip.locationservice.LocationService > conf/location-service.properties" > > pidfile="/var/run/${name}.pid" > command="/usr/sbin/daemon" > flags="-p ${pidfile} $runcmd" Rather than having 2 different variables, you should combine your "flags" and "runcmd" variables into command_args, which is the usual way to accomplish what you seem to be trying to accomplish. > # When I run java from /usr/local/bin I run javavm indeed (convenient > wrapper for switching Java VMs). > # So I need to get the correct processname from output of 'ps' command > > # Subvert the check_pidfile procname check. Yeah, let's not subvert stuff. :) I'm not really familiar with java, but what I think you need to do is to set "command_interpreter=/usr/local/diablo-jdk1.6.0/bin/java" which should give rc.subr the information it needs to find your process. If that doesn't work, do 'ps -auxww | grep openjsip' and show us the results. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-freebsd-rc@FreeBSD.ORG Wed Jan 6 02:52:09 2010 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 500DE1065676 for ; Wed, 6 Jan 2010 02:52:09 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id 1056B8FC14 for ; Wed, 6 Jan 2010 02:52:08 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 9so3781471qwb.7 for ; Tue, 05 Jan 2010 18:51:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.127.40 with SMTP id e40mr3934461qas.60.1262744822854; Tue, 05 Jan 2010 18:27:02 -0800 (PST) X-Originating-IP: [128.95.133.98] Date: Tue, 5 Jan 2010 18:27:02 -0800 Message-ID: From: Rob Farmer To: freebsd-rc@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: devfs ruleset processing in rc.subr 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: Wed, 06 Jan 2010 02:52:09 -0000 Hello, I am trying to fix an issue with the port shells/scponly's rc.d script and I think I may have come across a bug in /etc/rc.subr related to devfs. Here's what I'm trying to do: make_devfs() { # $1 is the user name whose home directory needs a minimal # devfs created. If ~/dev exists, it will be deleted. eval DEV="~$1/dev" while /sbin/umount "${DEV}" 2>/dev/null; do :; done /bin/rm -rf "${DEV}" /bin/mkdir -p "${DEV}" devfs_domount "${DEV}" if devfs_init_rulesets; then devfs_apply_ruleset "1" "${DEV}" && \ devfs_apply_ruleset "2" "${DEV}" || \ /sbin/umount "${DEV}" 2>/dev/null fi } The devfs_apply_ruleset function doesn't seem to process its arguments properly - it fails on the second invocation: + devfs_apply_ruleset 1 /home/test/dev + local devdir rs _me + [ -n 1 ] + eval 'rs=$1' + rs=1 + [ -n /home/test/dev ] + devdir='-m /home/test/dev' + _me=devfs_apply_ruleset + [ -z 1 ] + debug 'devfs_apply_ruleset: applying ruleset (1) to mount-point (/home/test/dev)' + /sbin/devfs -m /home/test/dev rule -s 1 applyset + return 0 + devfs_apply_ruleset 2 /home/test/dev + local devdir rs _me + [ -n 2 ] + eval 'rs=$2' + rs=/home/test/dev + [ -n /home/test/dev ] + devdir='-m /home/test/dev' + _me=devfs_apply_ruleset + [ -z /home/test/dev ] + debug 'devfs_apply_ruleset: applying ruleset (/home/test/dev) to mount-point (/home/test/dev)' + /sbin/devfs -m /home/test/dev rule -s /home/test/dev applyset devfs rule: error converting to number: /home/test/dev + warn 'devfs_apply_ruleset: unable to apply ruleset /home/test/dev to /home/test/dev' + [ -x /usr/bin/logger ] + logger 'scponlyc: WARNING: devfs_apply_ruleset: unable to apply ruleset /home/test/dev to /home/test/dev' + echo 'scponlyc: WARNING: devfs_apply_ruleset: unable to apply ruleset /home/test/dev to /home/test/dev' scponlyc: WARNING: devfs_apply_ruleset: unable to apply ruleset /home/test/dev to /home/test/dev + return 1 + /sbin/umount /home/test/dev + read USER + _return=0 + [ 0 -ne 0 ] + return 0 + _run_rc_postcmd + [ -n '' ] + return 0 + return 0 The following fixes it for me (on 9.0): Index: rc.subr =================================================================== --- rc.subr (revision 201473) +++ rc.subr (working copy) @@ -1378,7 +1378,7 @@ devfs_set_ruleset() { local devdir rs _me - [ -n "$1" ] && eval rs=\$$1 || rs= + [ -n "$1" ] && eval rs=$1 || rs= [ -n "$2" ] && devdir="-m "$2"" || devdir= _me="devfs_set_ruleset" @@ -1403,7 +1403,7 @@ devfs_apply_ruleset() { local devdir rs _me - [ -n "$1" ] && eval rs=\$$1 || rs= + [ -n "$1" ] && eval rs=$1 || rs= [ -n "$2" ] && devdir="-m "$2"" || devdir= _me="devfs_apply_ruleset" So, my question is, is this a bug or am I not understanding something here? ---- Rob Farmer From owner-freebsd-rc@FreeBSD.ORG Wed Jan 6 06:49:09 2010 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 099921065695 for ; Wed, 6 Jan 2010 06:49:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 90F218FC18 for ; Wed, 6 Jan 2010 06:49:08 +0000 (UTC) Received: (qmail 26787 invoked by uid 399); 6 Jan 2010 06:49:06 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 6 Jan 2010 06:49:06 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B443268.7040905@FreeBSD.org> Date: Tue, 05 Jan 2010 22:49:12 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Thunderbird 2.0.0.23 (X11/20091206) MIME-Version: 1.0 To: Rob Farmer References: In-Reply-To: X-Enigmail-Version: 0.96.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: devfs ruleset processing in rc.subr 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: Wed, 06 Jan 2010 06:49:09 -0000 Rob Farmer wrote: > Hello, > > I am trying to fix an issue with the port shells/scponly's rc.d script > and I think I may have come across a bug in /etc/rc.subr related to > devfs. > > Here's what I'm trying to do: > > make_devfs() { > # $1 is the user name whose home directory needs a minimal > # devfs created. If ~/dev exists, it will be deleted. > > eval DEV="~$1/dev" > while /sbin/umount "${DEV}" 2>/dev/null; do :; done This definitely shouldn't be set up to spin forever like this ... probably needs to try the umount || err > /bin/rm -rf "${DEV}" Personally I would rather see here: rmdir $DEV || err 1 "Unable to remove $DEV" Although frankly I'm a little confused as to why you go through all these gymnastics, although I do admire your thoroughness. :) What are your goals for all the safety features? > /bin/mkdir -p "${DEV}" > devfs_domount "${DEV}" > if devfs_init_rulesets; then > devfs_apply_ruleset "1" "${DEV}" && \ # devfs_apply_ruleset ruleset [dir] # Apply ruleset number $ruleset to the devfs mountpoint $dir. # The ruleset argument must be a ruleset name as specified # in a devfs.rules(5) file. Take a look at /etc/defaults/devfs.rules if you're interested in how the symbolic names are assigned. hth, Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso From owner-freebsd-rc@FreeBSD.ORG Wed Jan 6 06:58:09 2010 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 A2C421065694 for ; Wed, 6 Jan 2010 06:58:09 +0000 (UTC) (envelope-from ykrapiva@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 177ED8FC0A for ; Wed, 6 Jan 2010 06:58:08 +0000 (UTC) Received: by fxm27 with SMTP id 27so2462903fxm.3 for ; Tue, 05 Jan 2010 22:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :in-reply-to:references:content-type:date:message-id:mime-version :x-mailer; bh=wE9RRJyWT7U8jo2nf1/rvbIynBymYR+osno3/78SXuU=; b=p/Trbb1eflsjq00iFb0L96sPjQomwe4r5nSX12E7ETwI5ifct8b2rTNR8PjspsbBB5 +L9175RWjseVw7Z9SjkCdiPQY1SLi1jjMEZsoWIaUWSzNAqZurUGILiCMIWPrTT/nKle PQxWShb8fhnsVjx5MeU1XX+BI9YjarSezuIwI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer; b=QlFDxJzj9u1RpUfMxXitdxUqUCo9wwTtpXQ6RMn/g5Dy75QHTxpYOjtN0v/qfMl8XV OinI/GhrOpQoua2KUHC+8XQhZcdF9+hNUGD2StOrpNH0YU/4A1f/OD7DUd4b5KwzCUWa 0wzENNm/HUZQcHXpMHndZyIgqgRq2IZD3R84Q= Received: by 10.223.145.130 with SMTP id d2mr2319901fav.78.1262761081938; Tue, 05 Jan 2010 22:58:01 -0800 (PST) Received: from ?77.52.237.118? ([77.52.237.118]) by mx.google.com with ESMTPS id 22sm29724046fkq.24.2010.01.05.22.57.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 05 Jan 2010 22:58:00 -0800 (PST) From: Yevgen Krapiva To: Doug Barton In-Reply-To: <4B437D3D.6070209@FreeBSD.org> References: <1262677911.2694.11.camel@kv-po-ykrapivanb.umc.com.ua> <4B437D3D.6070209@FreeBSD.org> Date: Wed, 06 Jan 2010 08:57:56 +0200 Message-ID: <1262761076.3830.21.camel@kv-po-ykrapivanb.umc.com.ua> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 FreeBSD GNOME Team Port Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-rc@freebsd.org Subject: Re: Need help with shutdowning a java process 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: Wed, 06 Jan 2010 06:58:09 -0000 Thanks, I've already read the article but still missing some things. So, I've followed your advice: Now rc script looks like: pidfile="/var/run/${name}.pid" command="/usr/sbin/daemon" command_args="-p ${pidfile} $runcmd" command_interpreter="/usr/local/diablo-jdk1.6.0/bin/java" #flags="-p ${pidfile} $runcmd" Testing script: root@etc/rc.d #./openjsip-location-service onestart ./openjsip-location-service: WARNING: no shebang line in /usr/sbin/daemon Starting openjsip_location_service. 2010-01-06 06:34:13,813 INFO - Location Service started... root@etc/rc.d #./openjsip-location-service onestatus ./openjsip-location-service: WARNING: no shebang line in /usr/sbin/daemon openjsip_location_service is not running. root@etc/rc.d #ps wwaux | grep openjsip root 19814 0.0 0.7 894148 22688 ?? Is 8:34AM 0:00.48 /usr/local/diablo-jdk1.6.0/bin/java -cp :/usr/local/share/openjsip/lib/jain-sdp-1.0.115.jar:/usr/local/share/openjsip/lib/jain-sip-api-1.2.jar:/usr/local/share/openjsip/lib/jain-sip-ri-1.2.115.jar:/usr/local/share/openjsip/lib/jain-sip-sdp-1.2.115.jar:/usr/local/share/openjsip/lib/log4j-1.2.15.jar:/usr/local/share/openjsip/lib/openjsip-0.0.5.jar:/usr/local/share/openjsip/lib/openjsip-remote-0.0.5.jar:/usr/local/share/openjsip/lib/snmp.jar -Djava.security.policy=conf/policy.all -Djava.rmi.server.codebase=file:///usr/local/share/openjsip/lib/openjsip-remote-0.0.5.jar file:///usr/local/share/openjsip/lib/jain-sip-api-1.2.jar openjsip.locationservice.LocationService conf/location-service.properties What means "no shebang line" ? Ok, when I comment command_interpreter line, no warnings are issued. But checking status is also not working. Running sh -x openjsip-location-service showed that: + _pidfile=/var/run/openjsip_location_service.pid + _procname=/usr/sbin/daemon + _interpreter='' So, procname is incorrect. No daemon in processes, there is java only. So, I'm trying to set correct process name: # Subvert the check_pidfile procname check. if [ -f $pidfile ]; then read rc_pid junk < $pidfile if [ ! -z "$rc_pid" ]; then procname=`ps -o command= $rc_pid` echo rc_pid=$rc_pid echo procname=$procname fi fi Testing: root@etc/rc.d #./openjsip-location-service onestatus rc_pid=24821 procname=/usr/local/diablo-jdk1.6.0/bin/java -cp :/usr/local/share/openjsip/lib/jain-sdp-1.0.115.jar:/usr/local/share/openjsip/lib/jain-sip-api-1.2.jar:/usr/local/share/openjsip/lib/jai ./openjsip-location-service: WARNING: no shebang line in /usr/local/diablo-jdk1.6.0/bin/java openjsip_location_service is not running. Running with sh -x showed that: + _pidfile=/var/run/openjsip_location_service.pid + _procname=/usr/local/diablo-jdk1.6.0/bin/java + _interpreter=-cp May be I should simply override stop_cmd and kill process manually using PID only ? On Tue, 2010-01-05 at 09:56 -0800, Doug Barton wrote: > To start with, you should really read the article at > http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html, > I think it would help you get a picture of how some of this should > look. Some more comments below. > > Yevgen Krapiva wrote: > > Hi all, > > > > I have the following rc script: > > > > .. > > name="openjsip_location_service" > > .. > > # Execution command > > runcmd="java -cp $CLASSPATH -Djava.security.policy=conf/policy.all > > -Djava.rmi.server.codebase=\"file://$OPENJSIP_REMOTE_LIB > > file://$JAIN_SIP_API_LIB\" openjsip.locationservice.LocationService > > conf/location-service.properties" > > > > pidfile="/var/run/${name}.pid" > > command="/usr/sbin/daemon" > > > flags="-p ${pidfile} $runcmd" > > Rather than having 2 different variables, you should combine your > "flags" and "runcmd" variables into command_args, which is the usual > way to accomplish what you seem to be trying to accomplish. > > > # When I run java from /usr/local/bin I run javavm indeed (convenient > > wrapper for switching Java VMs). > > # So I need to get the correct processname from output of 'ps' command > > > > # Subvert the check_pidfile procname check. > > Yeah, let's not subvert stuff. :) I'm not really familiar with java, > but what I think you need to do is to set > "command_interpreter=/usr/local/diablo-jdk1.6.0/bin/java" which should > give rc.subr the information it needs to find your process. If that > doesn't work, do 'ps -auxww | grep openjsip' and show us the results. > > > Doug > From owner-freebsd-rc@FreeBSD.ORG Wed Jan 6 09:18:34 2010 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 A5C4E1065765 for ; Wed, 6 Jan 2010 09:18:34 +0000 (UTC) (envelope-from rfarmer@predatorlabs.net) Received: from mail-qy0-f174.google.com (mail-qy0-f174.google.com [209.85.221.174]) by mx1.freebsd.org (Postfix) with ESMTP id 6C27D8FC0A for ; Wed, 6 Jan 2010 09:18:34 +0000 (UTC) Received: by qyk4 with SMTP id 4so7151785qyk.7 for ; Wed, 06 Jan 2010 01:18:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.78.17 with SMTP id i17mr1521836qak.359.1262769500233; Wed, 06 Jan 2010 01:18:20 -0800 (PST) X-Originating-IP: [128.95.133.98] In-Reply-To: <4B443268.7040905@FreeBSD.org> References: <4B443268.7040905@FreeBSD.org> Date: Wed, 6 Jan 2010 01:18:20 -0800 Message-ID: From: Rob Farmer To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-rc@freebsd.org Subject: Re: devfs ruleset processing in rc.subr 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: Wed, 06 Jan 2010 09:18:34 -0000 On Tue, Jan 5, 2010 at 10:49 PM, Doug Barton wrote: > Rob Farmer wrote: >> Hello, >> >> I am trying to fix an issue with the port shells/scponly's rc.d script >> and I think I may have come across a bug in /etc/rc.subr related to >> devfs. >> >> Here's what I'm trying to do: >> >> make_devfs() { >> =A0 =A0 =A0 # $1 is the user name whose home directory needs a minimal >> =A0 =A0 =A0 # devfs created. If ~/dev exists, it will be deleted. >> >> =A0 =A0 =A0 eval DEV=3D"~$1/dev" >> =A0 =A0 =A0 while /sbin/umount "${DEV}" 2>/dev/null; do :; done > > This definitely shouldn't be set up to spin forever like this ... > probably needs to try the umount || err How would you recommend to do this? I have the following, but I have a feeling there must be a simpler way: if /sbin/mount | grep "${DEV}" >/dev/null 2>&1; then /sbin/umount "${DEV}" 2>/dev/null fi > >> =A0 =A0 =A0 /bin/rm -rf "${DEV}" > > Personally I would rather see here: > rmdir $DEV || err 1 "Unable to remove $DEV" Changed. > > Although frankly I'm a little confused as to why you go through all > these gymnastics, although I do admire your thoroughness. :) =A0What are > your goals for all the safety features? I'm not the original author - I'm pretty new to shell scripting so I'm just trying to get it working with the minimum amount of changes so I don't accidentally introduce more mistakes. > >> =A0 =A0 =A0 /bin/mkdir -p "${DEV}" >> =A0 =A0 =A0 devfs_domount "${DEV}" >> =A0 =A0 =A0 if devfs_init_rulesets; then >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 devfs_apply_ruleset "1" "${DEV}" && \ > > # devfs_apply_ruleset ruleset [dir] > # =A0 =A0 =A0 Apply ruleset number $ruleset to the devfs mountpoint $dir. > # =A0 =A0 =A0 The ruleset argument must be a ruleset name as specified > # =A0 =A0 =A0 in a devfs.rules(5) file. > > Take a look at /etc/defaults/devfs.rules if you're interested in how > the symbolic names are assigned. OK - I see now, I was trying to using the rule numbers instead of the symbolic names. It works fine when I do it the way it was designed :) The full script is at http://students.washington.edu/rfarmer/scponly.in if you want to take a look before I submit it. Thanks for your help, Rob Farmer > > > hth, > > Doug > > -- > > =A0 =A0 =A0 =A0Improve the effectiveness of your Internet presence with > =A0 =A0 =A0 =A0a domain name makeover! =A0 =A0http://SupersetSolutions.co= m/ > > =A0 =A0 =A0 =A0Computers are useless. They can only give you answers. > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-- Pablo Picasso > > From owner-freebsd-rc@FreeBSD.ORG Thu Jan 7 14:35:20 2010 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 6055F106566B for ; Thu, 7 Jan 2010 14:35:20 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) by mx1.freebsd.org (Postfix) with ESMTP id 216E98FC1A for ; Thu, 7 Jan 2010 14:35:19 +0000 (UTC) Received: from localhost (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 023E219E045 for ; Thu, 7 Jan 2010 15:35:18 +0100 (CET) Received: from [192.168.1.2] (r5bb235.net.upc.cz [86.49.61.235]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id C041619E044 for ; Thu, 7 Jan 2010 15:35:15 +0100 (CET) Message-ID: <4B45F123.2030105@quip.cz> Date: Thu, 07 Jan 2010 15:35:15 +0100 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.6) Gecko/20091206 SeaMonkey/2.0.1 MIME-Version: 1.0 To: freebsd-rc@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: bgfsck vs. background-fsck 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: Thu, 07 Jan 2010 14:35:20 -0000 Hi, can somebody explain me, why /etc/rc.d/bgfsck is using hyphen in the name variable and the name is not consistent with name of the script nor rcvar? /etc/rc.d/bgfsck: name="background-fsck" rcvar="background_fsck" start_cmd="bgfsck_start" bgfsck is the only one script using hyphen in the name and it is causing some problems with eval: debug output for rc.d/bgfsck + eval '_chdir=$background-fsck_chdir' '_chroot=$background-fsck_chroot' '_nice=$background-fsck_nice' '_user=$background-fsck_user' '_group=$background-fsck_group' '_groups=$background-fsck_groups' + _chdir=-fsck_chdir _chroot=-fsck_chroot _nice=-fsck_nice _user=-fsck_user _group=-fsck_group _groups=-fsck_groups debug output for rc.d/bgfsck + eval '_chdir=$sshd_chdir' '_chroot=$sshd_chroot' '_nice=$sshd_nice' '_user=$sshd_user' '_group=$sshd_group' '_groups=$sshd_groups' + _chdir='' _chroot='' _nice='' _user='' _group='' _groups='' I think that variables should be empty in both cases. Am I wrong? What is the reason to have hyphen in the name? I found this problem when I tried to add cpuset support in to rc.subr (I will post about it later) Miroslav Lachman From owner-freebsd-rc@FreeBSD.ORG Thu Jan 7 19:15:39 2010 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 E90AD1065698; Thu, 7 Jan 2010 19:15:39 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8B6F48FC12; Thu, 7 Jan 2010 19:15:39 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o07JFd19091174; Thu, 7 Jan 2010 19:15:39 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o07JFdTG091170; Thu, 7 Jan 2010 19:15:39 GMT (envelope-from linimon) Date: Thu, 7 Jan 2010 19:15:39 GMT Message-Id: <201001071915.o07JFdTG091170@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/142434: [patch] Add cpuset(1) support to rc.subr(8) 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: Thu, 07 Jan 2010 19:15:40 -0000 Old Synopsis: [patch] Add cpuset(1) support to rc.subr New Synopsis: [patch] Add cpuset(1) support to rc.subr(8) Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Thu Jan 7 19:15:18 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=142434 From owner-freebsd-rc@FreeBSD.ORG Thu Jan 7 19:31:38 2010 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 198C5106566B for ; Thu, 7 Jan 2010 19:31:38 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) by mx1.freebsd.org (Postfix) with ESMTP id CDFDB8FC08 for ; Thu, 7 Jan 2010 19:31:37 +0000 (UTC) Received: from localhost (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id E4C5119E045 for ; Thu, 7 Jan 2010 20:31:36 +0100 (CET) Received: from [192.168.1.2] (r5bb235.net.upc.cz [86.49.61.235]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 3D9A619E046 for ; Thu, 7 Jan 2010 20:31:28 +0100 (CET) Message-ID: <4B46368F.3050606@quip.cz> Date: Thu, 07 Jan 2010 20:31:27 +0100 From: Miroslav Lachman <000.fbsd@quip.cz> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1.6) Gecko/20091206 SeaMonkey/2.0.1 MIME-Version: 1.0 To: freebsd-rc@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: cpuset, setfib and other features (not) supported by rc.subr 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: Thu, 07 Jan 2010 19:31:38 -0000 Hi, I would like to discuss adding general support in to rc.subr for things like cpuset, setfib etc. FreeBSD has some useful features (compared to other OSes) but those are not generally supported by rc.subr. For example setfib support is added (reinvented again and again) on per rc script basis in base rc scripts and in ports rc scripts too. cpuset has no support at all. I think that adding support in rc.subr is the right way to do things like this. Then these features will be available to all (or most of) rc scripts without need to modify them and these feature will become more used by more people. I created patch for cpuset: conf/142434: [patch] Add cpuset(1) support to rc.subr http://www.freebsd.org/cgi/query-pr.cgi?pr=142434 There is also patch for setfib: conf/132483: rc.subr(8) [patch] setfib(1) support for rc.subr http://www.freebsd.org/cgi/query-pr.cgi?pr=132483 patch for rtprio: conf/99444: [patch] Enhancement: rc.subr could easily support starting some daemons with realtime priorities http://www.freebsd.org/cgi/query-pr.cgi?pr=99444 conf/123222: [patch] Add rtprio(1)/idprio(1) support to rc.subr(8) http://www.freebsd.org/cgi/query-pr.cgi?pr=123222 Or more general way to use "any" wrapper for starting services conf/88913: [patch] wrapper support for rc.subr http://www.freebsd.org/cgi/query-pr.cgi?pr=88913 All these patches are very similar. I tested just my own patch for cpuset and found that there is some edge case where it is not working - rc.d/jail. It is becaues of the nature how rc.d/jail works - it starts jails by internal command in a loop instead of rc.subr things, so it will not use cpuset for jails, but nothing goes wrong. I did not tested something using _chroot as I did not found any rc script with it. What are the objections to not use / commit things like patches above? Do you think it is not the right way to have these features included in rc.subr and is better to write it in each rc script separately? Or is there any other problem with general use of setfib and cpuset? I think setfib and cpuset can be useful for all daemons and jails started by rc scripts. Especially cpuset on newer machines with more and more CPU cores and setfib for network daemons with profiles like Apache (currently Apache has its own implementation in rc script) Miroslav Lachman From owner-freebsd-rc@FreeBSD.ORG Fri Jan 8 17:25:55 2010 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 718511065670; Fri, 8 Jan 2010 17:25:55 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 2C43F8FC19; Fri, 8 Jan 2010 17:25:55 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.3/8.14.2) with ESMTP id o08GuSjW062968; Fri, 8 Jan 2010 11:56:28 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.3/8.14.2/Submit) id o08GuRmL062967; Fri, 8 Jan 2010 11:56:27 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Fri, 8 Jan 2010 11:56:27 -0500 From: David Schultz To: "M. Warner Losh" Message-ID: <20100108165627.GB62775@zim.MIT.EDU> Mail-Followup-To: "M. Warner Losh" , brooks@freebsd.org, ume@freebsd.org, dougb@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, freebsd-rc@freebsd.org References: <4B2DD2A1.8060907@FreeBSD.org> <20091220183519.GB64667@lor.one-eyed-alien.net> <20091221.210850.220301508585541755.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091221.210850.220301508585541755.imp@bsdimp.com> Cc: brooks@FreeBSD.ORG, freebsd-rc@FreeBSD.ORG, ume@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG, dougb@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Subject: Re: svn commit: r200743 - in head/usr.sbin: . service 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: Fri, 08 Jan 2010 17:25:55 -0000 On Mon, Dec 21, 2009, M. Warner Losh wrote: > In message: <20091220183519.GB64667@lor.one-eyed-alien.net> > Brooks Davis writes: > : This is where the value of service(8) would lie for me. The ability > : to not have things work by accident due to my environment and then break > : at reboot would be be very helful. > > I'd love to have some way to say 'If the daemon dies, please restart > it. But don't be so eager about it that your attempts to keep it > running interfere with things like service' The service management stuff introduced in Solaris 10 has this capability, as well as some other nice bits of sophistication. For instance, when a service is restarted, it will automatically restart any services whose operation depends on that service. Anyone working on services might want to peruse their svcs(1) and smf(5) for ideas. From owner-freebsd-rc@FreeBSD.ORG Sat Jan 9 21:23:10 2010 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 953841065670 for ; Sat, 9 Jan 2010 21:23:10 +0000 (UTC) (envelope-from pgollucci@p6m7g8.com) Received: from exhub015-1.exch015.msoutlookonline.net (exhub015-1.exch015.msoutlookonline.net [207.5.72.93]) by mx1.freebsd.org (Postfix) with ESMTP id 836C68FC17 for ; Sat, 9 Jan 2010 21:23:10 +0000 (UTC) Received: from philip.hq.rws (174.79.184.239) by smtpx15.msoutlookonline.net (207.5.72.103) with Microsoft SMTP Server (TLS) id 8.2.176.0; Sat, 9 Jan 2010 13:13:06 -0800 Message-ID: <4B48F161.4070602@p6m7g8.com> Date: Sat, 9 Jan 2010 21:13:05 +0000 From: "Philip M. Gollucci" Organization: P6M7G8 Inc. User-Agent: Thunderbird 2.0.0.23 (X11/20091208) MIME-Version: 1.0 To: rc@freebsd.org References: <4B47F1DB.8080800@p6m7g8.com> <4B4829B7.1060700@FreeBSD.org> In-Reply-To: <4B4829B7.1060700@FreeBSD.org> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: [patch] - zfs mount -a *MUST* run before /etc/fstab is processed 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: Sat, 09 Jan 2010 21:23:10 -0000 example - $ zpool create zroot .... $ zfs set mountpoint=legacy zroot [basically follow the wiki for GPTZFS boot] $ zfs create zroot/software $ zfs create -p zroot/jails/x $ zfs set mountpoint=/software zroot/software $ zfs set mountpoint=/jails zroot/jails $ mkdir -p /jails/x/software $ cat /etc/fstab /software /jails/x/software nullfs ro 0 0 reboot boom mountcritlocal bombs b/c neither path is available yet only the root (zroot) is mounted b/c zfs mount -a hasn't been run yet The below patch changes the /etc/rc.d rcorder so that happens in the correct order. I've tested it on 2 machines here successfully. http://people.freebsd.org/~pgollucci/FreeBSD/diffs/zfs.diff Sponsored by: RideCharge Inc. ------------------------------------------------------------------------ 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 VP Apache Infrastructure; Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. System Admin, Ridecharge Inc. >> Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching. >> > > -- ------------------------------------------------------------------------ 1024D/DB9B8C1C B90B FBC3 A3A1 C71A 8E70 3F8C 75B8 8FFB DB9B 8C1C Philip M. Gollucci (pgollucci@p6m7g8.com) c: 703.336.9354 VP Apache Infrastructure; Member, Apache Software Foundation Committer, FreeBSD Foundation Consultant, P6M7G8 Inc. Sr. System Admin, Ridecharge Inc. Work like you don't need the money, love like you'll never get hurt, and dance like nobody's watching.