From owner-freebsd-rc@FreeBSD.ORG Mon Jun 4 11:07:47 2012 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 B9E371065670 for ; Mon, 4 Jun 2012 11:07:47 +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 A2CDE8FC16 for ; Mon, 4 Jun 2012 11:07:47 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q54B7lvG017559 for ; Mon, 4 Jun 2012 11:07:47 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q54B7lho017557 for freebsd-rc@FreeBSD.org; Mon, 4 Jun 2012 11:07:47 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 4 Jun 2012 11:07:47 GMT Message-Id: <201206041107.q54B7lho017557@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2012 11:07:47 -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/167566 rc [rc.d] [patch] ipdivert module loading vs. ipfw rc.d o o conf/166484 rc [rc] [patch] rc.initdiskless patch for different major o kern/165769 rc [rc][jai][ipv6] IPv6 Initialization on external iface o bin/165477 rc [rc] dhclient is run twice o conf/164393 rc [rc.d] restarting netif with static addresses doesn't o conf/163508 rc [rc.subr] [patch] Add "enable" and "disable" commands o conf/163488 rc Confusing explanation in defaults/rc.conf o conf/163321 rc [rc.conf] [patch] allow _fib syntax in rc.conf o conf/162642 rc .sh scripts in /usr/local/etc/rc.d get executed, not s p kern/161899 rc [route] ntpd(8): Repeating RTM_MISS packets causing hi o conf/161107 rc [rc] stop_boot in mountcritlocal usage is incorrect. o conf/160403 rc [rc] [patch] concurrently running rc-scripts during bo o conf/160240 rc rc.d/mdconfig and mdconfig2 should autoset $_type to v o conf/159846 rc [rc.conf] routing_stop_inet6() logic doesn't handle ip o conf/158557 rc [patch] /etc/rc.d/pf broken messages o conf/158127 rc [patch] remount_optional option in rc.initdiskless doe o conf/153666 rc [rc.d][patch] mount filesystems from fstab over zfs da o conf/153200 rc post-boot /etc/rc.d/network_ipv6 start can miss neighb o conf/153123 rc [rc] [patch] add gsched rc file to automatically inser o conf/150474 rc [patch] rc.d/accounting: Add ability to set location o o conf/149867 rc [PATCH] rc.d script to manage multiple FIBS (kern opti o conf/149831 rc [PATCH] add support to /etc/rc.d/jail for delegating Z o conf/148656 rc rc.firewall(8): {oip} and {iip} variables in rc.firewa o conf/147685 rc [rc.d] [patch] new feature for /etc/rc.d/fsck o conf/147444 rc [rc.d] [patch] /etc/rc.d/zfs stop not called on reboot o conf/146053 rc [patch] [request] shutdown of jails breaks inter-jail o conf/145445 rc [rc.d] error in /etc/rc.d/jail (bad logic) o conf/145399 rc [patch] rc.d scripts are unable to start/stop programs o conf/145009 rc [patch] rc.subr(8): rc.conf should allow mac label con o conf/144213 rc [rc.d] [patch] Disappearing zvols on reboot o conf/143637 rc [patch] ntpdate(8) support for ntp-servers supplied by o conf/143085 rc [patch] ftp-proxy(8) rc(8) with multiple instances 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(8): [patch] add rc.conf.d support to /usr/loca 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/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.d] [patch] Making rc.firewall (workstation) IPv6 a o conf/137629 rc [rc.d] background_dhclient rc.conf option causing doub o conf/137470 rc [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameter o conf/137271 rc [rc.d] Cannot update /etc/host.conf when root filesyst 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/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/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped p 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/123119 rc [patch] rc script for ipfw does not handle IPv6 o conf/122968 rc [rc.d] /etc/rc.d/addswap: md swapfile multiplication a 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/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/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/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/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/44170 rc [patch] Add ability to run multiple pppoed(8) on start 93 problems total. From owner-freebsd-rc@FreeBSD.ORG Fri Jun 8 00:46:22 2012 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 CACB4106564A for ; Fri, 8 Jun 2012 00:46:22 +0000 (UTC) (envelope-from sahil@tandon.net) Received: from cricket.hamla.org (cricket.hamla.org [206.251.255.31]) by mx1.freebsd.org (Postfix) with ESMTP id A62A08FC16 for ; Fri, 8 Jun 2012 00:46:22 +0000 (UTC) Received: from magic.hamla.org (cpe-68-174-134-215.nyc.res.rr.com [68.174.134.215]) by cricket.hamla.org (Postfix) with ESMTPSA id 9D7B88A06C for ; Thu, 7 Jun 2012 20:46:15 -0400 (EDT) Date: Thu, 7 Jun 2012 20:46:13 -0400 From: Sahil Tandon To: freebsd-rc@FreeBSD.org Message-ID: <20120608004612.GA15600@magic.hamla.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZoaI/ZTpAVc4A5k6" Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.3 at cricket.hamla.org X-Virus-Status: Clean Cc: Subject: Request for review: mail/postfix-postfwd rc script X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sahil Tandon List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2012 00:46:23 -0000 --ZoaI/ZTpAVc4A5k6 Content-Type: multipart/mixed; boundary="jI8keyz6grp/JLjh" Content-Disposition: inline --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, I haven't hacked on rc scripts in a while, and have made some non-negligible changes to the mail/postfix-postfwd script. I would be much obliged to anyone who could catch egregious mistakes, and also welcome style or "best practices" suggestions. No need to be gentle, and thanks in advance! :) Please Cc: me on any replies as I am not subscribed to this list. --=20 Sahil Tandon --jI8keyz6grp/JLjh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="postfwd-rc_script.txt" Content-Transfer-Encoding: quoted-printable Index: files/postfwd.in =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/pcvs/ports/mail/postfix-postfwd/files/postfwd.in,v retrieving revision 1.4 diff -u -u -r1.4 postfwd.in --- files/postfwd.in 14 Jan 2012 08:56:01 -0000 1.4 +++ files/postfwd.in 8 Jun 2012 00:43:08 -0000 @@ -9,9 +9,10 @@ # # postfwd_enable (bool): =20 # Set to "NO" by default. -# Set it to "YES" to enable postfwd. -# postfwd_config (path): Set to %%PREFIX%%/etc/postfwd.conf -# by default. +# Set it to "YES" to enable postfwd. +# postfwd_config (path): +# Set to %%PREFIX%%/etc/postfwd.conf +# by default. # =20 . /etc/rc.subr @@ -19,27 +20,45 @@ name=3Dpostfwd rcvar=3Dpostfwd_enable =20 -command=3D%%PREFIX%%/bin/${name} -required_files=3D%%PREFIX%%/etc/${name}.conf -pidfile=3D"/var/run/${name}.pid" +load_rc_config $name =20 -stop_postcmd=3Dstop_postcmd +: ${postfwd_enable=3D"NO"} +: ${postfwd_config=3D"%%PREFIX%%/etc/${name}.conf"} +: ${postfwd_flags=3D"--shortlog --summary=3D600 --cache=3D600 --cache-rbl-= timeout=3D3600 --cleanup-requests=3D1200 --cleanup-rbls=3D1800 --cleanup-ra= tes=3D1200"} +: ${postfwd_pidfile=3D"/var/run/${name}.pid"} =20 -stop_postcmd() -{ - rm -f $pidfile -} +required_files=3D%%PREFIX%%/etc/${name}.conf +command=3D%%PREFIX%%/bin/${name} +command_args=3D"-d -f ${required_files} --pidfile=3D${postfwd_pidfile} -i = 127.0.0.1 -p 10040 -u nobody -g nobody" =20 -load_rc_config "$name" +start_precmd=3D"${name}_check" +status_cmd=3D"${name}_status" +stop_cmd=3D"${name}_stop" +stop_postcmd=3D"${name}_postcmd" +extra_commands=3D"reload" + +postfwd_check() { + if [ -f "${postfwd_pidfile}" ]; then + err 1 "${name} is already running." + fi +} =20 -case "$postfwd_enable" in - [Yy][Ee][Ss] | 1 | [Oo][Nn] | [Tt][Rr][Uu][Ee]) ;; - *) echo "To make use of $name you must first set $rcvar=3D\"YES\" in /= etc/rc.conf" ;; -esac +postfwd_status() { + postfwd_pid=3D`cat ${postfwd_pidfile} 2>/dev/null` + postfwd_run=3D`ps -U nobody | grep -m 1 ${postfwd_pid} 2>/dev/null` + if [ -n "${postfwd_pid}" -a -n "${postfwd_run}" ]; then + echo "$name is running as ${postfwd_pid}" + else + echo "$name is not running" + fi +} =20 -: ${postfwd_enable=3D"NO"} -: ${postfwd_config=3D"%%PREFIX%%/etc/${name}.conf"} +postfwd_stop() { + ${command} -k --pidfile=3D${postfwd_pidfile}=20 +} =20 -command_args=3D"--shortlog --summary=3D600 --cache=3D600 --cache-rbl-timeo= ut=3D3600 --cleanup-requests=3D1200 --cleanup-rbls=3D1800 --cleanup-rates= =3D1200 -d -f ${required_files} -i 127.0.0.1 -p 10040 -u nobody -g nobody" +postfwd_postcmd() { + rm -f ${postfwd_pidfile} +} =20 run_rc_command "$1" --jI8keyz6grp/JLjh-- --ZoaI/ZTpAVc4A5k6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iQEcBAEBAgAGBQJP0UtUAAoJENvQYAHAFtl3ZikIAJTCAflwGJ1f/YM9jGHR8qje NniRM2uA94y0vZDCKuLl9Nyr0D+2ZwvOZi2ylLPpMiTYNr00O4AlMEhvTDkSdJwc t95+4O18OlO2Q8/OutuI/ctgytrDpOtnO1tDU4Fc+eW2MDhgjQBIMh3HsLFa7Gfz boVOrUPQG7/OH15cdP55DiGtNsUcqygNfqnxRgSxjFXk++UmfivfJ5s8sw4pLTmB U/dUJBBBCY9nGPIDh3UVulfTbHpgfB8TXxA2QAmLyxuiTgUN8xbTUaqK4WGpfYaG cB62P8ZsCcEL98H6TzzEYJp+lH7RQ51ujE+N8XxxigLHXEhY+NIhcstBuPft8U0= =p9+p -----END PGP SIGNATURE----- --ZoaI/ZTpAVc4A5k6-- From owner-freebsd-rc@FreeBSD.ORG Sat Jun 9 01:04:15 2012 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 C16A0106564A for ; Sat, 9 Jun 2012 01:04:15 +0000 (UTC) (envelope-from sahil@tandon.net) Received: from cricket.hamla.org (cricket.hamla.org [206.251.255.31]) by mx1.freebsd.org (Postfix) with ESMTP id A8B488FC12 for ; Sat, 9 Jun 2012 01:04:15 +0000 (UTC) Received: from magic.hamla.org (cpe-68-174-134-215.nyc.res.rr.com [68.174.134.215]) by cricket.hamla.org (Postfix) with ESMTPSA id 88DA58A06C for ; Fri, 8 Jun 2012 21:04:08 -0400 (EDT) Date: Fri, 8 Jun 2012 21:04:06 -0400 From: Sahil Tandon To: freebsd-rc@freebsd.org Message-ID: <20120609010405.GA295@magic.hamla.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Virus-Scanned: clamav-milter 0.97.3 at cricket.hamla.org X-Virus-Status: Clean Subject: RESEND: [sahil@tandon.net: Request for review: mail/postfix-postfwd rc script] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Sahil Tandon List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 01:04:15 -0000 I suspect my last message was mangled in transit because of the way the attachment was included; trying again in-line. ----- Forwarded message from Sahil Tandon ----- Greetings, I haven't hacked on rc scripts in a while, and have made some non-negligible changes to the mail/postfix-postfwd script. I would be much obliged to anyone who could catch egregious mistakes, and also welcome style or "best practices" suggestions. No need to be gentle, and thanks in advance! :) Please Cc: me on any replies as I am not subscribed to this list. -- Sahil Tandon Index: files/postfwd.in =================================================================== RCS file: /home/pcvs/ports/mail/postfix-postfwd/files/postfwd.in,v retrieving revision 1.4 diff -u -u -r1.4 postfwd.in --- files/postfwd.in 14 Jan 2012 08:56:01 -0000 1.4 +++ files/postfwd.in 8 Jun 2012 00:43:08 -0000 @@ -9,9 +9,10 @@ # # postfwd_enable (bool): # Set to "NO" by default. -# Set it to "YES" to enable postfwd. -# postfwd_config (path): Set to %%PREFIX%%/etc/postfwd.conf -# by default. +# Set it to "YES" to enable postfwd. +# postfwd_config (path): +# Set to %%PREFIX%%/etc/postfwd.conf +# by default. # . /etc/rc.subr @@ -19,27 +20,45 @@ name=postfwd rcvar=postfwd_enable -command=%%PREFIX%%/bin/${name} -required_files=%%PREFIX%%/etc/${name}.conf -pidfile="/var/run/${name}.pid" +load_rc_config $name -stop_postcmd=stop_postcmd +: ${postfwd_enable="NO"} +: ${postfwd_config="%%PREFIX%%/etc/${name}.conf"} +: ${postfwd_flags="--shortlog --summary=600 --cache=600 --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 --cleanup-rates=1200"} +: ${postfwd_pidfile="/var/run/${name}.pid"} -stop_postcmd() -{ - rm -f $pidfile -} +required_files=%%PREFIX%%/etc/${name}.conf +command=%%PREFIX%%/bin/${name} +command_args="-d -f ${required_files} --pidfile=${postfwd_pidfile} -i 127.0.0.1 -p 10040 -u nobody -g nobody" -load_rc_config "$name" +start_precmd="${name}_check" +status_cmd="${name}_status" +stop_cmd="${name}_stop" +stop_postcmd="${name}_postcmd" +extra_commands="reload" + +postfwd_check() { + if [ -f "${postfwd_pidfile}" ]; then + err 1 "${name} is already running." + fi +} -case "$postfwd_enable" in - [Yy][Ee][Ss] | 1 | [Oo][Nn] | [Tt][Rr][Uu][Ee]) ;; - *) echo "To make use of $name you must first set $rcvar=\"YES\" in /etc/rc.conf" ;; -esac +postfwd_status() { + postfwd_pid=`cat ${postfwd_pidfile} 2>/dev/null` + postfwd_run=`ps -U nobody | grep -m 1 ${postfwd_pid} 2>/dev/null` + if [ -n "${postfwd_pid}" -a -n "${postfwd_run}" ]; then + echo "$name is running as ${postfwd_pid}" + else + echo "$name is not running" + fi +} -: ${postfwd_enable="NO"} -: ${postfwd_config="%%PREFIX%%/etc/${name}.conf"} +postfwd_stop() { + ${command} -k --pidfile=${postfwd_pidfile} +} -command_args="--shortlog --summary=600 --cache=600 --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 --cleanup-rates=1200 -d -f ${required_files} -i 127.0.0.1 -p 10040 -u nobody -g nobody" +postfwd_postcmd() { + rm -f ${postfwd_pidfile} +} run_rc_command "$1" ----- End forwarded message ----- From owner-freebsd-rc@FreeBSD.ORG Sat Jun 9 06:11:20 2012 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 702831065670; Sat, 9 Jun 2012 06:11:20 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 432108FC14; Sat, 9 Jun 2012 06:11:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q596BKkU041737; Sat, 9 Jun 2012 06:11:20 GMT (envelope-from wblock@freefall.freebsd.org) Received: (from wblock@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q596BKNe041732; Sat, 9 Jun 2012 06:11:20 GMT (envelope-from wblock) Date: Sat, 9 Jun 2012 06:11:20 GMT Message-Id: <201206090611.q596BKNe041732@freefall.freebsd.org> To: wblock@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: wblock@FreeBSD.org Cc: Subject: Re: bin/168544: [patch] [rc]: addswap-mounted swapfiles cause panic on shutdown X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 06:11:20 -0000 Synopsis: [patch] [rc]: addswap-mounted swapfiles cause panic on shutdown Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: wblock Responsible-Changed-When: Sat Jun 9 06:08:26 UTC 2012 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=168544 From owner-freebsd-rc@FreeBSD.ORG Sat Jun 9 17:58:56 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53]) by hub.freebsd.org (Postfix) with ESMTP id 9F2801065670 for ; Sat, 9 Jun 2012 17:58:56 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from opti.dougb.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 41618153D30; Sat, 9 Jun 2012 17:58:41 +0000 (UTC) Message-ID: <4FD38ED0.7070803@FreeBSD.org> Date: Sat, 09 Jun 2012 10:58:40 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120608 Thunderbird/12.0.1 MIME-Version: 1.0 To: Sahil Tandon References: <20120609010405.GA295@magic.hamla.org> In-Reply-To: <20120609010405.GA295@magic.hamla.org> X-Enigmail-Version: 1.4.2 OpenPGP: id=D5B2F0FB Content-Type: multipart/mixed; boundary="------------060102080006000809080004" Cc: freebsd-rc@freebsd.org Subject: Re: RESEND: [sahil@tandon.net: Request for review: mail/postfix-postfwd rc script] X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2012 17:58:56 -0000 This is a multi-part message in MIME format. --------------060102080006000809080004 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sorry for the delay, here's a different patch that incorporates most of your changes, with a few other improvements: 1. Add a $FreeBSD$ 2. Remove some trailing whitespace 3. pidfile= is magic, and needs to be included. It's also not usually necessary to allow the user to change the pidfile location, but if you really want to allow that, the way to do it is in the new patch. 4. It's not clear to me why there are so many items in the default _flags option. Are any of those truly required? If so, they should be in command_args. OTOH, if what this represents is a rational default configuration that the user might want to twiddle, it's fine. 5. I used the same trick for the conf file as I did for pidfile (utilizing required_files). It was already properly utilized in command_args in your patch. 6. Rather than having stop_cmd and stop_postcmd be separate functions I just put them in line. 7. With pidfile= the check command you added should not be necessary, 'service postfwd status' is what you want instead. Of course, none of this is tested, so you'll want to do that. :) hth, Doug -- This .signature sanitized for your protection --------------060102080006000809080004 Content-Type: text/plain; charset=UTF-8; name="postfwd.in.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="postfwd.in.patch" --- /usr/ports/mail/postfix-postfwd/files/postfwd.in 2012-01-15 14:25:28.000000000 -0800 +++ postfwd.in 2012-06-09 10:35:44.000000000 -0700 @@ -1,45 +1,50 @@ #!/bin/sh -# PROVIDE: postfwd +# $FreeBSD$ +# +# PROVIDE: postfwd # REQUIRE: LOGIN cleanvar # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # -# postfwd_enable (bool): +# postfwd_enable (bool): # Set to "NO" by default. -# Set it to "YES" to enable postfwd. -# postfwd_config (path): Set to %%PREFIX%%/etc/postfwd.conf -# by default. -# +# Set it to "YES" to enable postfwd. +# postfwd_config (path): +# Set to %%PREFIX%%/etc/postfwd.conf +# by default. . /etc/rc.subr name=postfwd rcvar=postfwd_enable -command=%%PREFIX%%/bin/${name} -required_files=%%PREFIX%%/etc/${name}.conf -pidfile="/var/run/${name}.pid" - -stop_postcmd=stop_postcmd +load_rc_config $name -stop_postcmd() -{ - rm -f $pidfile -} - -load_rc_config "$name" +: ${postfwd_enable:="NO"} +: ${postfwd_flags="--shortlog --summary=600 --cache=600 --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 --cleanup-rates=1200"} -case "$postfwd_enable" in - [Yy][Ee][Ss] | 1 | [Oo][Nn] | [Tt][Rr][Uu][Ee]) ;; - *) echo "To make use of $name you must first set $rcvar=\"YES\" in /etc/rc.conf" ;; -esac +pidfile=${postfwd_pidfile:="/var/run/${name}.pid"} +required_files=${postfwd_config:="%%PREFIX%%/etc/${name}.conf"} -: ${postfwd_enable="NO"} -: ${postfwd_config="%%PREFIX%%/etc/${name}.conf"} +command=%%PREFIX%%/bin/${name} +command_args="-d -f ${required_files} --pidfile=${pidfile} -i 127.0.0.1 -p 10040 -u nobody -g nobody" -command_args="--shortlog --summary=600 --cache=600 --cache-rbl-timeout=3600 --cleanup-requests=1200 --cleanup-rbls=1800 --cleanup-rates=1200 -d -f ${required_files} -i 127.0.0.1 -p 10040 -u nobody -g nobody" +status_cmd="${name}_status" +stop_cmd="${command} -k --pidfile=${pidfile}" +stop_postcmd="rm -f ${pidfile}" +extra_commands="reload" + +postfwd_status() { + postfwd_pid=`cat ${pidfile} 2>/dev/null` + postfwd_run=`ps -U nobody | grep -m 1 ${postfwd_pid} 2>/dev/null` + if [ -n "${postfwd_pid}" -a -n "${postfwd_run}" ]; then + echo "$name is running as ${postfwd_pid}" + else + echo "$name is not running" + fi +} run_rc_command "$1" --------------060102080006000809080004--