From owner-freebsd-rc@FreeBSD.ORG Sun Jan 24 22:44:58 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 514D7106566C; Sun, 24 Jan 2010 22:44:58 +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 286148FC0A; Sun, 24 Jan 2010 22:44:58 +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 o0OMiwYj065764; Sun, 24 Jan 2010 22:44:58 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0OMiwmG065760; Sun, 24 Jan 2010 22:44:58 GMT (envelope-from linimon) Date: Sun, 24 Jan 2010 22:44:58 GMT Message-Id: <201001242244.o0OMiwmG065760@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/143084: [jail]: rc.d/jail creates stray softlinks 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, 24 Jan 2010 22:44:58 -0000 Old Synopsis: [patch] sysutils/ezjail: rc.d/jail creates stray softlinks New Synopsis: [jail]: rc.d/jail creates stray softlinks Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Sun Jan 24 22:44:20 UTC 2010 Responsible-Changed-Why: I misread the PR, this is an issue with the baseline code. Over to maintainers. http://www.freebsd.org/cgi/query-pr.cgi?pr=143084 From owner-freebsd-rc@FreeBSD.ORG Sun Jan 24 22:58:57 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 7A8A3106566B; Sun, 24 Jan 2010 22:58:57 +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 0533A8FC08; Sun, 24 Jan 2010 22:58:56 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 968AD19E023; Sun, 24 Jan 2010 23:58:55 +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 4698219E019; Sun, 24 Jan 2010 23:58:53 +0100 (CET) Message-ID: <4B5CD0AC.7090302@quip.cz> Date: Sun, 24 Jan 2010 23:58:52 +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.7) Gecko/20100104 SeaMonkey/2.0.2 MIME-Version: 1.0 To: freebsd-geom@freebsd.org Content-Type: multipart/mixed; boundary="------------090909040006080506080000" Cc: freebsd-rc@FreeBSD.org Subject: ordering problem with gjournal and iSCSI initiator 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, 24 Jan 2010 22:58:57 -0000 This is a multi-part message in MIME format. --------------090909040006080506080000 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Hi, I don't know what mailing list is better for this problem, so I post to both. I have server with local partition using gjournal (mfid0s2f.journal). It is mounted from fstab by this line: /dev/mfid0s2f.journal /vol0 ufs rw,async,nosuid,noexec,noatime 2 2 Then I have storage connected by iSCSI initiator by attached rc script. It should be mounted by this script according to fstab.iscsi line: /dev/da0p1.journal /vol1 ufs rw,async,nosuid,noexec,noatime 2 2 But there is a problem, both partitions are journaled and journal is on local disk. It means that only the first partition is checked and mounted at boot time. GEOM_JOURNAL: Journal 2395012627: mfid0s2d contains journal. GEOM_JOURNAL: Journal 1544711416: mfid0s2e contains journal. GEOM_JOURNAL: Journal 2395012627: mfid0s2f contains data. GEOM_JOURNAL: Journal mfid0s2f clean. GEOM_JOURNAL: BIO_FLUSH not supported by mfid0s2d. GEOM_JOURNAL: BIO_FLUSH not supported by mfid0s2f. Root mount waiting for: GJOURNAL Root mount waiting for: GJOURNAL Root mount waiting for: GJOURNAL Root mount waiting for: GJOURNAL Root mount waiting for: GJOURNAL GEOM_JOURNAL: Timeout. Journal gjournal 1544711416 cannot be completed. This is because second data provider is not available at this time. rc.d/iscsi is executed later. (after NETWORKING, SERVERS, before DAEMON) But da0p1.journal is not created later (after iscsi created /dev/da0) with this message: GEOM_JOURNAL: Journal 1544711416: da0p1 contains data. GEOM_JOURNAL: Timeout. Journal gjournal 1544711416 cannot be completed. And that's why /vol1 can't be mounted by rc.d/iscsi. My question is: Is there any "Right Way" to handle this case? How can I "create" da0p1.journal later and complete the gjournal + mount? The device da0p1.journal is only created if I manually do: unmount /vol0 gjournal stop mfid0s2f.journal kldunload geom_journal kldload geom_journal Then there are both entries created: /dev/mfid0s2f.journal /dev/da0p1.journal And both can be manualy mounted Miroslav Lachman --------------090909040006080506080000 Content-Type: text/plain; name="iscsi.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="iscsi.txt" #!/bin/sh # PROVIDE: iscsi # REQUIRE: NETWORKING # BEFORE: DAEMON # KEYWORD: nojail shutdown # # Add the following lines to /etc/rc.conf to enable iscsi: # # iscsi_enable="YES" # iscsi_fstab="/etc/fstab.iscsi" . /etc/rc.subr name=iscsi rcvar=`set_rcvar` command=/sbin/iscontrol iscsi_enable=${iscsi_enable:-"NO"} iscsi_fstab=${iscsi_fstab:-"/etc/fstab.iscsi"} iscsi_exports=${iscsi_exports:-"/etc/exports.iscsi"} iscsi_debug=${iscsi_debug:-0} start_cmd="iscsi_start" faststop_cmp="iscsi_stop" stop_cmd="iscsi_stop" iscsi_wait() { dev=$1 trap "echo 'wait loop cancelled'; exit 1" 2 count=0 while true; do if [ -c $dev ]; then break; fi if [ $count -eq 0 ]; then echo -n Waiting for ${dev}': ' fi count=$((${count} + 1)) if [ $count -eq 6 ]; then echo " Failed for dev=$dev" return 0 break fi echo -n '.' sleep 5; done echo "$dev ok." return 1 } iscsi_start() { # # load needed modules for m in iscsi_initiator geom_label; do kldstat -qm $m || kldload $m done sysctl debug.iscsi_initiator=$iscsi_debug # # start iscontrol for each target if [ -n "${iscsi_targets}" ]; then for target in ${iscsi_targets}; do ${command} ${rc_flags} -n ${target} done fi if [ -f "${iscsi_fstab}" ]; then while read spec file type opt t1 t2 do case ${spec} in \#*|'') ;; *) if iscsi_wait ${spec}; then break; fi echo type=$type spec=$spec file=$file fsck -p ${spec} && mkdir -p ${file} && mount ${spec} ${file} chmod 755 ${file} ;; esac done < ${iscsi_fstab} fi if [ -f "${iscsi_exports}" ]; then cat ${iscsi_exports} >> /etc/exports #/etc/rc.d/mountd reload kill -1 `cat /var/run/mountd.pid` fi } iscsi_stop() { echo 'iscsi stopping' while read spec file type opt t1 t2 do case ${spec} in \#*|'') ;; *) echo iscsi: umount $spec umount -fv $spec ;; esac done < ${iscsi_fstab} } load_rc_config $name run_rc_command "$1" --------------090909040006080506080000-- From owner-freebsd-rc@FreeBSD.ORG Mon Jan 25 11:07:08 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 E87471065672 for ; Mon, 25 Jan 2010 11:07:08 +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 D48E08FC15 for ; Mon, 25 Jan 2010 11:07:08 +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 o0PB78tZ038879 for ; Mon, 25 Jan 2010 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o0PB78xu038877 for freebsd-rc@FreeBSD.org; Mon, 25 Jan 2010 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 25 Jan 2010 11:07:08 GMT Message-Id: <201001251107.o0PB78xu038877@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, 25 Jan 2010 11:07:09 -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/143085 rc [patch] ftp-proxy(8) rc(8) with multiple instances o conf/143084 rc [jail] [patch]: fix rc.d/jail creating stray softlinks o conf/142973 rc [jail] [patch] Strange counter init value in jail rc o conf/142434 rc [patch] Add cpuset(1) support to rc.subr(8) o conf/142304 rc rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack e 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 72 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Jan 25 20:09:51 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 1E2591065672 for ; Mon, 25 Jan 2010 20:09:51 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail2.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id DC4948FC18 for ; Mon, 25 Jan 2010 20:09:50 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mail2.sandvine.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 25 Jan 2010 14:57:48 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 91E311170D; Mon, 25 Jan 2010 14:57:48 -0500 (EST) Date: Mon, 25 Jan 2010 14:57:48 -0500 From: Ed Maste To: freebsd-rc@freebsd.org Message-ID: <20100125195748.GA30798@sandvine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 25 Jan 2010 19:57:48.0344 (UTC) FILETIME=[AB370380:01CA9DF8] Subject: NetBSD compat shims 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: Mon, 25 Jan 2010 20:09:51 -0000 There's a vestigial bit of NetBSD compat shim in rc.subr that I'd like to clean up; any objections to the patch below? Index: etc/rc.subr =================================================================== --- etc/rc.subr (revision 202731) +++ etc/rc.subr (working copy) @@ -52,22 +52,12 @@ SYSCTL="/sbin/sysctl" SYSCTL_N="${SYSCTL} -n" -CMD_OSTYPE="${SYSCTL_N} kern.ostype" -OSTYPE=`${CMD_OSTYPE}` +SYSCTL_W="${SYSCTL}" ID="/usr/bin/id" IDCMD="if [ -x $ID ]; then $ID -un; fi" PS="/bin/ps -ww" JID=`$PS -p $$ -o jid=` -case ${OSTYPE} in -FreeBSD) - SYSCTL_W="${SYSCTL}" - ;; -NetBSD) - SYSCTL_W="${SYSCTL} -w" - ;; -esac - # # functions # --------- From owner-freebsd-rc@FreeBSD.ORG Mon Jan 25 20:44:21 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 972CC1065693 for ; Mon, 25 Jan 2010 20:44:21 +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 2BA358FC17 for ; Mon, 25 Jan 2010 20:44:20 +0000 (UTC) Received: (qmail 12784 invoked by uid 399); 25 Jan 2010 20:44:20 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 25 Jan 2010 20:44:20 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B5E02A3.4050708@FreeBSD.org> Date: Mon, 25 Jan 2010 12:44:19 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: Ed Maste References: <20100125195748.GA30798@sandvine.com> In-Reply-To: <20100125195748.GA30798@sandvine.com> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: NetBSD compat shims 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: Mon, 25 Jan 2010 20:44:21 -0000 No objection. It's been "on the list" for a long time, never got around to actually doing something about it. :) Doug On 1/25/2010 11:57 AM, Ed Maste wrote: > There's a vestigial bit of NetBSD compat shim in rc.subr that I'd > like to clean up; any objections to the patch below? > > Index: etc/rc.subr > =================================================================== > --- etc/rc.subr (revision 202731) > +++ etc/rc.subr (working copy) > @@ -52,22 +52,12 @@ > > SYSCTL="/sbin/sysctl" > SYSCTL_N="${SYSCTL} -n" > -CMD_OSTYPE="${SYSCTL_N} kern.ostype" > -OSTYPE=`${CMD_OSTYPE}` > +SYSCTL_W="${SYSCTL}" > ID="/usr/bin/id" > IDCMD="if [ -x $ID ]; then $ID -un; fi" > PS="/bin/ps -ww" > JID=`$PS -p $$ -o jid=` > > -case ${OSTYPE} in > -FreeBSD) > - SYSCTL_W="${SYSCTL}" > - ;; > -NetBSD) > - SYSCTL_W="${SYSCTL} -w" > - ;; > -esac > - > # > # functions > # --------- > _______________________________________________ > freebsd-rc@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-rc > To unsubscribe, send any mail to "freebsd-rc-unsubscribe@freebsd.org" > -- 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 Mon Jan 25 20:46:07 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 02454106568F for ; Mon, 25 Jan 2010 20:46:07 +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 A2D898FC16 for ; Mon, 25 Jan 2010 20:46:06 +0000 (UTC) Received: (qmail 15231 invoked by uid 399); 25 Jan 2010 20:46:05 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 25 Jan 2010 20:46:05 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B5E030D.8020506@FreeBSD.org> Date: Mon, 25 Jan 2010 12:46:05 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: Ed Maste References: <20100125195748.GA30798@sandvine.com> <4B5E02A3.4050708@FreeBSD.org> In-Reply-To: <4B5E02A3.4050708@FreeBSD.org> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: NetBSD compat shims 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: Mon, 25 Jan 2010 20:46:07 -0000 Oh, one caveat JIC, please grep through /etc and make sure the variables you're removing aren't used by something. Doug On 1/25/2010 12:44 PM, Doug Barton wrote: > No objection. It's been "on the list" for a long time, never got around > to actually doing something about it. :) > > > Doug > > > On 1/25/2010 11:57 AM, Ed Maste wrote: >> There's a vestigial bit of NetBSD compat shim in rc.subr that I'd >> like to clean up; any objections to the patch below? >> >> Index: etc/rc.subr >> =================================================================== >> --- etc/rc.subr (revision 202731) >> +++ etc/rc.subr (working copy) >> @@ -52,22 +52,12 @@ >> >> SYSCTL="/sbin/sysctl" >> SYSCTL_N="${SYSCTL} -n" >> -CMD_OSTYPE="${SYSCTL_N} kern.ostype" >> -OSTYPE=`${CMD_OSTYPE}` >> +SYSCTL_W="${SYSCTL}" >> ID="/usr/bin/id" >> IDCMD="if [ -x $ID ]; then $ID -un; fi" >> PS="/bin/ps -ww" >> JID=`$PS -p $$ -o jid=` >> >> -case ${OSTYPE} in >> -FreeBSD) >> - SYSCTL_W="${SYSCTL}" >> - ;; >> -NetBSD) >> - SYSCTL_W="${SYSCTL} -w" >> - ;; >> -esac >> - >> # >> # functions >> # --------- >> _______________________________________________ >> freebsd-rc@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-rc >> To unsubscribe, send any mail to "freebsd-rc-unsubscribe@freebsd.org" >> > > > -- 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 Mon Jan 25 20:55:26 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 90A5D106566B for ; Mon, 25 Jan 2010 20:55:26 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail2.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id 572DD8FC18 for ; Mon, 25 Jan 2010 20:55:26 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mail2.sandvine.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 25 Jan 2010 15:55:25 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 720F61170D; Mon, 25 Jan 2010 15:55:25 -0500 (EST) Date: Mon, 25 Jan 2010 15:55:25 -0500 From: Ed Maste To: Doug Barton Message-ID: <20100125205525.GA48654@sandvine.com> References: <20100125195748.GA30798@sandvine.com> <4B5E02A3.4050708@FreeBSD.org> <4B5E030D.8020506@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B5E030D.8020506@FreeBSD.org> User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 25 Jan 2010 20:55:25.0261 (UTC) FILETIME=[B7B2AFD0:01CA9E00] Cc: freebsd-rc@freebsd.org Subject: Re: NetBSD compat shims 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: Mon, 25 Jan 2010 20:55:26 -0000 On Mon, Jan 25, 2010 at 12:46:05PM -0800, Doug Barton wrote: > Oh, one caveat JIC, please grep through /etc and make sure the variables > you're removing aren't used by something. I found that OSTYPE wasn't used in etc/ beyond the case statement(s) in rc.subr itself, so removed it. Some rc.d scripts use SYSCTL_W so I left it alone (fixed to the FreeBSD case): > >> +SYSCTL_W="${SYSCTL}" -Ed From owner-freebsd-rc@FreeBSD.ORG Mon Jan 25 21:02: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 D550610656A7 for ; Mon, 25 Jan 2010 21:02: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 6578C8FC0C for ; Mon, 25 Jan 2010 21:02:09 +0000 (UTC) Received: (qmail 10495 invoked by uid 399); 25 Jan 2010 21:02:08 -0000 Received: from localhost (HELO ?192.168.0.110?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 25 Jan 2010 21:02:08 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B5E06CF.3060808@FreeBSD.org> Date: Mon, 25 Jan 2010 13:02:07 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: Ed Maste References: <20100125195748.GA30798@sandvine.com> <4B5E02A3.4050708@FreeBSD.org> <4B5E030D.8020506@FreeBSD.org> <20100125205525.GA48654@sandvine.com> In-Reply-To: <20100125205525.GA48654@sandvine.com> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: NetBSD compat shims 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: Mon, 25 Jan 2010 21:02:09 -0000 On 1/25/2010 12:55 PM, Ed Maste wrote: > On Mon, Jan 25, 2010 at 12:46:05PM -0800, Doug Barton wrote: > >> Oh, one caveat JIC, please grep through /etc and make sure the variables >> you're removing aren't used by something. > > I found that OSTYPE wasn't used in etc/ beyond the case statement(s) in > rc.subr itself, so removed it. > > Some rc.d scripts use SYSCTL_W so I left it alone (fixed to the FreeBSD > case): > >>>> +SYSCTL_W="${SYSCTL}" Sounds/looks good, thanks. :) 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 Tue Jan 26 00:15:14 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 C8DF41065672 for ; Tue, 26 Jan 2010 00:15:14 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-px0-f183.google.com (mail-px0-f183.google.com [209.85.216.183]) by mx1.freebsd.org (Postfix) with ESMTP id A05BB8FC1C for ; Tue, 26 Jan 2010 00:15:14 +0000 (UTC) Received: by pxi13 with SMTP id 13so2827649pxi.3 for ; Mon, 25 Jan 2010 16:15:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=dwqhdjFl0cUZOEzSkcJLI2OX8ZgX+A/5Om0Zq/pO/vg=; b=ZkySNwCDiKdFB9QzSsPVoYLrcgZ2QCLU0510J6G+iw/3nyI4hbTgj1tNCQRytu9ZrS 57zrRRsIxt8HmI83LUcqwSqiCqfvHELyyOurmO+szdKVMyfWnvUKGdr8OZlJrloJjtTH OfwQgbtaMqmoAQ1yKr7wsPHfTuj9CuYdACRJE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=P5DjvmOp75QrtCp0w7HlSBarhY2nP5r0Xzpav4Wdk0OOcj/5uklO7tOZLJVhoGzVYf 0Z5yAT2qKbBRmFv+/xZla7x2bybjx5IvvFJzL/xosWpKRIOInrEDnDBLg108GCMI/wLz +JY2dNhJNrJlqv4aZNsP5KQY017+XsnoXijRI= MIME-Version: 1.0 Received: by 10.114.214.21 with SMTP id m21mr4948323wag.213.1264463461687; Mon, 25 Jan 2010 15:51:01 -0800 (PST) Date: Mon, 25 Jan 2010 15:51:01 -0800 Message-ID: From: Maksim Yevmenkin To: freebsd-rc@freebsd.org Content-Type: multipart/mixed; boundary=0016e64aee9c7724b8047e05d7b9 Subject: small addition to /etc/rc.d/ipfw 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, 26 Jan 2010 00:15:14 -0000 --0016e64aee9c7724b8047e05d7b9 Content-Type: text/plain; charset=ISO-8859-1 hello, would anyone object to the attached path to /etc/rc.d/ipfw? the idea is to introduce new "firewall_coscripts" variable that contains the list of rc scripts that would be started/stopped via post start and post stop hooks. unless i'm missing something it also should be possible to just get rid of call to /etc/rc.d/natd directly and simply stuff /etc/rc.d/natd into "firewall_coscripts" by default (via defaults/rc.conf). the latter, however, is not implemented in the patch. thanks, max --0016e64aee9c7724b8047e05d7b9 Content-Type: text/plain; charset=US-ASCII; name="ipfw.diff.txt" Content-Disposition: attachment; filename="ipfw.diff.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g4vwr9mg0 SW5kZXg6IGlwZncKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PQotLS0gaXBmdwkocmV2aXNpb24gMjAyOTg4KQorKysgaXBm dwkod29ya2luZyBjb3B5KQpAQCAtMTQsNyArMTQsOSBAQAogcmN2YXI9ImZpcmV3YWxsX2VuYWJs ZSIKIHN0YXJ0X2NtZD0iaXBmd19zdGFydCIKIHN0YXJ0X3ByZWNtZD0iaXBmd19wcmVzdGFydCIK K3N0YXJ0X3Bvc3RjbWQ9ImlwZndfcG9zdHN0YXJ0Igogc3RvcF9jbWQ9ImlwZndfc3RvcCIKK3N0 b3BfcG9zdGNtZD0iaXBmd19wb3N0c3RvcCIKIHJlcXVpcmVkX21vZHVsZXM9ImlwZnciCiAKIHNl dF9yY3Zhcl9vYnNvbGV0ZSBpcHY2X2ZpcmV3YWxsX2VuYWJsZQpAQCAtNzMsNiArNzUsMTkgQEAK IAlmaQogfQogCitpcGZ3X3Bvc3RzdGFydCgpCit7CisJbG9jYWwJX2Nvc2NyaXB0CisKKwlpZiBb IC1uICIke2ZpcmV3YWxsX2Nvc2NyaXB0c30iIF07IHRoZW4KKwkJZm9yIF9jb3NjcmlwdCBpbiAk e2ZpcmV3YWxsX2Nvc2NyaXB0c30gOyBkbworCQkJaWYgWyAtZiAiJHtfY29zY3JpcHR9IiBdOyB0 aGVuCisJCQkJJHtfY29zY3JpcHR9IHF1aWV0c3RhcnQKKwkJCWZpCisJCWRvbmUKKwlmaQorfQor CiBpcGZ3X3N0b3AoKQogewogCSMgRGlzYWJsZSB0aGUgZmlyZXdhbGwKQEAgLTg2LDUgKzEwMSwx OCBAQAogCWZpCiB9CiAKK2lwZndfcG9zdHN0b3AoKQoreworCWxvY2FsCV9jb3NjcmlwdAorCisJ aWYgWyAtbiAiJHtmaXJld2FsbF9jb3NjcmlwdHN9IiBdOyB0aGVuCisJCWZvciBfY29zY3JpcHQg aW4gYHJldmVyc2VfbGlzdCAke2ZpcmV3YWxsX2Nvc2NyaXB0c31gIDsgZG8KKwkJCWlmIFsgLWYg IiR7X2Nvc2NyaXB0fSIgXTsgdGhlbgorCQkJCSR7X2Nvc2NyaXB0fSBxdWlldHN0b3AKKwkJCWZp CisJCWRvbmUKKwlmaQorfQorCiBsb2FkX3JjX2NvbmZpZyAkbmFtZQogcnVuX3JjX2NvbW1hbmQg JCoK --0016e64aee9c7724b8047e05d7b9-- From owner-freebsd-rc@FreeBSD.ORG Wed Jan 27 22:26:42 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 58056106566B for ; Wed, 27 Jan 2010 22:26:42 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9948FC1B for ; Wed, 27 Jan 2010 22:26:42 +0000 (UTC) Received: by pwi15 with SMTP id 15so37964pwi.3 for ; Wed, 27 Jan 2010 14:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=FAqNCBDlFdJeDczY5fQu06pY3K5peCWuKju/nBRsaS4=; b=jNzdHklnZGQNLhC33p48xZOuJLoMbTGKsfYuk23TTwbaacUfb7pJi8lX6e5yuQsN7g Uk5Q2a1hHKsezUUY3vqm9soefGA0WuP8b5Hz2QZw33SB84Dc93XOSh+vgvAj4GkUtvfu XXSkp6BJ4hQkMmhRXg0JUG+Wu+iWgyHhn3YoM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=EFzL3BKksEtln5y05vnRLI5hHsCRRQPYGHWavY8VVwTGQIxa79CP6gHEPyd00m8LNC wlxKwRv45FIs0lzq0nfWeoGkjBcTRwlZMFrR/gVwApQKsVSV4CRLcsqEZm+j6BS7ipcZ G40vP8FuFeQPilLvMD356ZstV98AItVyz0LnM= MIME-Version: 1.0 Received: by 10.114.249.38 with SMTP id w38mr3206686wah.111.1264631201787; Wed, 27 Jan 2010 14:26:41 -0800 (PST) In-Reply-To: References: Date: Wed, 27 Jan 2010 14:26:41 -0800 Message-ID: From: Maksim Yevmenkin To: freebsd-rc@freebsd.org Content-Type: multipart/mixed; boundary=0016e64ca34a8df209047e2ce512 Subject: Re: small addition to /etc/rc.d/ipfw 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, 27 Jan 2010 22:26:42 -0000 --0016e64ca34a8df209047e2ce512 Content-Type: text/plain; charset=ISO-8859-1 hello, > would anyone object to the attached path to /etc/rc.d/ipfw? > > the idea is to introduce new "firewall_coscripts" variable that > contains the list of rc scripts that would be started/stopped via post > start and post stop hooks. unless i'm missing something it also should > be possible to just get rid of call to /etc/rc.d/natd directly and > simply stuff /etc/rc.d/natd into "firewall_coscripts" by default (via > defaults/rc.conf). the latter, however, is not implemented in the > patch. 2nd try :) a bit improved version. thanks, max --0016e64ca34a8df209047e2ce512 Content-Type: text/plain; charset=US-ASCII; name="ipfw.diff.txt" Content-Disposition: attachment; filename="ipfw.diff.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_g4yore9d1 SW5kZXg6IHJjLmQvaXBmdwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSByYy5kL2lwZncJKHJldmlzaW9uIDIwMzEw MCkKKysrIHJjLmQvaXBmdwkod29ya2luZyBjb3B5KQpAQCAtMTQsNiArMTQsNyBAQAogcmN2YXI9 ImZpcmV3YWxsX2VuYWJsZSIKIHN0YXJ0X2NtZD0iaXBmd19zdGFydCIKIHN0YXJ0X3ByZWNtZD0i aXBmd19wcmVzdGFydCIKK3N0YXJ0X3Bvc3RjbWQ9ImlwZndfcG9zdHN0YXJ0Igogc3RvcF9jbWQ9 ImlwZndfc3RvcCIKIHJlcXVpcmVkX21vZHVsZXM9ImlwZnciCiAKQEAgLTQyLDkgKzQzLDYgQEAK IAlbIC16ICIke2ZpcmV3YWxsX3NjcmlwdH0iIF0gJiYgZmlyZXdhbGxfc2NyaXB0PS9ldGMvcmMu ZmlyZXdhbGwKIAogCWlmIFsgLXIgIiR7ZmlyZXdhbGxfc2NyaXB0fSIgXTsgdGhlbgotCQlpZiBb IC1mIC9ldGMvcmMuZC9uYXRkIF0gOyB0aGVuCi0JCQkvZXRjL3JjLmQvbmF0ZCBxdWlldHN0YXJ0 Ci0JCWZpCiAJCS9iaW4vc2ggIiR7ZmlyZXdhbGxfc2NyaXB0fSIgIiR7X2ZpcmV3YWxsX3R5cGV9 IgogCQllY2hvICdGaXJld2FsbCBydWxlcyBsb2FkZWQuJwogCWVsaWYgWyAiYGlwZncgbGlzdCA2 NTUzNWAiID0gIjY1NTM1IGRlbnkgaXAgZnJvbSBhbnkgdG8gYW55IiBdOyB0aGVuCkBAIC01OSw3 ICs1NywyMCBAQAogCQllY2hvICdGaXJld2FsbCBsb2dnaW5nIGVuYWJsZWQuJwogCQlzeXNjdGwg bmV0LmluZXQuaXAuZncudmVyYm9zZT0xID4vZGV2L251bGwKIAlmaQorfQogCitpcGZ3X3Bvc3Rz dGFydCgpCit7CisJbG9jYWwJX2Nvc2NyaXB0CisKKwkjIFN0YXJ0IGZpcmV3YWxsIGNvc2NyaXB0 cworCSMKKwlmb3IgX2Nvc2NyaXB0IGluICR7ZmlyZXdhbGxfY29zY3JpcHRzfSA7IGRvCisJCWlm IFsgLWYgIiR7X2Nvc2NyaXB0fSIgXTsgdGhlbgorCQkJJHtfY29zY3JpcHR9IHF1aWV0c3RhcnQK KwkJZmkKKwlkb25lCisKIAkjIEVuYWJsZSB0aGUgZmlyZXdhbGwKIAkjCiAJaWYgISAke1NZU0NU TF9XfSBuZXQuaW5ldC5pcC5mdy5lbmFibGU9MSAxPi9kZXYvbnVsbCAyPiYxOyB0aGVuCkBAIC03 NSwxNiArODYsMjUgQEAKIAogaXBmd19zdG9wKCkKIHsKKwlsb2NhbAlfY29zY3JpcHQKKwogCSMg RGlzYWJsZSB0aGUgZmlyZXdhbGwKIAkjCiAJJHtTWVNDVExfV30gbmV0LmluZXQuaXAuZncuZW5h YmxlPTAKIAlpZiBhZmV4aXN0cyBpbmV0NjsgdGhlbgogCQkke1NZU0NUTF9XfSBuZXQuaW5ldDYu aXA2LmZ3LmVuYWJsZT0wCiAJZmkKLQlpZiBbIC1mIC9ldGMvcmMuZC9uYXRkIF0gOyB0aGVuCi0J CS9ldGMvcmMuZC9uYXRkIHF1aWV0c3RvcAotCWZpCisKKwkjIFN0b3AgZmlyZXdhbGwgY29zY3Jp cHRzCisJIworCWZvciBfY29zY3JpcHQgaW4gYHJldmVyc2VfbGlzdCAke2ZpcmV3YWxsX2Nvc2Ny aXB0c31gIDsgZG8KKwkJaWYgWyAtZiAiJHtfY29zY3JpcHR9IiBdOyB0aGVuCisJCQkke19jb3Nj cmlwdH0gcXVpZXRzdG9wCisJCWZpCisJZG9uZQogfQogCiBsb2FkX3JjX2NvbmZpZyAkbmFtZQor ZmlyZXdhbGxfY29zY3JpcHRzPSIvZXRjL3JjLmQvbmF0ZCAke2ZpcmV3YWxsX2Nvc2NyaXB0c30i CisKIHJ1bl9yY19jb21tYW5kICQqCkluZGV4OiBkZWZhdWx0cy9yYy5jb25mCj09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0K LS0tIGRlZmF1bHRzL3JjLmNvbmYJKHJldmlzaW9uIDIwMzEwMCkKKysrIGRlZmF1bHRzL3JjLmNv bmYJKHdvcmtpbmcgY29weSkKQEAgLTExOCw2ICsxMTgsOCBAQAogZmlyZXdhbGxfcXVpZXQ9Ik5P IgkJIyBTZXQgdG8gWUVTIHRvIHN1cHByZXNzIHJ1bGUgZGlzcGxheQogZmlyZXdhbGxfbG9nZ2lu Zz0iTk8iCQkjIFNldCB0byBZRVMgdG8gZW5hYmxlIGV2ZW50cyBsb2dnaW5nCiBmaXJld2FsbF9m bGFncz0iIgkJIyBGbGFncyBwYXNzZWQgdG8gaXBmdyB3aGVuIHR5cGUgaXMgYSBmaWxlCitmaXJl d2FsbF9jb3NjcmlwdHM9IiIJCSMgTGlzdCBvZiBleGVjdXRhYmxlcy9zY3JpcHRzIHRvIHJ1biBh ZnRlcgorCQkJCSMgZmlyZXdhbGwgc3RhcnRzL3N0b3BzCiBmaXJld2FsbF9jbGllbnRfbmV0PSIx OTIuMC4yLjAvMjQiICMgSVB2NCBOZXR3b3JrIGFkZHJlc3MgZm9yICJjbGllbnQiCiAJCQkJIyBm aXJld2FsbC4KICNmaXJld2FsbF9jbGllbnRfbmV0X2lwdjY9IjIwMDE6ZGI4OjI6MTo6LzY0IiAj IElQdjYgbmV0d29yayBwcmVmaXggZm9yCg== --0016e64ca34a8df209047e2ce512-- From owner-freebsd-rc@FreeBSD.ORG Thu Jan 28 23:24:19 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 6AD92106566B for ; Thu, 28 Jan 2010 23:24:19 +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 960588FC1F for ; Thu, 28 Jan 2010 23:24:18 +0000 (UTC) Received: from elsa.codelab.cz (localhost.codelab.cz [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 240EA19E048; Fri, 29 Jan 2010 00:24:17 +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 4CA0B19E047; Fri, 29 Jan 2010 00:24:14 +0100 (CET) Message-ID: <4B621C9D.8050101@quip.cz> Date: Fri, 29 Jan 2010 00:24:13 +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.7) Gecko/20100104 SeaMonkey/2.0.2 MIME-Version: 1.0 To: freebsd-rc@freebsd.org, Daniel Braniss Content-Type: multipart/mixed; boundary="------------030905040909050409020100" Cc: Subject: rc script for iSCSI initiator 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, 28 Jan 2010 23:24:19 -0000 This is a multi-part message in MIME format. --------------030905040909050409020100 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Hi, iSCSI initiator is in the base for a long time, but there is not rc.d/iscsi script to start iSCSI sessions. I found one old in mailing list and take it as base for my work. I attached two versions. *rc.d_iscsi.all.txt* manage all defined targets at start / stop command *rc.d_iscsi.individual.txt* can selectively start / stop individual sessions (targets defined in /etc/iscsi.conf and in rc.conf iscsi_targets="") It is not intended to direct commit, it is just work in progress and needs some discussion and improvements from rc folks. Scripts are too verbose for better debugging. Both of them can be called as: /etc/rc.d/iscsi start|stop The "individual" version can be called: /etc/rc.d/iscsi start|stop [target_name] For example: # /etc/rc.d/iscsi start styx_storage_1 debug.iscsi_initiator: 2 -> 0 Starting iSCSI session for styx_storage_1 Waiting for /dev/ufs/styx0p1: . OK /dev/ufs/styx0p1: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ufs/styx0p1: clean, 856565848 free (896 frags, 107070619 blocks, 0.0% fragmentation) /dev/ufs/styx0p1 on /vol1 (ufs, local, soft-updates, fsid 2d3d5e4b8b67f290) # /etc/rc.d/iscsi stop styx_storage_1 Unmounting iSCSI volumes for styx_storage_1 /dev/ufs/styx0p1: unmount from /vol1 Stopping iSCSI session for: styx_storage_1 .....All iSCSI sessions were stopped My main problem with this script is how to get a PID of started iscontrol and as I didn't found a "right way" to do it, the script contains some ugly hack with writing temporary file. This must be fixed by somebody more skilled than me. I am open to any comments, sugesstions, warnings etc. Miroslav Lachman --------------030905040909050409020100 Content-Type: text/plain; name="rc.d_iscsi.individual.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rc.d_iscsi.individual.txt" #!/bin/sh # PROVIDE: iscsi # REQUIRE: NETWORKING # BEFORE: DAEMON # KEYWORD: nojail shutdown # # This script supports starting and stopping individual sessions # from the iscsi_targets list: # rc.d/iscsi start my_first_target # rc.d/iscsi stop another_target # # Targets must be defined in /etc/iscsi.conf # Each target has its own fstab file named as $iscsi_fstab.target_name # # Add the following lines to /etc/rc.conf to enable iscsi: # # iscsi_enable="YES" # iscsi_targets="" # list of targets defined in /etc/iscsi.conf # iscsi_fstab="/etc/fstab.iscsi" # prefix for per target fstabs # iscsi_debug="" # 0,1,2 # iscsi_exports="" # iscsi_zfs="" # . /etc/rc.subr name=iscsi rcvar=`set_rcvar` command=/sbin/iscontrol iscsi_enable=${iscsi_enable:-"NO"} iscsi_fstab=${iscsi_fstab:-"/etc/fstab.iscsi"} iscsi_exports=${iscsi_exports:-"/etc/exports.iscsi"} iscsi_debug=${iscsi_debug:-0} start_cmd="iscsi_start" faststop_cmp="iscsi_stop" stop_cmd="iscsi_stop" stop_postcmd="iscsi_poststop" required_modules="iscsi_initiator:iscsi" iscsi_wait() { dev=$1 trap "echo 'Wait loop cancelled'; exit 1" 2 count=0 while true; do if [ -c $dev ]; then break; fi if [ $count -eq 0 ]; then echo -n "Waiting for ${dev}: " fi count=$((${count} + 1)) if [ $count -eq 6 ]; then echo ' FAILED' return 0 break fi echo -n '.' sleep 5; done echo ' OK' return 1 } iscsi_start() { sysctl debug.iscsi_initiator=$iscsi_debug # # start iscontrol for each target if [ -n "${iscsi_targets}" ]; then _tmp_dir=`mktemp -d /tmp/iscsi.XXXXXXXX` || \ err 3 "$name: Can't create temp dir, exiting..." for target in ${iscsi_targets}; do _pid_file="/var/run/iscontrol_${target}.pid" if [ -f "${_pid_file}" ]; then pgrep -F "${_pid_file}" iscontrol > /dev/null _return=$? if [ $_return -eq 0 ]; then echo "Session for ${target} is already running" continue fi echo "Removing stale pidfile ${_pid_file}" rm "${_pid_file}" fi echo "Starting iSCSI session for ${target}" _tmp_iscsi=${_tmp_dir}/iscontrol.${target} ${command} ${rc_flags} -n ${target} > ${_tmp_iscsi} 2>&1 # I do not know the better way to get iscontrol PID head -1 "${_tmp_iscsi}" | sed -E 's/.*\[([0-9]*)\].*/\1/' > "${_pid_file}" # rm -f "$_tmp_iscsi" ## file specified as _tmp_iscsi remains open until iscontrol is closed ## lsof +aL1 /tmp # lists unlinked files, still opened done # rmdir "${_tmp_dir}" else # no targets, no devices, no mounts, just exit warn 'You must specify iscsi_targets list' return 1 fi # We have separate fstab file for each target (/etc/fstab.iscsi.target_name) for target in ${iscsi_targets}; do target_fstab="${iscsi_fstab}.${target}" if [ -f "${target_fstab}" ]; then while read spec file type opt t1 t2 do case ${spec} in \#*|'') ;; *) if iscsi_wait ${spec}; then break; fi # Check if not already mounted and run fsck mount | grep "^${spec} " if [ $? -ne 0 ]; then #echo "type=${type} spec=${spec} file=${file} opt=${opt}" fsck -p -t ${type} ${spec} else debug "${spec} is already mounted, skipping fsck" fi ;; esac done < "${target_fstab}" # Mount all filesystems from given fstab file mount -a -v -F "${target_fstab}" fi done if [ -f "${iscsi_exports}" ]; then # ??? same content will be appended on each start! # it should be checked with diff / uniq cat ${iscsi_exports} >> /etc/exports #/etc/rc.d/mountd reload kill -1 `cat /var/run/mountd.pid` fi if checkyesno zfs_enable; then if checkyesno iscsi_zfs; then sleep 4 zpool import -d /dev/label -a # presumably we can ignore zfs mount -a share -a and swapon # some zfs dataset may be exported "legacy", so hup mountd kill -1 `cat /var/run/mountd.pid` fi fi } iscsi_stop() { for target in ${iscsi_targets}; do target_fstab="${iscsi_fstab}.${target}" if [ -f "${target_fstab}" ]; then echo "Unmounting iSCSI volumes for ${target}" umount -a -fv -F "${target_fstab}" fi done echo -n 'Stopping iSCSI session for:' _poststop=0 # Stop iscontrol for each target if [ -n "${iscsi_targets}" ]; then if [ `sysctl -n net.iscsi.sessions` -gt 0 ]; then # We will run iscsi_poststop loop _poststop=1 fi for target in ${iscsi_targets}; do echo -n " ${target}" _iscsi_pid_file="/var/run/iscontrol_${target}.pid" if [ -f "${_iscsi_pid_file}" ]; then _pid=$(head -1 "${_iscsi_pid_file}") # Safety check if PID from file is PID of iscontrol _grep_pid="$(pgrep -F "${_iscsi_pid_file}" iscontrol)" if [ "${_pid}" = "${_grep_pid}" ]; then kill -HUP ${_pid} && rm "${_iscsi_pid_file}" _pids="${_pids} $_pid" fi else echo -e "\n Cannot stop session ${target}. No PID in /var/run" fi done fi echo '' } iscsi_poststop() { _dying=0 while [ $_poststop -gt 0 -a -n "${_pids}" ]; do if [ -n "$(ps -o pid= -o command= -p ${_pids})" ]; then sleep 2 echo -n '.' _dying=$(($_dying + 1)) if [ $_dying -gt 10 ]; then echo 'Some session does not want stop, giving up' return 1 break fi else echo 'All iSCSI sessions were stopped' return 0 break fi done } load_rc_config $name cmd="$1" if [ $# -gt 0 ]; then shift fi if [ -n "$*" ]; then iscsi_targets="$*" fi run_rc_command "${cmd}" --------------030905040909050409020100 Content-Type: text/plain; name="rc.d_iscsi.all.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rc.d_iscsi.all.txt" #!/bin/sh # PROVIDE: iscsi # REQUIRE: NETWORKING # BEFORE: DAEMON # KEYWORD: nojail shutdown # # Add the following lines to /etc/rc.conf to enable iscsi: # # iscsi_enable="YES" # iscsi_targets="" # list of targets defined in /etc/iscsi.conf # iscsi_fstab="/etc/fstab.iscsi" # iscsi_debug="" # 0,1,2 # iscsi_exports="" # iscsi_zfs="" # . /etc/rc.subr name=iscsi rcvar=`set_rcvar` command=/sbin/iscontrol iscsi_enable=${iscsi_enable:-"NO"} iscsi_fstab=${iscsi_fstab:-"/etc/fstab.iscsi"} iscsi_exports=${iscsi_exports:-"/etc/exports.iscsi"} iscsi_debug=${iscsi_debug:-0} start_cmd="iscsi_start" faststop_cmp="iscsi_stop" stop_cmd="iscsi_stop" stop_postcmd="iscsi_poststop" required_modules="iscsi_initiator:iscsi" iscsi_wait() { dev=$1 trap "echo 'Wait loop cancelled'; exit 1" 2 count=0 while true; do if [ -c $dev ]; then break; fi if [ $count -eq 0 ]; then echo -n "Waiting for ${dev}: " fi count=$((${count} + 1)) if [ $count -eq 6 ]; then echo ' FAILED' return 0 break fi echo -n '.' sleep 5; done echo ' OK' return 1 } iscsi_start() { sysctl debug.iscsi_initiator=$iscsi_debug # # start iscontrol for each target if [ -n "${iscsi_targets}" ]; then _tmp_dir=`mktemp -d /tmp/iscsi.XXXXXXXX` || \ err 3 "$name: Can't create temp dir, exiting..." for target in ${iscsi_targets}; do _pid_file="/var/run/iscontrol_${target}.pid" if [ -f "${_pid_file}" ]; then pgrep -F "${_pid_file}" iscontrol > /dev/null _return=$? if [ $_return -eq 0 ]; then echo "Session for ${target} is already running" continue fi echo "Removing stale pidfile ${_pid_file}" rm "${_pid_file}" fi echo "Starting iSCSI session for ${target}" _tmp_iscsi=${_tmp_dir}/iscontrol.${target} ${command} ${rc_flags} -n ${target} > ${_tmp_iscsi} 2>&1 # I do not know the better way to get iscontrol PID head -1 "${_tmp_iscsi}" | sed -E 's/.*\[([0-9]*)\].*/\1/' > "${_pid_file}" # rm -f "$_tmp_iscsi" ## file specified as _tmp_iscsi remains open until iscontrol is closed ## lsof +aL1 /tmp # lists unlinked files, still opened done # rmdir "${_tmp_dir}" else # no targets, no devices, no mounts, just exit warn 'You must specify iscsi_targets list' return 1 fi if [ -f "${iscsi_fstab}" ]; then while read spec file type opt t1 t2 do case ${spec} in \#*|'') ;; *) if iscsi_wait ${spec}; then break; fi # Check if not already mounted and run fsck mount | grep "^${spec} " if [ $? -ne 0 ]; then #echo "type=${type} spec=${spec} file=${file} opt=${opt}" fsck -p -t ${type} ${spec} else debug "${spec} is already mounted, skipping fsck" fi ;; esac done < ${iscsi_fstab} # Mount all filesystems from given fstab file mount -a -v -F "${iscsi_fstab}" fi if [ -f "${iscsi_exports}" ]; then # ??? same content will be appended on each start! # it should be checked with diff / uniq cat ${iscsi_exports} >> /etc/exports #/etc/rc.d/mountd reload kill -1 `cat /var/run/mountd.pid` fi if checkyesno zfs_enable; then if checkyesno iscsi_zfs; then sleep 4 zpool import -d /dev/label -a # presumably we can ignore zfs mount -a share -a and swapon # some zfs dataset may be exported "legacy", so hup mountd kill -1 `cat /var/run/mountd.pid` fi fi } iscsi_stop() { if [ -f "${iscsi_fstab}" ]; then echo 'Unmounting all iSCSI volumes:' umount -a -fv -F ${iscsi_fstab} fi echo -n 'Stopping iSCSI session for:' _poststop=0 # Stop iscontrol for each target if [ -n "${iscsi_targets}" ]; then if [ `sysctl -n net.iscsi.sessions` -gt 0 ]; then # We will run iscsi_poststop loop _poststop=1 fi for target in ${iscsi_targets}; do echo -n " ${target}" _iscsi_pid_file="/var/run/iscontrol_${target}.pid" if [ -f "${_iscsi_pid_file}" ]; then _pid=$(head -1 "${_iscsi_pid_file}") # Safety check if PID from file is PID of iscontrol _grep_pid="$(pgrep -F "${_iscsi_pid_file}" iscontrol)" if [ "${_pid}" = "${_grep_pid}" ]; then kill -HUP ${_pid} && rm "${_iscsi_pid_file}" _pids="${_pids} $_pid" fi else echo -e "\n Cannot stop session ${target}. No PID in /var/run" fi done fi echo '' } iscsi_poststop() { _dying=0 while [ $_poststop -gt 0 -a -n "${_pids}" ]; do if [ -n "$(ps -o pid= -o command= -p ${_pids})" ]; then sleep 2 echo -n '.' _dying=$(($_dying + 1)) if [ $_dying -gt 10 ]; then echo 'Some session does not want stop, giving up' return 1 break fi else echo 'All iSCSI sessions were stopped' return 0 break fi done } load_rc_config $name run_rc_command "$1" --------------030905040909050409020100-- From owner-freebsd-rc@FreeBSD.ORG Sat Jan 30 11:08:03 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 E2446106568B for ; Sat, 30 Jan 2010 11:08:03 +0000 (UTC) (envelope-from nvass9573@gmx.com) Received: from mailout-eu.gmx.com (mailout-eu.gmx.com [213.165.64.42]) by mx1.freebsd.org (Postfix) with SMTP id 4D4408FC1F for ; Sat, 30 Jan 2010 11:08:03 +0000 (UTC) Received: (qmail invoked by alias); 30 Jan 2010 11:08:01 -0000 Received: from unknown (EHLO [192.168.73.195]) [79.107.188.140] by mail.gmx.com (mp-eu002) with SMTP; 30 Jan 2010 12:08:01 +0100 X-Authenticated: #46156728 X-Provags-ID: V01U2FsdGVkX18Tihh55B4TQpJh1LjbvTKeN5cyvSmCRpPnVuBLpq ItlU6ITFD6O1+l Message-ID: <4B641302.7040301@gmx.com> Date: Sat, 30 Jan 2010 13:07:46 +0200 From: Nikos Vassiliadis User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: Miroslav Lachman <000.fbsd@quip.cz> References: <4B5CD0AC.7090302@quip.cz> In-Reply-To: <4B5CD0AC.7090302@quip.cz> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.53000000000000003 Cc: freebsd-rc@FreeBSD.org, freebsd-geom@freebsd.org Subject: Re: ordering problem with gjournal and iSCSI initiator 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, 30 Jan 2010 11:08:04 -0000 On 1/25/2010 12:58 AM, Miroslav Lachman wrote: > Hi, > > I don't know what mailing list is better for this problem, so I post to > both. > > I have server with local partition using gjournal (mfid0s2f.journal). > It is mounted from fstab by this line: > > /dev/mfid0s2f.journal /vol0 ufs rw,async,nosuid,noexec,noatime 2 2 > > Then I have storage connected by iSCSI initiator by attached rc script. > It should be mounted by this script according to fstab.iscsi line: > > /dev/da0p1.journal /vol1 ufs rw,async,nosuid,noexec,noatime 2 2 > > But there is a problem, both partitions are journaled and journal is on > local disk. > > It means that only the first partition is checked and mounted at boot time. > > GEOM_JOURNAL: Journal 2395012627: mfid0s2d contains journal. > GEOM_JOURNAL: Journal 1544711416: mfid0s2e contains journal. > GEOM_JOURNAL: Journal 2395012627: mfid0s2f contains data. > GEOM_JOURNAL: Journal mfid0s2f clean. > GEOM_JOURNAL: BIO_FLUSH not supported by mfid0s2d. > GEOM_JOURNAL: BIO_FLUSH not supported by mfid0s2f. > Root mount waiting for: GJOURNAL > Root mount waiting for: GJOURNAL > Root mount waiting for: GJOURNAL > Root mount waiting for: GJOURNAL > Root mount waiting for: GJOURNAL > GEOM_JOURNAL: Timeout. Journal gjournal 1544711416 cannot be completed. > > This is because second data provider is not available at this time. > rc.d/iscsi is executed later. (after NETWORKING, SERVERS, before DAEMON) > > But da0p1.journal is not created later (after iscsi created /dev/da0) > with this message: > GEOM_JOURNAL: Journal 1544711416: da0p1 contains data. > GEOM_JOURNAL: Timeout. Journal gjournal 1544711416 cannot be completed. > > And that's why /vol1 can't be mounted by rc.d/iscsi. > > My question is: Is there any "Right Way" to handle this case? > > How can I "create" da0p1.journal later and complete the gjournal + mount? gjournal should have both data and journal providers available to create the .journal consumer. You can force a geom taste, so gjournal will check again the devices, if you open the device for writing. A trick suggested by pjd@ is doing a simple: true > /dev/$data_device true > /dev/$journal_device This will create the .journal and you'll be able to mount the filesystem living on it. So, modify the rc script accordingly to do the operation automatically. HTH, Nikos