From owner-freebsd-rc@FreeBSD.ORG Sun Jan 29 13:25:16 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 38DA2106566B; Sun, 29 Jan 2012 13:25:16 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 708E28FC13; Sun, 29 Jan 2012 13:25:15 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 28BB21DEDF2; Sun, 29 Jan 2012 14:25:14 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 0F01528468; Sun, 29 Jan 2012 14:25:14 +0100 (CET) Date: Sun, 29 Jan 2012 14:25:13 +0100 From: Jilles Tjoelker To: Garrett Cooper Message-ID: <20120129132513.GA97754@stack.nl> References: <4F14F4FF.902@erdgeist.org> <20120120230300.GE87357@lor.one-eyed-alien.net> <20120121233757.GB31224@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-rc@freebsd.org, simon , Brooks Davis Subject: Re: Bumping a pet bug 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, 29 Jan 2012 13:25:16 -0000 On Sun, Jan 22, 2012 at 12:46:10PM -0800, Garrett Cooper wrote: > On Sun, Jan 22, 2012 at 5:46 AM, Dirk Engling wrote: > > Here is the output I get from not running the jail script as root: > > Starting jails:mount_nullfs: Operation not permitted > > devfs rule: ioctl DEVFSIO_RGETNEXT: Operation not permitted > > mount: dev : Operation not permitted > > /etc/rc.d/jail: WARNING: devfs_domount(): Unable to mount devfs on > > /usr/jails/foo.com/dev > > /etc/rc.d/jail: WARNING: devfs_mount_jail: devfs was not mounted on > > /usr/jails/foo.com/dev > > ln: log: Permission denied > > mount: /usr/jails/foo.com/dev/fd: No such file or directory > > mount: proc : Operation not permitted > >  cannot start jail "foo_com": > Probably a simple case of lack of set -e in the script with > appropriate error catching logic. The jailme and portsjail [*] scripts > had similar issues. You cannot use 'set -e' in rc.d scripts as it must be off both while sourcing /etc/rc.subr and while calling any function defined by it. Violating this may lead to unexpected exits of scripts. I think 'set -e' is not a "handle all my errors for me" panacea. If the script is any more complicated than just a sequence of commands, 'set -e' will very likely not do what you want. For example, if a compound command or function call is "tested", -e is ignored during all of it. The exact meaning of 'set -e' has changed several times, yet these problems have not been solved. I don't think it can be "fixed", so the least bad thing is to follow POSIX so the wrongness is at least consistent. (Unfortunately, there are still people trying to "fix" -e in POSIX in 2012.) Instead of -e, use explicit error checks such as with || or &&. -- Jilles Tjoelker From owner-freebsd-rc@FreeBSD.ORG Mon Jan 30 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 E78A3106564A for ; Mon, 30 Jan 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 D420C8FC17 for ; Mon, 30 Jan 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 q0UB7lYL005519 for ; Mon, 30 Jan 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 q0UB7kgf005517 for freebsd-rc@FreeBSD.org; Mon, 30 Jan 2012 11:07:46 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 30 Jan 2012 11:07:46 GMT Message-Id: <201201301107.q0UB7kgf005517@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, 30 Jan 2012 11:07:48 -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/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 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/154554 rc [rc.d] [patch] statd and lockd fail to start 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/120431 rc [patch] devfs.rules are not initialized under certain o conf/120406 rc [devd] [patch] Handle newly attached pcm devices (eg. o conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses o conf/118255 rc savecore never finding kernel core dumps (rcorder prob o conf/117935 rc [patch] ppp fails to start at boot because of missing o conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/109562 rc [rc.d] [patch] [request] Make rc.d/devfs usable from c o conf/109272 rc [request] increase default rc shutdown timeout 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 92 problems total. From owner-freebsd-rc@FreeBSD.ORG Wed Feb 1 04:04:44 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 BFE811065672 for ; Wed, 1 Feb 2012 04:04:44 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [217.13.206.130]) by mx1.freebsd.org (Postfix) with ESMTP id 176398FC18 for ; Wed, 1 Feb 2012 04:04:43 +0000 (UTC) Received: (qmail 48126 invoked from network); 1 Feb 2012 04:07:33 -0000 Received: from elektropost.org (HELO elektropost.org) (erdgeist@erdgeist.org) by elektropost.org with CAMELLIA256-SHA encrypted SMTP; 1 Feb 2012 04:07:33 -0000 Message-ID: <4F28B9D7.4010602@erdgeist.org> Date: Wed, 01 Feb 2012 05:04:39 +0100 From: Dirk Engling User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: freebsd-rc@freebsd.org X-Enigmail-Version: 1.3.4 Content-Type: multipart/mixed; boundary="------------040100090500080408060203" Subject: Proposal ipv6_addrs_common 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, 01 Feb 2012 04:04:44 -0000 This is a multi-part message in MIME format. --------------040100090500080408060203 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Dear FreeBSD rc team, echoing Philipp Wuensches great ipv4_addrs patch I'd like to contribute the corresponding patch for v6 addresses, as their config clobbers my rc.conf considerably. The attached network6.subr is a shell script demonstrating the ipv6_addrs_common function inside, for playing around one can use some of the values the supplied get_if_var dummy function returns. The function handles one single range but allows it in any parts of the ip address, so 2002:50ed:991c-991f:50ed:c401::/64 2002:50ed:991c:50ed:c401-c409:: are both valid and work as expected. It can also parse ranges in v6mapped v4 addresses, again anywhere, so configuring a router that listens on all subnets on address .1 is possible: ::ffff:192.168.2-16.1 I would have the function called in ifn_start and ifn_stop. Feedback is very welcome. Thank you for your attention. erdgeist P.S.: Since I am not sure the .subr file will pass the mailing list filters, I copied the file to http://erdgeist.org/network6.subr --------------040100090500080408060203 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="network6.subr" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="network6.subr" #!/bin/sh get_if_var() { # echo "2002:50ed:991c:50ed:c401-c409::" # echo "2002:50ed:991c:50ed:c401-c409::c409" echo "::ffff:192.168.2-4.2/12" # echo "::ffff:192.168.2.23-25/12" # echo "::ffff:192.168.2.23/12" # echo "2002:50ed:991c:50ed:c401::" # echo "2002:50ed:991c-991f:50ed:c401::" } ipv6_addrs_common() { _ret=1 _if=$1 _action=$2 # get ipv6-addresses cidr_addr=`get_if_var $_if ipv6_addrs_IF` for _cidr in ${cidr_addr}; do _ipaddr="${_cidr%%/*}" [ "${_ipaddr}" != "${_cidr}" ] && _netmask="/"${_cidr##*/} || unset _netmask [ "$_action" = "-alias" ] && unset _netmask if [ "${_ipaddr%:*.*.*.*}" = "${_ipaddr}" ]; then _ipleft=${_ipaddr%-*} _ipright=${_ipaddr#*-} _iplow=${_ipleft##*:} _iphigh=${_ipright%%:*} _ipleft=${_ipleft%:*} _ipright=${_ipright#*:} [ "${_iphigh}" = "${_ipright}" ] && unset _ipright || _ipright=:$_ipright if [ "${_iplow}" ]; then while [ $(( 0x$_iplow )) -le $(( 0x$_iphigh )) ]; do echo ifconfig ${_if} inet6 ${_ipleft}:${_iplow}${_ipright}${_netmask} ${_action} _iplow=`printf %04x $(( 0x$_iplow + 1 ))` _ret=0 done else # no range echo ifconfig ${_if} inet6 ${_ipaddr}${_netmask} ${_action} _ret=0 fi else # v4 range _ipv6part=${_ipaddr%:*} _ipv4part=${_ipaddr##*:} _ipleft=${_ipv4part%-*} _ipright=${_ipv4part#*-} _iplow=${_ipleft##*.} _iphigh=${_ipright%%.*} _ipleft=${_ipleft%.*} _ipright=${_ipright#*.} [ "${_iphigh}" = "${_ipright}" ] && unset _ipright || _ipright=.$_ipright if [ "${_iplow}" ]; then while [ ${_iplow} -le ${_iphigh} ]; do echo ifconfig ${_if} inet6 ${_ipv6part}:${_ipleft}.${_iplow}${_ipright}${_netmask} ${_action} : $(( _iplow++ )) _ret=0 done else # no range echo ifconfig ${_if} inet6 ${_ipaddr}${_netmask} ${_action} _ret=0 fi fi done return $_ret } ipv6_addrs_common if0 alias --------------040100090500080408060203--