From owner-freebsd-rc@FreeBSD.ORG Sun Sep 30 10:25:17 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A7B016A417 for ; Sun, 30 Sep 2007 10:25:17 +0000 (UTC) (envelope-from mmakonnen@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by mx1.freebsd.org (Postfix) with ESMTP id CC52013C45A for ; Sun, 30 Sep 2007 10:25:16 +0000 (UTC) (envelope-from mmakonnen@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so6535713pyb for ; Sun, 30 Sep 2007 03:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=SqpdUVXvCrzBSzX9eKPW9iJRnzq7QHC65GKyGYaNL+A=; b=sFWtz4tdhe9R3jagGSXIST6OS7JibYD8BjppjxEO6lFuoH4MjkNsOiTYabXDlxSGa6bumZYDiDt8YHuT93sAYFJZvBRXR0l/1EVa1MBiW2Vlcbehv4jj6jgRnePgm+/5kNnnKMSUguBKlixHGP3a1ARFYyHeNVpPOqIC6dj2R3I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=scNvN03rcqlwS7vj5VLXO1jFpzhHV7lBJjzp6bO2i/zBhHfw4//sBfBCaaaDhNdvSIQj/Um6lyZMumVnhogBI5IXVAsExJp1h2txI3urd+/lJ4uff0eMeaJQz6NnNnTv+JfPN+cWG/tlT44nm4UauxOhugpAnikyVn9IOVvWqNo= Received: by 10.65.124.8 with SMTP id b8mr390154qbn.1191146414820; Sun, 30 Sep 2007 03:00:14 -0700 (PDT) Received: by 10.65.239.20 with HTTP; Sun, 30 Sep 2007 03:00:14 -0700 (PDT) Message-ID: <584bfc3f0709300300s22f2606w3f2628edc1aa15f@mail.gmail.com> Date: Sun, 30 Sep 2007 13:00:14 +0300 From: "Mike Telahun Makonnen" To: "Doug Barton" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-rc@freebsd.org Subject: Re: rc.d cleanup patch redux 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, 30 Sep 2007 10:25:17 -0000 On 9/23/07, Doug Barton wrote: > > 1. Remove "Deprecated variable name support" from rc.subr that was > supposed to be done after 6.x branched, but didn't get done (substantially > my fault). > > 2. Remove $NetBSD$ tags from all the rc.d files, since they aren't really > relevant any longer, and the information will be in CVS anyway. I'm > leaving it in rc.subr since we still occasionally pull stuff over in that > file. > > 3. Remove the comment from named_flags, to match all the other empty > _flags variables *grumble* I don't understand what the purpose of all those empty foo_flags="" variables is. Maybe for 8-CURRENT we can get rid of them from etc/defaults/rc.conf? > > 4. s/bootparams/bootparamd/g to match the convention of having $name, > PROVIDE, and file name match. I did check to make sure this script isn't > called from anywhere else, but if anyone is actually using it that would > be great feedback. > Sounds good. Although for 8-CURRENT we might want to go through all the other scripts that don't follow this convention and fix thouse up as well (the rpc* daemons come to mind). > 5. Add the shutdown KEYWORD to all the scripts that start persistent > services. I'm not sure why this was never done in the past, but I think it > should be done, since it allows the possibility of a clean(er) shutdown. I > left out network, routing, and kerberos stuff from this pass, since I > don't use kerberos and I'm not sure what effect this would have, and > routing (including firewall stuff) can go down last as it does now. > I'm not sure about the usefullness of these. If all the daemon needs is a simple kill -TERM, then I believe init already takes care of this. A script should make use of the shutdown keyword only if it needs to do additional processing. For example, rc.d/amd doesn't do anything special on shutdown. It just lets rc.subr(8) glue send a -TERM signal. The only benefit I see to adding the shutdown keyword to these kinds of scripts is that the shutdown occurs in reverse order of startup (as opposed to init just killing them off all at once after rc.shutdown). This change only adds aditional processing during shutdown without any real benefit. Also, rc.d/apm doesn't start any persistent daemons. It simply enables and disables the apm funtions. So, I don't think it needs to be run at shutdown time. Cheers, Mike. From owner-freebsd-rc@FreeBSD.ORG Sun Sep 30 16:10:08 2007 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E2CC16A418 for ; Sun, 30 Sep 2007 16:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2BD9C13C46E for ; Sun, 30 Sep 2007 16:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l8UGA780083399 for ; Sun, 30 Sep 2007 16:10:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l8UGA7OD083398; Sun, 30 Sep 2007 16:10:07 GMT (envelope-from gnats) Date: Sun, 30 Sep 2007 16:10:07 GMT Message-Id: <200709301610.l8UGA7OD083398@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: =?ISO-8859-1?Q?R=E9mi_Guyomarch?= Cc: Subject: Re: conf/116177: rc.d/mdconfig2 script fail at -CURRENT X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?ISO-8859-1?Q?R=E9mi_Guyomarch?= 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, 30 Sep 2007 16:10:08 -0000 The following reply was made to PR conf/116177; it has been noted by GNATS. From: =?ISO-8859-1?Q?R=E9mi_Guyomarch?= To: bug-followup@FreeBSD.org, dindin@dindin.ru Cc: Subject: Re: conf/116177: rc.d/mdconfig2 script fail at -CURRENT Date: Sun, 30 Sep 2007 16:57:42 +0200 I had the exact same problem but I fixed it by patching /sbin/mdconfig instead. With this patch, "/sbin/mdconfig -l -u md0" will return 0 if md0 exists and -1 if not. It has the advantage of fixing the bug in both /etc/rc.d/mdconfig and /etc/rc.d/mdconfig2. --- /usr/src/sbin/mdconfig/mdconfig.c~ 2007-09-30 15:25:16.000000000 +0200 +++ /usr/src/sbin/mdconfig/mdconfig.c 2007-09-30 15:25:16.000000000 +0200 @@ -284,7 +284,7 @@ */ md_list(NULL, OPT_LIST); } else { - md_query(mdunit); + return (md_query(mdunit)); } } else if (action == ATTACH) { if (cmdline < 2) @@ -323,7 +323,7 @@ struct ggeom *gg; struct gclass *gcl; void *sq; - int retcode; + int retcode, found; char *type, *file, *length; type = file = length = NULL; @@ -338,6 +338,7 @@ if (sq == NULL) return (-1); + found = 0; while ((gsp = geom_stats_snapshot_next(sq)) != NULL) { gid = geom_lookupid(&gm, gsp->id); if (gid == NULL) @@ -352,6 +353,8 @@ retcode = md_find(units, pp->lg_name); if (retcode != 1) continue; + else + found = 1; } gc = &pp->lg_config; printf("%s", pp->lg_name); @@ -380,7 +383,10 @@ printf("\n"); /* XXX: Check if it's enough to clean everything. */ geom_stats_snapshot_free(sq); - return (-1); + if ((opt & OPT_UNIT) && found) + return (0); + else + return (-1); } /* From owner-freebsd-rc@FreeBSD.ORG Mon Oct 1 11:08:41 2007 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFC1D16A4D5 for ; Mon, 1 Oct 2007 11:08:40 +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 CF14A13C4A6 for ; Mon, 1 Oct 2007 11:08:40 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l91B8eKR064595 for ; Mon, 1 Oct 2007 11:08:40 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l91B8dv2064591 for freebsd-rc@FreeBSD.org; Mon, 1 Oct 2007 11:08:39 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 1 Oct 2007 11:08:39 GMT Message-Id: <200710011108.l91B8dv2064591@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 you 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, 01 Oct 2007 11:08:41 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/98758 rc [jail] [patch] Templatize 'jail_fstab' in /etc/rc.d/ja o conf/98846 rc [jail] [patch] Templatize 'jail_rootdir' in /etc/rc.d/ o conf/105689 rc syslogd starts too late at boot o conf/107155 rc [ppp] /etc/rc.d/ppp-user does not bring up pppoe at bo o conf/107364 rc pf fails to start on bootup after system update from F 5 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/48870 rc [PATCH] rc.network: allow to cancel interface status d o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/73677 rc [patch] add support for powernow states to power_profi o conf/74817 rc [patch] network.subr: fixed automatic configuration of o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/79196 rc [PATCH] configurable dummynet loading from /etc/rc.co o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/85363 rc syntax error in /etc/rc.d/devfs o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o conf/88913 rc [patch] wrapper support for rc.subr o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/89870 rc [patch] feature request to make netif verbose rc.conf o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/95162 rc [patch] Missing feature in rc.subr o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/102913 rc [jail] [patch] /etc/rc.d/named killall in jailed OS o conf/103486 rc [rc.d] [jail] [patch] rc.d/jail: mount fstab after dev o conf/103489 rc [rc.d] [jail] [patch] named_chroot_autoupdate doesn't o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/105145 rc [PATCH] add redial function to rc.d/ppp o conf/105568 rc [patch] Add more flexibility to rc.conf, to choose "_e o conf/106009 rc [patch] Fix pppoed startup script to process multiply o conf/109562 rc [rc.d] [patch] Make rc.d/devfs usable from command-lin o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/114119 rc [jail] [patch] /etc/rc.d/jail improvements for network o conf/116177 rc rc.d/mdconfig2 script fail at -CURRENT o conf/116416 rc [patch] per-jail rc.conf(5) style configuration file i 32 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Oct 1 17:36:53 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE0C216A420 for ; Mon, 1 Oct 2007 17:36:53 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from cpanel03.rubas-s03.net (cpanel03.rubas-s03.net [195.182.222.73]) by mx1.freebsd.org (Postfix) with ESMTP id 8C73113C48D for ; Mon, 1 Oct 2007 17:36:53 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from gahrtop.bfh.ch ([147.87.115.230] helo=gahrtop.localhost) by cpanel03.rubas-s03.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1IcJkC-0001pe-EF for freebsd-rc@freebsd.org; Mon, 01 Oct 2007 13:47:24 +0200 Message-ID: <4700DE41.6030502@gahr.ch> Date: Mon, 01 Oct 2007 13:47:13 +0200 From: Pietro Cerutti User-Agent: Thunderbird 2.0.0.6 (X11/20070808) MIME-Version: 1.0 To: freebsd-rc@freebsd.org X-Enigmail-Version: 0.95.2 OpenPGP: id=9571F78E; url=http://www.gahr.ch/pgp Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigFFADB71ED9BB79F4C6FC8A96" X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel03.rubas-s03.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gahr.ch X-Source: X-Source-Args: X-Source-Dir: Subject: [patch] conf/105568 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, 01 Oct 2007 17:36:53 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFFADB71ED9BB79F4C6FC8A96 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi List, please consider the last follow-up to conf/105568, with the diff [1] applying against stable. Feedback is welcome! Regards, [1] http://www.gahr.ch/FreeBSD/patches/rc.subr-6.2-STABLE.diff --=20 Pietro Cerutti PGP Public Key: http://gahr.ch/pgp --------------enigFFADB71ED9BB79F4C6FC8A96 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHAN5FwMJqmJVx944RCgiQAKCYZr6wdwUE86DuHbULlCjE+c1NYgCguxoX /Bt5GxRo8Tl/iswNxKnhM+Y= =UTAE -----END PGP SIGNATURE----- --------------enigFFADB71ED9BB79F4C6FC8A96-- From owner-freebsd-rc@FreeBSD.ORG Mon Oct 1 20:40:12 2007 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C353B16A420 for ; Mon, 1 Oct 2007 20:40:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BE7E713C448 for ; Mon, 1 Oct 2007 20:40:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l91KeCYW097860 for ; Mon, 1 Oct 2007 20:40:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l91KeC2t097859; Mon, 1 Oct 2007 20:40:12 GMT (envelope-from gnats) Date: Mon, 1 Oct 2007 20:40:12 GMT Message-Id: <200710012040.l91KeC2t097859@freefall.freebsd.org> To: freebsd-rc@FreeBSD.org From: Pietro Cerutti Cc: Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Pietro Cerutti 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, 01 Oct 2007 20:40:12 -0000 The following reply was made to PR conf/105568; it has been noted by GNATS. From: Pietro Cerutti To: bug-followup@FreeBSD.org, pietro.cerutti@gmail.com Cc: Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup Date: Mon, 01 Oct 2007 13:42:43 +0200 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig71BA73101BF0FB5456761C13 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This patch applies against 6.2-STABLE --- rc.subr.orig 2007-10-01 13:21:35.000000000 +0200 +++ rc.subr 2007-10-01 13:37:10.000000000 +0200 @@ -58,6 +58,9 @@ PS=3D"/bin/ps -ww" JID=3D`$PS -p $$ -o jid=3D` +ASK_TIMEOUT=3D"5s" +ASK_DEFAULT=3D"YES" + case ${OSTYPE} in FreeBSD) SYSCTL_W=3D"${SYSCTL}" @@ -123,7 +126,9 @@ # # checkyesno var -# Test $1 variable, and warn if not set to YES or NO. +# Test $1 variable, and warn if not set to YES, NO or ASK. +# If it's "ask", prompt the user to decide wheter to set +# $1 to YES or NO. # Return 0 if it's "yes" (et al), nonzero otherwise. # checkyesno() @@ -141,6 +146,63 @@ [Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0) return 1 ;; + [Aa][Ss][Kk]) + # "ask" + + # Answer is stored in .ask file + # -> we are shutting down + _file=3D"/var/run/$name.ask" + if [ -f $_file ]; then + read _response < $_file + if checkyesno _response; then + return 0 + else + return 1 + fi + fi + + # Prompt and save answer in .ask file + # -> we are entering multi-user mode + + # Read timeout and default answer fo this daemon + eval _timeout=3D\$${name}_ask_timeout + eval _default=3D\=C3=A0=C3=A0{name}_ask_default + + # Timeout not set for this daemon + # -> revert to global default timeout + if [ ! $_timeout ]; then + _timeout=3D$ASK_TIMEOUT + fi + + # Default answer not set for this daemon + # -> revert to global default answer + if [ ! $_default ]; then + _default=3D$ASK_DEFAULT + fi + + # Read decision from stdin + read -t $_timeout -p "RC_ASK - Enable $name? [yes|no]" _enable + + # If timeout is elapsed, set default answer + if [ $? -eq 1 ]; then + _enable=3D${_response} + fi + + # Call checkyes no on answer + if checkyesno _enable; then + _choice=3D"yes" + _return=3D0 + else + _choice=3D"no" + _return=3D1 + fi + + # Save decision to .ask file + echo "$_choice" > $_file + + return $_return + ;; + *) warn "\$${1} is not set properly - see ${rcvar_manpage}." return 1 --=20 Pietro Cerutti PGP Public Key: http://gahr.ch/pgp --------------enig71BA73101BF0FB5456761C13 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHAN04wMJqmJVx944RCmhSAKCS8s4ExqdfiLgNfMxsVOzsnPn7kACdEXzg 1VPh3f5DkPtn+jbXqZWXFzA= =+Gcs -----END PGP SIGNATURE----- --------------enig71BA73101BF0FB5456761C13-- From owner-freebsd-rc@FreeBSD.ORG Mon Oct 1 21:13:41 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E132016A41B for ; Mon, 1 Oct 2007 21:13:41 +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 SMTP id AE33A13C467 for ; Mon, 1 Oct 2007 21:13:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 7275 invoked by uid 399); 1 Oct 2007 21:13:39 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTP; 1 Oct 2007 21:13:39 -0000 X-Originating-IP: 127.0.0.1 Date: Mon, 1 Oct 2007 14:13:36 -0700 (PDT) From: Doug Barton To: Mike Telahun Makonnen In-Reply-To: <584bfc3f0709300300s22f2606w3f2628edc1aa15f@mail.gmail.com> Message-ID: References: <584bfc3f0709300300s22f2606w3f2628edc1aa15f@mail.gmail.com> X-message-flag: Outlook -- Not just for spreading viruses anymore! X-OpenPGP-Key-ID: 0xD5B2F0FB Organization: http://www.FreeBSD.org/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-rc@freebsd.org Subject: Re: rc.d cleanup patch redux 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, 01 Oct 2007 21:13:42 -0000 On Sun, 30 Sep 2007, Mike Telahun Makonnen wrote: > On 9/23/07, Doug Barton wrote: >> >> 1. Remove "Deprecated variable name support" from rc.subr that was >> supposed to be done after 6.x branched, but didn't get done (substantially >> my fault). >> >> 2. Remove $NetBSD$ tags from all the rc.d files, since they aren't really >> relevant any longer, and the information will be in CVS anyway. I'm >> leaving it in rc.subr since we still occasionally pull stuff over in that >> file. >> >> 3. Remove the comment from named_flags, to match all the other empty >> _flags variables *grumble* > > I don't understand what the purpose of all those empty foo_flags="" > variables is. I put in a commented out example for named so that users would know that it's a knob which is available for them to twiddle. > Maybe for 8-CURRENT we can get rid of them from etc/defaults/rc.conf? Personally I'd rather comment them out, but I'm open to suggestions. >> 4. s/bootparams/bootparamd/g to match the convention of having $name, >> PROVIDE, and file name match. I did check to make sure this script isn't >> called from anywhere else, but if anyone is actually using it that would >> be great feedback. >> > > Sounds good. Although for 8-CURRENT we might want to go through all the > other scripts that don't follow this convention and fix thouse up as well (the > rpc* daemons come to mind). Yeah, bootparams was just low-hanging fruit. >> 5. Add the shutdown KEYWORD to all the scripts that start persistent >> services. I'm not sure why this was never done in the past, but I think it >> should be done, since it allows the possibility of a clean(er) shutdown. I >> left out network, routing, and kerberos stuff from this pass, since I >> don't use kerberos and I'm not sure what effect this would have, and >> routing (including firewall stuff) can go down last as it does now. >> > > I'm not sure about the usefullness of these. If all the daemon needs is > a simple kill -TERM, then I believe init already takes care of this. A script > should make use of the shutdown keyword only if it needs to do additional > processing. For example, rc.d/amd doesn't do anything special on > shutdown. It just lets rc.subr(8) glue send a -TERM signal. The only > benefit I see to adding the shutdown keyword to these kinds of scripts > is that the shutdown occurs in reverse order of startup (as opposed to > init just killing them off all at once after rc.shutdown). Yeah, that's the main benefit I had in mind. I also have a sort of gut feeling that doing this would be a good practice to adopt, and can lead to other benefits down the road, but I could be wrong. Any other opinions? > This change only adds aditional processing during shutdown without any > real benefit. I don't see any measurable increase in processing time, but my laptop is still on the fastish side. > Also, rc.d/apm doesn't start any persistent daemons. It simply enables > and disables the apm funtions. So, I don't think it needs to be run at > shutdown time. Yep, good point, I'll take that one out. Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Mon Oct 1 22:34:56 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B31D16A420; Mon, 1 Oct 2007 22:34:56 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: from terra.mike.lan (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C2C3D13C458; Mon, 1 Oct 2007 22:34:52 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: by terra.mike.lan (Postfix, from userid 1000) id D4B60678F3; Tue, 2 Oct 2007 01:41:16 +0300 (EAT) Date: Tue, 2 Oct 2007 01:41:16 +0300 From: Mike Makonnen To: Doug Barton Message-ID: <20071001224116.GA82760@terra.mike.lan> References: <584bfc3f0709300300s22f2606w3f2628edc1aa15f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD/7.0-CURRENT (i386) Cc: freebsd-rc@freebsd.org Subject: Re: rc.d cleanup patch redux 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, 01 Oct 2007 22:34:56 -0000 On Mon, Oct 01, 2007 at 02:13:36PM -0700, Doug Barton wrote: > On Sun, 30 Sep 2007, Mike Telahun Makonnen wrote: > > >> > >>3. Remove the comment from named_flags, to match all the other empty > >>_flags variables *grumble* > > > >I don't understand what the purpose of all those empty foo_flags="" > >variables is. > > I put in a commented out example for named so that users would know that > it's a knob which is available for them to twiddle. > > >Maybe for 8-CURRENT we can get rid of them from etc/defaults/rc.conf? > > Personally I'd rather comment them out, but I'm open to suggestions. Well, I was more concerned with bloat of /etc/defaults/rc.conf. I would prefer to just remove them all and replace them with a generic man page entry, but: mtm@terra ~% grep '^[a-z,0-9]*_flags=""' /etc/defaults/rc.conf | wc -l 33 so I guess it's not that important. > >I'm not sure about the usefullness of these. If all the daemon needs is > >a simple kill -TERM, then I believe init already takes care of this. A > >script > >should make use of the shutdown keyword only if it needs to do additional > >processing. For example, rc.d/amd doesn't do anything special on > >shutdown. It just lets rc.subr(8) glue send a -TERM signal. The only > >benefit I see to adding the shutdown keyword to these kinds of scripts > >is that the shutdown occurs in reverse order of startup (as opposed to > >init just killing them off all at once after rc.shutdown). > > Yeah, that's the main benefit I had in mind. I also have a sort of gut > feeling that doing this would be a good practice to adopt, and can lead to > other benefits down the road, but I could be wrong. > > Any other opinions? > > >This change only adds aditional processing during shutdown without any > >real benefit. > > I don't see any measurable increase in processing time, but my laptop is > still on the fastish side. It's just that this little chage adds a little extra processig time here, that change adds just a little extra there, etc... and before you know it they all add up to a big difference (especially if we don't use faststop like des suggested). I'm not really against this change, I just wanted to voice my reservations. In fact, I would be more comfortable with leaving this last part of the change until after the code-freeze since it's also likely to introduce more "foo is not running?" console spammage. Cheers, Mike. From owner-freebsd-rc@FreeBSD.ORG Tue Oct 2 00:46:30 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A53E16A468 for ; Tue, 2 Oct 2007 00:46:30 +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 SMTP id 43DB413C457 for ; Tue, 2 Oct 2007 00:46:30 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 17439 invoked by uid 399); 2 Oct 2007 00:46:28 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTP; 2 Oct 2007 00:46:28 -0000 X-Originating-IP: 127.0.0.1 Date: Mon, 1 Oct 2007 17:46:25 -0700 (PDT) From: Doug Barton To: Mike Makonnen In-Reply-To: <20071001224116.GA82760@terra.mike.lan> Message-ID: References: <584bfc3f0709300300s22f2606w3f2628edc1aa15f@mail.gmail.com> <20071001224116.GA82760@terra.mike.lan> X-message-flag: Outlook -- Not just for spreading viruses anymore! X-OpenPGP-Key-ID: 0xD5B2F0FB Organization: http://www.FreeBSD.org/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-rc@freebsd.org Subject: Re: rc.d cleanup patch redux 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, 02 Oct 2007 00:46:30 -0000 On Tue, 2 Oct 2007, Mike Makonnen wrote: > It's just that this little chage adds a little extra processig time here, > that change adds just a little extra there, etc... and before you know it > they all add up to a big difference (especially if we don't use faststop > like des suggested). I feel the same way, and I am resistant to ideas that add "just a little bit" of time for the same reason, especially for boot stuff. However with this change I literally could not measure any difference. The shutdown time for my system ranged from about 4 seconds to about 8 seconds, whether the patch was applied or not. Most of the time attributed to shutting down daemons actually comes from the ports I have installed. If someone had a very large number of services from the base running this change may introduce a measurable change in shutdown time, but I really doubt it. > I'm not really against this change, I just wanted to voice my reservations. > In fact, I would be more comfortable with leaving this last part of > the change until after the code-freeze since it's also likely to > introduce more "foo is not running?" console spammage. Yeah, my original patch did not include the shutdown stuff, I added it in response to a thread elsewhere that basically amounted to "lots of other rc.d scripts don't have it, so I shouldn't have to add it either." I'll split the patch into "functional" and "non-functional" halves, ask for re@ approval for the latter, and post the former to -current to ask for more testers. Thanks, Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Tue Oct 2 01:00:21 2007 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ACA716A417 for ; Tue, 2 Oct 2007 01:00: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 SMTP id B77DF13C480 for ; Tue, 2 Oct 2007 01:00:20 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 1603 invoked by uid 399); 2 Oct 2007 01:00:19 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTP; 2 Oct 2007 01:00:19 -0000 X-Originating-IP: 127.0.0.1 Date: Mon, 1 Oct 2007 18:00:10 -0700 (PDT) From: Doug Barton To: Pietro Cerutti In-Reply-To: <200710012040.l91KeC2t097859@freefall.freebsd.org> Message-ID: References: <200710012040.l91KeC2t097859@freefall.freebsd.org> X-message-flag: Outlook -- Not just for spreading viruses anymore! X-OpenPGP-Key-ID: 0xD5B2F0FB Organization: http://www.FreeBSD.org/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: freebsd-rc@FreeBSD.org Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup 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, 02 Oct 2007 01:00:21 -0000 What do you feel is the need/benefit of adding this? I read your PR, and I don't find your reasoning very compelling. You can easily start or stop services after the system enters multi-user mode by simply changing the _enable variable and running /etc/rc.d/foo start|stop as needed. There are precious few services that depend on being started at boot time. Also, in regards to your section about using this on a laptop, I have solved the same problem by using an rc.local script that detects the network I'm on and then runs anything I need with onestart. Admittedly your solution has the benefit of properly stopping the service at shutdown time, but I've never found that to be a problem. So can you please elaborate on your reasoning? And do others find this to be an idea worth pursuing? Thanks, Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Tue Oct 2 11:16:18 2007 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75AA716A419; Tue, 2 Oct 2007 11:16:18 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from cpanel03.rubas-s03.net (cpanel03.rubas-s03.net [195.182.222.73]) by mx1.freebsd.org (Postfix) with ESMTP id E6BA313C461; Tue, 2 Oct 2007 11:16:17 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from 80-218-180-150.dclient.hispeed.ch ([80.218.180.150] helo=gahrtop.localhost) by cpanel03.rubas-s03.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Icfjc-0001Vy-8j; Tue, 02 Oct 2007 13:16:16 +0200 Message-ID: <47022870.7030607@gahr.ch> Date: Tue, 02 Oct 2007 13:16:00 +0200 From: Pietro Cerutti User-Agent: Thunderbird 2.0.0.6 (X11/20070808) MIME-Version: 1.0 To: Doug Barton References: <200710012040.l91KeC2t097859@freefall.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.95.2 OpenPGP: id=9571F78E; url=http://www.gahr.ch/pgp Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigFDED252132D663577351FCB8" X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel03.rubas-s03.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gahr.ch X-Source: X-Source-Args: X-Source-Dir: Cc: freebsd-rc@FreeBSD.org Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup 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, 02 Oct 2007 11:16:18 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFDED252132D663577351FCB8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Doug Barton wrote: > What do you feel is the need/benefit of adding this? I read your PR, an= d > I don't find your reasoning very compelling. You can easily start or > stop services after the system enters multi-user mode by simply changin= g > the _enable variable and running /etc/rc.d/foo start|stop as needed. > There are precious few services that depend on being started at boot ti= me. 1) enter multi user mode 2) edit rc.conf 3) /etc/rc.d/foo [start|stop] vs. 1) choose yes or no before entering multi user mode It's just a matter of comfort, cleanness and easy of handling. Here are a few examples which come to my mind right now: A student having a "web technologies" course would start its web server and database daemons only during the course. The same student, during a Linux course would start the kqemu service to load the Qemu kernel module and run a virtualized linux machine. An employee would start a VPN connection to its corporation by enabling vpnc only when working at home. On a laptop, one could start powerd only when he's running on battery or when the environment temperature is high (thus CPU clock speed should be controlled). >=20 > Also, in regards to your section about using this on a laptop, I have > solved the same problem by using an rc.local script that detects the > network I'm on and then runs anything I need with onestart. Admittedly > your solution has the benefit of properly stopping the service at > shutdown time, but I've never found that to be a problem. The discussion about the use on laptops is not only related to the networking facilities. In the few examples I posted above, I clearly assume that the machine on which these decisions are taken is a laptop. I mentioned the use on laptops on the problem report because this is clearly a matter of mobility. Moreover, being it a boot-related patch, it's not supposed to be used in a server with hundreds of days of uptime. >=20 > So can you please elaborate on your reasoning? And do others find this > to be an idea worth pursuing? Finally, I think that the potential benefits of this patch greatly exceed its negative effects (if any..). >=20 > Thanks, Thanks for your feedback! >=20 > Doug >=20 --=20 Pietro Cerutti PGP Public Key: http://gahr.ch/pgp --------------enigFDED252132D663577351FCB8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHAih3wMJqmJVx944RCtB2AKCAuKLz9o3T82asxvSmRQt2j2WlAgCfTL9j zl2W3mXxhVvmBlryqttnJzo= =Mofa -----END PGP SIGNATURE----- --------------enigFDED252132D663577351FCB8-- From owner-freebsd-rc@FreeBSD.ORG Tue Oct 2 22:25:13 2007 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C52816A418 for ; Tue, 2 Oct 2007 22:25:13 +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 SMTP id 0C5BA13C447 for ; Tue, 2 Oct 2007 22:25:12 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 23520 invoked by uid 399); 2 Oct 2007 22:25:10 -0000 Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTP; 2 Oct 2007 22:25:10 -0000 X-Originating-IP: 127.0.0.1 Date: Tue, 2 Oct 2007 15:25:04 -0700 (PDT) From: Doug Barton To: Pietro Cerutti In-Reply-To: <47022870.7030607@gahr.ch> Message-ID: References: <200710012040.l91KeC2t097859@freefall.freebsd.org> <47022870.7030607@gahr.ch> X-message-flag: Outlook -- Not just for spreading viruses anymore! X-OpenPGP-Key-ID: 0xD5B2F0FB Organization: http://www.FreeBSD.org/ MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: freebsd-rc@FreeBSD.org Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup 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, 02 Oct 2007 22:25:13 -0000 On Tue, 2 Oct 2007, Pietro Cerutti wrote: > Doug Barton wrote: >> What do you feel is the need/benefit of adding this? I read your PR, and >> I don't find your reasoning very compelling. You can easily start or >> stop services after the system enters multi-user mode by simply changing >> the _enable variable and running /etc/rc.d/foo start|stop as needed. >> There are precious few services that depend on being started at boot time. > > 1) enter multi user mode That's going to happen anyway, so this is a red herring. > 2) edit rc.conf > 3) /etc/rc.d/foo [start|stop] Or just do: /etc/rc.d/foo onestart > 1) choose yes or no before entering multi user mode > > It's just a matter of comfort, cleanness and easy of handling. I certainly see that you believe this to be true, but I'm sorry to say that I don't agree with you. I didn't see anything in the list of examples you gave that convinces me that what you're proposing is dramatically better than simply using onestart where needed. Perhaps others will have different opinions. Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Tue Oct 2 23:06:16 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A269516A501 for ; Tue, 2 Oct 2007 23:06:16 +0000 (UTC) (envelope-from kian.mohageri@gmail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.231]) by mx1.freebsd.org (Postfix) with ESMTP id 609F113C459 for ; Tue, 2 Oct 2007 23:06:16 +0000 (UTC) (envelope-from kian.mohageri@gmail.com) Received: by nz-out-0506.google.com with SMTP id l8so2740499nzf for ; Tue, 02 Oct 2007 16:06:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=aBR07pgBAiwsrs07hucJ5fzUgZ1OQSGnI3yVpqwhixA=; b=UwDHcsPW+W8OJfGYUcuSTzvqf9an2KKlp8grEwFCX9QbIBkA1itR9CpCbNPEj+uu7VfFdcGbOH6864qKBv9+RAGQGHF1bykMQqUpthg2H99kYD0H/uLC/DnrOa6b1jaqvUVDa5ad5Z6NoPO7DGYcXK5+fEVe8f109RhBb8opj4g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tfL5oFigTRRi95sdTYxjagiwcVIkgbqBXJ1RKzSG0dotQsZN7jbLEMLud96MXYFRIK4gnWQxdul39M+XtmwJZoDiKM8JavTQyV/P3Ax4FzhjBesaopbBQr8LpGoO/Jjb7dn0rseIfvd391EU69MYU7SUrP9SPVTHVKmzyuXAGWU= Received: by 10.65.100.14 with SMTP id c14mr7406736qbm.1191364882127; Tue, 02 Oct 2007 15:41:22 -0700 (PDT) Received: by 10.64.209.2 with HTTP; Tue, 2 Oct 2007 15:41:22 -0700 (PDT) Message-ID: Date: Tue, 2 Oct 2007 15:41:22 -0700 From: "Kian Mohageri" To: "Doug Barton" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200710012040.l91KeC2t097859@freefall.freebsd.org> <47022870.7030607@gahr.ch> Cc: freebsd-rc@freebsd.org Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup 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, 02 Oct 2007 23:06:16 -0000 On 10/2/07, Doug Barton wrote: > On Tue, 2 Oct 2007, Pietro Cerutti wrote: > > > Doug Barton wrote: > >> What do you feel is the need/benefit of adding this? I read your PR, and > >> I don't find your reasoning very compelling. You can easily start or > >> stop services after the system enters multi-user mode by simply changing > >> the _enable variable and running /etc/rc.d/foo start|stop as needed. > >> There are precious few services that depend on being started at boot time. > > > > 1) enter multi user mode > > That's going to happen anyway, so this is a red herring. > > > 2) edit rc.conf > > 3) /etc/rc.d/foo [start|stop] > > Or just do: /etc/rc.d/foo onestart > > > 1) choose yes or no before entering multi user mode > > > > It's just a matter of comfort, cleanness and easy of handling. > > I certainly see that you believe this to be true, but I'm sorry to say > that I don't agree with you. I didn't see anything in the list of examples > you gave that convinces me that what you're proposing is dramatically > better than simply using onestart where needed. > > Perhaps others will have different opinions. > I agree with Doug on this one. While I see it being useful in a few cases, the [great] majority of the time it will go completely unused. The times when it could be used can be dealt with in other ways. Seems like feature creep to me. -Kian From owner-freebsd-rc@FreeBSD.ORG Wed Oct 3 14:35:51 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5107C16A417; Wed, 3 Oct 2007 14:35:51 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from cpanel03.rubas-s03.net (cpanel03.rubas-s03.net [195.182.222.73]) by mx1.freebsd.org (Postfix) with ESMTP id E7BE413C48A; Wed, 3 Oct 2007 14:35:50 +0000 (UTC) (envelope-from gahr@gahr.ch) Received: from [147.87.248.21] (helo=gahrtop.localhost) by cpanel03.rubas-s03.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Id5KG-00088d-Q7; Wed, 03 Oct 2007 16:35:49 +0200 Message-ID: <4703A8B6.80803@gahr.ch> Date: Wed, 03 Oct 2007 16:35:34 +0200 From: Pietro Cerutti User-Agent: Thunderbird 2.0.0.6 (X11/20070808) MIME-Version: 1.0 To: Kian Mohageri References: <200710012040.l91KeC2t097859@freefall.freebsd.org> <47022870.7030607@gahr.ch> In-Reply-To: X-Enigmail-Version: 0.95.2 OpenPGP: id=9571F78E; url=http://www.gahr.ch/pgp Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enigC4820B483F728EA0BB9087E4" X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cpanel03.rubas-s03.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - gahr.ch X-Source: X-Source-Args: X-Source-Dir: Cc: Doug Barton , freebsd-rc@freebsd.org Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup 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, 03 Oct 2007 14:35:51 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC4820B483F728EA0BB9087E4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Kian Mohageri wrote: > On 10/2/07, Doug Barton wrote: >> On Tue, 2 Oct 2007, Pietro Cerutti wrote: >> >>> Doug Barton wrote: >>>> What do you feel is the need/benefit of adding this? I read your PR,= and >>>> I don't find your reasoning very compelling. You can easily start or= >>>> stop services after the system enters multi-user mode by simply chan= ging >>>> the _enable variable and running /etc/rc.d/foo start|stop as needed.= >>>> There are precious few services that depend on being started at boot= time. >>> 1) enter multi user mode >> That's going to happen anyway, so this is a red herring. >> >>> 2) edit rc.conf >>> 3) /etc/rc.d/foo [start|stop] >> Or just do: /etc/rc.d/foo onestart >> >>> 1) choose yes or no before entering multi user mode >>> >>> It's just a matter of comfort, cleanness and easy of handling. >> I certainly see that you believe this to be true, but I'm sorry to say= >> that I don't agree with you. I didn't see anything in the list of exam= ples >> you gave that convinces me that what you're proposing is dramatically >> better than simply using onestart where needed. >> >> Perhaps others will have different opinions. >> >=20 > I agree with Doug on this one. While I see it being useful in a few > cases, the [great] majority of the time it will go completely unused. >=20 > The times when it could be used can be dealt with in other ways. >=20 > Seems like feature creep to me. I have no problem accepting the fact that you don't need this feature, but, on the contrary, it seems that you have a problem accepting the fact that someone could find it useful. The feature doesn't change any defaults, don't have any side effects and can merely be ignored if you don't want to use it. Why are you so reluctant in accepting it? >=20 > -Kian --=20 Pietro Cerutti PGP Public Key: http://gahr.ch/pgp --------------enigC4820B483F728EA0BB9087E4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFHA6i6wMJqmJVx944RCutIAKCbZqI9Evqave/cela5mcJL7lfeCgCeOpvG aDADbk1iRwsAW86ky1T3cFg= =/0Mr -----END PGP SIGNATURE----- --------------enigC4820B483F728EA0BB9087E4-- From owner-freebsd-rc@FreeBSD.ORG Fri Oct 5 22:01:18 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AD7216A49A for ; Fri, 5 Oct 2007 22:01:18 +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 SMTP id 7C67F13C4BB for ; Fri, 5 Oct 2007 22:01:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 8161 invoked by uid 399); 5 Oct 2007 22:01:16 -0000 Received: from localhost (HELO ?192.168.0.4?) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTP; 5 Oct 2007 22:01:16 -0000 X-Originating-IP: 127.0.0.1 Message-ID: <4706B42B.20207@FreeBSD.org> Date: Fri, 05 Oct 2007 15:01:15 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Pietro Cerutti References: <200710012040.l91KeC2t097859@freefall.freebsd.org> <47022870.7030607@gahr.ch> <4703A8B6.80803@gahr.ch> In-Reply-To: <4703A8B6.80803@gahr.ch> X-Enigmail-Version: 0.95.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup 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, 05 Oct 2007 22:01:18 -0000 Pietro Cerutti wrote: > I have no problem accepting the fact that you don't need this feature, > but, on the contrary, it seems that you have a problem accepting the > fact that someone could find it useful. That is certainly not true for me, and I don't think it's true for Kian either. I can see how _someone_ could find it useful, I just don't think that a majority of our users would benefit from this. > The feature doesn't change any defaults, don't have any side effects and > can merely be ignored if you don't want to use it. > > Why are you so reluctant in accepting it? The rc.d system is critical to FreeBSD, and making boot time faster is a goal that always have in front of us. We have to critically examine every single suggestion for modifications to it, and the bias is strongly in the direction of not adding something that won't be beneficial to the majority of our users. Every extra line of code adds complexity and some amount of processing time, no matter how small. It's very easy to go from a streamlined system (which IMO rc.d is not yet) to a bloated pig one centimeter at a time. I don't expect you to necessarily agree with my analysis, but I wanted to explain more of the reasoning behind it, which hopefully will help you understand that we're not just rejecting your proposal out of hand. Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Fri Oct 5 23:56:00 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2706C16A417 for ; Fri, 5 Oct 2007 23:56:00 +0000 (UTC) (envelope-from kian.mohageri@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.182]) by mx1.freebsd.org (Postfix) with ESMTP id CFDC613C458 for ; Fri, 5 Oct 2007 23:55:59 +0000 (UTC) (envelope-from kian.mohageri@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so1340361pyb for ; Fri, 05 Oct 2007 16:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=CmvsvV/WjPlsBYXDZ4JRxtrLDz04guiI8wP5RqizjoM=; b=UlUOUi1HlyfFWlAgw0W+YbV5e+Xjvj04BB3o4Lo8JmdVwrUrP79hJ7wXgr3hvHKRk5kMLPde4lhs1skuaoQnvAU5W5GEuOBCAgX1nu+hzfehOfCFfUBr+f+wbi/V9l3sFFz1yr1y7Y4Ny3mANJN/GN9Y20r7wvteH6ubIQFLGQw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=NOvVbgOoPrcwGtT3/g6gUgie2Z0NXPjpTZS2lMqRYAOvMiCyTnz+nZYW+lwbn1bXRwEYVg6tx/3hzh2FNaeHt8Fb0OyKynTThMcVQi24IKAYqkx/mQWEau3ryw/l6H/nduXQiWOLjSpoLGvB1w7vZ+1EcBOqfiRBTnEaGfMs3bE= Received: by 10.65.203.3 with SMTP id f3mr28665877qbq.1191628558721; Fri, 05 Oct 2007 16:55:58 -0700 (PDT) Received: by 10.64.209.2 with HTTP; Fri, 5 Oct 2007 16:55:58 -0700 (PDT) Message-ID: Date: Fri, 5 Oct 2007 16:55:58 -0700 From: "Kian Mohageri" To: "Doug Barton" In-Reply-To: <4706B42B.20207@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200710012040.l91KeC2t097859@freefall.freebsd.org> <47022870.7030607@gahr.ch> <4703A8B6.80803@gahr.ch> <4706B42B.20207@FreeBSD.org> Cc: freebsd-rc@freebsd.org Subject: Re: conf/105568: [patch] Add more flexibility to rc.conf, to choose "_enable" values at startup 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, 05 Oct 2007 23:56:00 -0000 On 10/5/07, Doug Barton wrote: > Pietro Cerutti wrote: > > > I have no problem accepting the fact that you don't need this feature, > > but, on the contrary, it seems that you have a problem accepting the > > fact that someone could find it useful. > > That is certainly not true for me, and I don't think it's true for Kian > either. I can see how _someone_ could find it useful, I just don't think > that a majority of our users would benefit from this. > Doug is right - I do not find it completely useless. I can think of a time when I would use it too. But that's rare and I don't think the developers should add code to support all users' needs. Keeping the system simple is more important to me than having complete flexibility included by default. Also, Doug mentioned a way for you to address your issue without this modification. > > The feature doesn't change any defaults, don't have any side effects and > > can merely be ignored if you don't want to use it. > > > > Why are you so reluctant in accepting it? > > The rc.d system is critical to FreeBSD, and making boot time faster is a > goal that always have in front of us. We have to critically examine > every single suggestion for modifications to it, and the bias is > strongly in the direction of not adding something that won't be > beneficial to the majority of our users. > Exactly. As a user of FreeBSD, I truly appreciate the critical analysis the developers give to each feature request. Don't feel bad about being told "No." I've been told as much when requesting changes too. In hindsight, I'm glad the features were left out. -Kian From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 16:12:31 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83BEC16A41A for ; Sat, 6 Oct 2007 16:12:31 +0000 (UTC) (envelope-from prvs=0799e52d77=jay-b@quest4.org) Received: from zebra.esosoft.net (zebra.esosoft.net [66.241.145.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6758113C468 for ; Sat, 6 Oct 2007 16:12:31 +0000 (UTC) (envelope-from prvs=0799e52d77=jay-b@quest4.org) Received: from [12.5.189.253] (helo=4BANKS) by zebra.esosoft.net with esmtpa (Exim 4.68) (envelope-from ) id 1IeBtA-0005u9-MP for freebsd-rc@freebsd.org; Sat, 06 Oct 2007 08:48:25 -0700 Message-ID: <004d01c80830$5447e770$90bd050c@4BANKS> From: "Jay Banks" To: Date: Sat, 6 Oct 2007 10:47:54 -0500 MIME-Version: 1.0 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Getting a script to run at boot X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jay Banks 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, 06 Oct 2007 16:12:31 -0000 I'm having a lot of trouble getting scripts to run on startup. It seems = like a simple concept, but I reboot and reboot and reboot, and the = script isn't running. I've had to fight with stuff before but I can = usually get it going (arpwatch, mpd, etc.). Now I'm trying to get sntop = to run now and I'm getting nowhere. Here is my sntop setup. I created /usr/local/etc/rc.d/sntop.sh (with chmod 755 as per the docs). Here is the script, which I got from the FreeBSD handbook: #!/bin/sh # # PROVIDE: sntop # REQUIRE: DAEMON # KEYWORD: shutdown #!/bin/sh # # PROVIDE: sntop # REQUIRE: DAEMON # KEYWORD: shutdown # # DO NOT CHANGE THESE DEFAULT VALUES HERE # SET THEM IN THE /etc/rc.conf FILE # sntop_enable=3D${sntop_enable-"NO"} sntop_flags=3D${sntop_flags-""} sntop_pidfile=3D${sntop_pidfile-"/var/run/sntop.pid"} . /etc/rc.subr name=3D"sntop" rcvar=3D`set_rcvar` command=3D"/usr/local/bin/sntop" load_rc_config $name pidfile=3D"${sntop_pidfile}" start_cmd=3D"echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} = ${sntop_flags } ${command_args}" run_rc_command "$1" Here is what I added to /etc/rc.conf sntop_enable=3D"YES" sntop_flags=3D"-d -r 30 -f /etc/sntoprc/sntoprc -w -e = /usr/home/mysites/www/data/e tb/index.html" If I change directory to /usr/local/etc/rc.d and do: perl sntop.sh start The sntop will start and show up running in the system processes. It = seems to refresh and all of the other flags seem to work. However, if I = close the terminal session, that's it, it's dead.=20 And if I reboot, it will not show up to be running in the system = processes. Considering that sntop would be a type of script that one would want to = make sure it is always running, I wish this could be addressed in the = man pages.=20 Also, giving my issues here, I just tried to create a cron job to run = it. That didn't work because it gets an error regarding fping. I'm really a big advocate of FreeBSD, but for the love of all things = holy, I could have a program start up on a Windows 2003 server in less = than 10 minutes.=20 From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 17:13:44 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 063DA16A41B for ; Sat, 6 Oct 2007 17:13:44 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: from terra.mike.lan (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1300B13C45A; Sat, 6 Oct 2007 17:13:41 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: by terra.mike.lan (Postfix, from userid 1000) id 7F449695C1; Sat, 6 Oct 2007 20:14:55 +0300 (EAT) Date: Sat, 6 Oct 2007 20:14:55 +0300 From: Mike Makonnen To: Jay Banks Message-ID: <20071006171455.GA71986@terra.mike.lan> References: <004d01c80830$5447e770$90bd050c@4BANKS> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <004d01c80830$5447e770$90bd050c@4BANKS> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD/7.0-CURRENT (i386) Cc: freebsd-rc@freebsd.org Subject: Re: Getting a script to run at boot 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, 06 Oct 2007 17:13:44 -0000 On Sat, Oct 06, 2007 at 10:47:54AM -0500, Jay Banks wrote: > I'm having a lot of trouble getting scripts to run on startup. It seems like a simple concept, but I reboot and reboot and reboot, and the script isn't running. I've had to fight with stuff before but I can usually get it going (arpwatch, mpd, etc.). Now I'm trying to get sntop to run now and I'm getting nowhere. > A few things would help diagnose this problem: o FreeBSD version o output with rc_debug=yes in /etc/rc.conf o the output of: ls -l /usr/local/etc/rc.d o the contents of the local_startup knob i.e: grep local_startup /etc/defaults/rc.conf /etc/rc.conf Also, I'm not sure how up-to-date the handbook is. You should probably also read rc(8). > Here is my sntop setup. > > I created /usr/local/etc/rc.d/sntop.sh (with chmod 755 as per the docs). Lose the .sh suffix. The only rc.d scripts that should end in .sh are scripts that need to run from within the parent script. I doubt there's a need in this case. > > Here is the script, which I got from the FreeBSD handbook: > > #!/bin/sh > # > # PROVIDE: sntop > # REQUIRE: DAEMON > # KEYWORD: shutdown > #!/bin/sh > # > # PROVIDE: sntop > # REQUIRE: DAEMON > # KEYWORD: shutdown Is the above duplication a 'copy&paste' mistake or is it really in the script? If so, this may be your problem right here. > > start_cmd="echo \"Starting ${name}.\"; /usr/bin/nice -5 ${command} ${sntop_flags > } ${command_args}" You can get rid of this line by simply putting sntop_nice="5" in /etc/rc.conf. > > If I change directory to /usr/local/etc/rc.d and do: > > perl sntop.sh start why perl? > > The sntop will start and show up running in the system processes. It seems to refresh and all of the other flags seem to work. However, if I close the terminal session, that's it, it's dead. > This may mean that the program didn't damonize. If it didn't then obviously it will terminate when you terminate the terminal you started it from. Do you get your prompt back after you run this command? Cheers, Mike. From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 19:59:21 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3270F16A41A for ; Sat, 6 Oct 2007 19:59:21 +0000 (UTC) (envelope-from jay.quest4@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.188]) by mx1.freebsd.org (Postfix) with ESMTP id A44F413C44B for ; Sat, 6 Oct 2007 19:59:20 +0000 (UTC) (envelope-from jay.quest4@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so692903nfb for ; Sat, 06 Oct 2007 12:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:from:to:cc:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; bh=YwQs+fYMsicQi3pkSe45bdRYdODGuOyA/nYrDZ9N++Y=; b=Sqy6Jcp2ZqigOaD04sVTn7vEt76izIOGETbE6vRXhDk46Ctlw0fvA6mG9rMN6z2Bs/X/geb/ExJzDhPOI8PgjVzM7NeFxEXEsvHD/K2xoJEr43c4uL/3TmAXh2QwoQ18bMDVrZhgOnK+RFUV9XtJtrgTOHF//pSREoTne7ioZtE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:from:to:cc:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=QzMj7OPXwZgoIvj2wRtSeNp8Lyjhp5Lm65lNMjTcLxx+G+QHVIICgwxQwJQLDFAMeVzJ9jpYmJBUgGnV76YETFGo4LihjkF7jaWP96zCx81kBCxu8ExagdQ7WMLM7n4efU/+kaBrCAom4B3He4PTkZn8J2t1/MG3UOyoZMPRytM= Received: by 10.78.204.20 with SMTP id b20mr9410067hug.1191699021813; Sat, 06 Oct 2007 12:30:21 -0700 (PDT) Received: from 4BANKS ( [12.5.189.253]) by mx.google.com with ESMTPS id d26sm587010nfh.2007.10.06.12.30.14 (version=SSLv3 cipher=RC4-MD5); Sat, 06 Oct 2007 12:30:17 -0700 (PDT) Message-ID: <005601c8084f$526c3180$90bd050c@4BANKS> From: "Jay Banks" To: References: <004d01c80830$5447e770$90bd050c@4BANKS> <20071006171455.GA71986@terra.mike.lan> Date: Sat, 6 Oct 2007 14:30:10 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3028 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Cc: Mike Makonnen Subject: Re: Getting a script to run at boot 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, 06 Oct 2007 19:59:21 -0000 > A few things would help diagnose this problem: > o FreeBSD version Basic stock install of FreeBSD 6.2 > o output with rc_debug=yes in /etc/rc.conf Oct 6 13:24:03 12 root: /etc/rc: INFO: checkyesno: sntop_enable is set to YES. Oct 6 13:24:03 12 root: /etc/rc: INFO: pid file (/var/run/sntop.pid): not readable. Oct 6 13:24:03 12 root: /etc/rc: INFO: run_rc_command: evaluating echo "Startin g sntop."; /usr/bin/nice -5 /usr/local/bin/sntop -d -r 30 -f /etc/sntoprc/sntoprc -w -e /usr/home/mysites/www/data/etb/index.html (). > o the output of: ls -l /usr/local/etc/rc.d -r-xr-xr-x 1 root wheel 2086 Jun 26 10:12 apache21.sh -rwxr-x--x 1 root wheel 683 Aug 15 18:36 mpd4.sh -rwxr-x--x 1 root wheel 682 Jul 31 08:36 mpd4.sh.sample -r-xr-xr-x 1 root wheel 1659 Jun 26 14:13 mysql-server -r-xr-xr-x 1 root wheel 670 Jun 26 10:39 proftpd -rwxr-xr-x 1 root wheel 2130 Aug 16 12:33 radiusd.sh -rwxr-xr-x 1 root wheel 2130 Aug 16 12:31 rc.radiusd -rwxr-xr-x 1 root wheel 516 Oct 6 07:15 sntop > o the contents of the local_startup knob > i.e: grep local_startup /etc/defaults/rc.conf /etc/rc.conf /etc/defaults/rc.conf:local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs. > Is the above duplication a 'copy&paste' mistake or is it really in > the script? If so, this may be your problem right here. Not sure how it happend, but it just a copy & paste mistake. That would be too easy. The script came from here: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-starting-services.html I just changed "utility" to "sntop" and adjusted the command line accordingly. >> If I change directory to /usr/local/etc/rc.d and do: >> >> perl sntop.sh start > > why perl? I don't know. "./sntop start" produces the same results > This may mean that the program didn't damonize. If it didn't then > obviously > it will terminate when you terminate the terminal you started it from. Do > you get your prompt back after you run this command? No I don't. The script specifically has a command line to run as a dameon: -d, --daemon - daemon mode: make sntop capable of running in the back- ground. note, it wont automatically fork into the background. If I remove -d from the flags in /etc/rc.conf, the script will just display to the terminal screen. When I put -d back in, it will run and output the html file, refreshes when it is supposed to, and everything looks good, but I do not get the prompt back afterwards. When I reboot, the html output file is wiped out and contains no data, and the process does not show up in the running processes. What exactly does, "it wont automatically fork into the background," mean? > Cheers, > Mike. Thanks for looking at it. Jay Banks From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 20:39:10 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D75E16A418 for ; Sat, 6 Oct 2007 20:39:10 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by mx1.freebsd.org (Postfix) with ESMTP id B39F413C458 for ; Sat, 6 Oct 2007 20:39:09 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so696673nfb for ; Sat, 06 Oct 2007 13:39:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=8e5CWTpJLZn8HziXwXjuclxyz1EG47q6h1kmrgBfDes=; b=jQaFaMoSOg/GC4NHvtGarHe/OyG7xMA29VPlHIqDEAHiVHhhsd3mGviCDyWs/CRzqGPaIpwhYtnHvi1C+7aV/6wY+o8AlecHFV6Gfczdct90tDH19HVGHOskyf6cQfhLTP03q17DhpZlMTfYQrhvonSkRN11P3dp2+LlkTT9bKQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=R7Y9SuUDmF0iXeqKxzcePpX5Sj8yHi+8B2x9JJRswm8mratTABDSIE+kpBaAc0JB20mIekJxeb5ll3QIEzVO+Wz1QakJV0emg/uae4siwuTOItv/kYq7hjjEf7hq9iugEufSQwnxLOElJDAdsJPb907RMAu2JWBav1rRG1jqJcY= Received: by 10.86.62.3 with SMTP id k3mr3646020fga.1191701658774; Sat, 06 Oct 2007 13:14:18 -0700 (PDT) Received: by 10.86.25.9 with HTTP; Sat, 6 Oct 2007 13:14:18 -0700 (PDT) Message-ID: Date: Sat, 6 Oct 2007 13:14:18 -0700 From: "Maksim Yevmenkin" To: freebsd-rc@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: multiple instances of ppp 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, 06 Oct 2007 20:39:10 -0000 hello, a friend of mine send me the following /etc/rc.c/ppp replacement script. the idea is to start multiple instances of ppp at boot time (possibly with different profiles). i'm not sure if this is ok to commit as it is, so i decided to ask if there is a better way to handle this. any thoughts on the subject is very much appreciated. thanks, max #ppp_enable="NO" # Start user-ppp (or NO). #ppp_program="/usr/sbin/ppp" # Path to user-ppp program. #ppp_mode="auto" # Choice of "auto", "ddial", "direct" or "dedicated". #ppp_nat="YES" # Use PPP's internal network address translation or NO. #ppp_user="root" # Which user to run ppp as #ppp_profile="papchap" # Which profiles to use from /etc/ppp/ppp.conf, # # in example: # # ppp_profile="papchap profile2 profile3" # Override default settings ppp_mode and ppp_nat for profiles #ppp_papchap_mode="ddial" #ppp_profile3_mode="dedicated" #ppp_profile3_nat="NO" # # PROVIDE: ppp # REQUIRE: netif isdnd # KEYWORD: nojail . /etc/rc.subr name="ppp" rcvar=`set_rcvar` command="/usr/sbin/${name}" start_cmd="ppp_prestart" start_poststart="ppp_poststart" ppp_prestart() { echo -n "Starting PPP profile:" for profile in ${ppp_profile} do echo -n " ${profile}" # Establish ppp mode. # rc_flags='' eval ppp_mode=\$ppp_${profile}_mode if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \ -a "${ppp_mode}" != "dedicated" \ -a "${ppp_mode}" != "background" ]; then ppp_mode="auto" fi rc_flags="$rc_flags -quiet -${ppp_mode}" # Switch on NAT mode? # nat=$ppp_nat eval cur_nat=\$ppp_${profile}_nat case $cur_nat in [Yy][Ee][Ss]|[Nn][Oo]) nat=${cur_nat} ;; esac case ${nat} in [Yy][Ee][Ss]) rc_flags="$rc_flags -nat" ;; esac # Run ! # su -m $ppp_user -c "$command ${rc_flags} ${profile}" done echo "." } ppp_poststart() { # Re-Sync ipfilter and pf so they pick up any new network interfaces # /etc/rc.d/ipfilter resync /etc/rc.d/pf resync } load_rc_config $name run_rc_command "$1" From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 21:10:42 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12B3A16A420 for ; Sat, 6 Oct 2007 21:10:42 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: from terra.mike.lan (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2333D13C469; Sat, 6 Oct 2007 21:10:40 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: by terra.mike.lan (Postfix, from userid 1000) id 51A6E67991; Sun, 7 Oct 2007 00:15:06 +0300 (EAT) Date: Sun, 7 Oct 2007 00:15:06 +0300 From: Mike Makonnen To: Jay Banks Message-ID: <20071006211506.GA7075@terra.mike.lan> References: <004d01c80830$5447e770$90bd050c@4BANKS> <20071006171455.GA71986@terra.mike.lan> <005601c8084f$526c3180$90bd050c@4BANKS> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <005601c8084f$526c3180$90bd050c@4BANKS> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD/7.0-CURRENT (i386) Cc: freebsd-rc@freebsd.org Subject: Re: Getting a script to run at boot 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, 06 Oct 2007 21:10:42 -0000 --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Oct 06, 2007 at 02:30:10PM -0500, Jay Banks wrote: > > > >This may mean that the program didn't damonize. If it didn't then > >obviously > >it will terminate when you terminate the terminal you started it from. Do > >you get your prompt back after you run this command? > > No I don't. The script specifically has a command line to run as a dameon: > > -d, --daemon - daemon mode: make sntop capable of running in the back- > ground. note, it wont automatically fork into the background. > > If I remove -d from the flags in /etc/rc.conf, the script will just display > to the terminal screen. When I put -d back in, it will run and output > the html file, refreshes when it is supposed to, and everything looks > good, but I do not get the prompt back afterwards. > > When I reboot, the html output file is wiped out and contains no > data, and the process does not show up in the running processes. > > What exactly does, "it wont automatically fork into the background," > mean? Well, that's the problem then. The '--daemon' switch is misleading. You should get it to work as expected by adding a '&' at the end of the command-line. Just for kicks I installed it on my system and with the attached script and the following in my /etc/rc.conf it seems to work as expected (though I haven't tried running it on startup): sntop_enable=yes sntop_flags="-d -r 30 -f /usr/local/etc/sntoprc -w -e /home/mtm/public_html/sntop.html" sntop_nice=5 Cheers. -- Mike Makonnen | GPG-KEY: http://people.freebsd.org/~mtm/mtm.asc mmakonnen @ gmail.com | AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm @ FreeBSD.Org | FreeBSD - http://www.freebsd.org --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=sntop #!/bin/sh # # PROVIDE: sntop # REQUIRE: DAEMON # KEYWORD: shutdown # # DO NOT CHANGE THESE DEFAULT VALUES HERE # SET THEM IN THE /etc/rc.conf FILE # sntop_enable=${sntop_enable-"NO"} sntop_flags=${sntop_flags-""} . /etc/rc.subr name="sntop" rcvar=`set_rcvar` command="/usr/local/bin/${name}" command_args="&" load_rc_config $name run_rc_command "$1" --5vNYLRcllDrimb99-- From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 21:53:33 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9384E16A41A for ; Sat, 6 Oct 2007 21:53:33 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: from terra.mike.lan (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 89AE213C447; Sat, 6 Oct 2007 21:53:31 +0000 (UTC) (envelope-from mtm@FreeBSD.Org) Received: by terra.mike.lan (Postfix, from userid 1000) id A5B7F67991; Sun, 7 Oct 2007 00:57:57 +0300 (EAT) Date: Sun, 7 Oct 2007 00:57:57 +0300 From: Mike Makonnen To: Maksim Yevmenkin Message-ID: <20071006215757.GA10458@terra.mike.lan> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD/7.0-CURRENT (i386) Cc: freebsd-rc@freebsd.org Subject: Re: multiple instances of ppp 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, 06 Oct 2007 21:53:33 -0000 On Sat, Oct 06, 2007 at 01:14:18PM -0700, Maksim Yevmenkin wrote: > hello, > > a friend of mine send me the following /etc/rc.c/ppp replacement > script. the idea is to start multiple instances of ppp at boot time > (possibly with different profiles). > > i'm not sure if this is ok to commit as it is, so i decided to ask if > there is a better way to handle this. > > any thoughts on the subject is very much appreciated. I like it, but it has several bugs and needs to be cleaned up first. My comments are inline. > > . /etc/rc.subr > name="ppp" > rcvar=`set_rcvar` > command="/usr/sbin/${name}" > start_cmd="ppp_prestart" > start_poststart="ppp_poststart" The above line should start with: start_postcmd= The ppp_poststart() routine will never be executed becuse rc.subr(8) looks for start_postcmd not start_poststart. > > ppp_prestart() You should change the name of the routine to reflect its new behavior. It's no longer executed before the start routine, it *is* the start routine. > { > echo -n "Starting PPP profile:" > for profile in ${ppp_profile} > do > echo -n " ${profile}" > # Establish ppp mode. > # > rc_flags='' > eval ppp_mode=\$ppp_${profile}_mode This breaks POLA. It should be fixed so that it falls back to ppp_mode if ppp_${profile}_mode is empty. > if [ "${ppp_mode}" != "ddial" -a "${ppp_mode}" != "direct" \ > -a "${ppp_mode}" != "dedicated" \ > -a "${ppp_mode}" != "background" ]; then > ppp_mode="auto" > fi > rc_flags="$rc_flags -quiet -${ppp_mode}" ^^^^^^^^^^ rc_flags is set to the the "empty string" at the beginning of the loop so it will allways be empty at this point in script. > > # Switch on NAT mode? > # > nat=$ppp_nat > eval cur_nat=\$ppp_${profile}_nat > case $cur_nat in > [Yy][Ee][Ss]|[Nn][Oo]) > nat=${cur_nat} > ;; > esac > case ${nat} in > [Yy][Ee][Ss]) > rc_flags="$rc_flags -nat" > ;; > esac > > # Run ! > # > su -m $ppp_user -c "$command ${rc_flags} ${profile}" Cheers. -- Mike Makonnen | GPG-KEY: http://people.freebsd.org/~mtm/mtm.asc mmakonnen @ gmail.com | AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm @ FreeBSD.Org | FreeBSD - http://www.freebsd.org From owner-freebsd-rc@FreeBSD.ORG Sat Oct 6 22:49:59 2007 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59F3716A41A for ; Sat, 6 Oct 2007 22:49:59 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.186]) by mx1.freebsd.org (Postfix) with ESMTP id DF2BC13C45B for ; Sat, 6 Oct 2007 22:49:58 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by mu-out-0910.google.com with SMTP id w9so1075655mue for ; Sat, 06 Oct 2007 15:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=JMPTBRqWlPYtZ8Ys4roRQg9YfpW+jBf1WNQXgxM1xYo=; b=CuPNDZsI6n711qVwGINGsHj5NdvJWQ8ND2vx1DnJRm9XKexbATvVsTn/uAO0Ij65SzXoWQ1vQSyWBccEzErAZ84PZKB0e6LCw/TB04aQHL756Wj1Cw/rcis3xC8Iop9rtGKahX4Fu+5gAzAiFOOnq9ONfzl+Pr9E5DDwD1HRSks= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kCECQJ+o8beZZcZr7vXkm82vY2IZWrtLIvYTt1g37OlAzgmbqrlnQykTquXkHxINjZ3hzqu7tsAiM5kWPR69A24C1dvkJZhL85j2bRxfLZcfK5lt3YAWhwwo33KKkZm8W4DA7DKQGkAjL7TdhHkF+cxadHA9LrhGDsCR9tRV7vc= Received: by 10.86.100.7 with SMTP id x7mr3704940fgb.1191710997500; Sat, 06 Oct 2007 15:49:57 -0700 (PDT) Received: by 10.86.25.9 with HTTP; Sat, 6 Oct 2007 15:49:57 -0700 (PDT) Message-ID: Date: Sat, 6 Oct 2007 15:49:57 -0700 From: "Maksim Yevmenkin" To: "Mike Makonnen" In-Reply-To: <20071006215757.GA10458@terra.mike.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071006215757.GA10458@terra.mike.lan> Cc: freebsd-rc@freebsd.org Subject: Re: multiple instances of ppp 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, 06 Oct 2007 22:49:59 -0000 Mike, On 10/6/07, Mike Makonnen wrote: > On Sat, Oct 06, 2007 at 01:14:18PM -0700, Maksim Yevmenkin wrote: > > hello, > > > > a friend of mine send me the following /etc/rc.c/ppp replacement > > script. the idea is to start multiple instances of ppp at boot time > > (possibly with different profiles). > > > > i'm not sure if this is ok to commit as it is, so i decided to ask if > > there is a better way to handle this. > > > > any thoughts on the subject is very much appreciated. > > I like it, but it has several bugs and needs to be cleaned up first. My > comments are inline. thanks for your comments. what do you think about something like # PROVIDE: ppp # REQUIRE: netif isdnd # KEYWORD: nojail . /etc/rc.subr name="ppp" rcvar=`set_rcvar` command="/usr/sbin/${name}" start_cmd="ppp_start" start_postcmd="ppp_poststart" ppp_start_profile() { local _ppp_profile, _ppp_mode, _ppp_nat _ppp_profile=$1 # Check for ppp profile mode override. # eval _ppp_mode=\$ppp_${_ppp_profile}_mode if [ -z "$_ppp_mode" ]; then _ppp_mode=$ppp_mode fi # Check for ppp profile nat override. # eval _ppp_nat=\$ppp_${_ppp_profile}_nat if [ -z "$_ppp_nat" ]; then _ppp_nat=$ppp_nat fi # Establish ppp mode. # if [ "${_ppp_mode}" != "ddial" -a "${_ppp_mode}" != "direct" \ -a "${_ppp_mode}" != "dedicated" \ -a "${_ppp_mode}" != "background" ]; then _ppp_mode="auto" fi rc_flags="-quiet -${_ppp_mode}" # Switch on NAT mode? # case ${_ppp_nat} in [Yy][Ee][Ss]) rc_flags="$rc_flags -nat" ;; esac # Run! # echo su -m $ppp_user -c "$command ${rc_flags} ${_ppp_profile}" } ppp_start() { local _p echo -n "Starting PPP profile:" for _p in $ppp_profile; do echo -n " $_p" ppp_start_profile $_p done echo "." } ppp_poststart() { # Re-Sync ipfilter and pf so they pick up any new network interfaces # /etc/rc.d/ipfilter resync /etc/rc.d/pf resync } load_rc_config $name run_rc_command "$1"