From owner-freebsd-rc@FreeBSD.ORG Mon Jul 12 11:07:08 2010 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 188A41065679 for ; Mon, 12 Jul 2010 11:07:08 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id F10458FC12 for ; Mon, 12 Jul 2010 11:07:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6CB77Yl094120 for ; Mon, 12 Jul 2010 11:07:07 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6CB77Ah094118 for freebsd-rc@FreeBSD.org; Mon, 12 Jul 2010 11:07:07 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 12 Jul 2010 11:07:07 GMT Message-Id: <201007121107.o6CB77Ah094118@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, 12 Jul 2010 11:07:08 -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/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/145440 rc [rc.d] [patch] add multiple fib support (setfib) in /e o conf/145399 rc [patch] rc.d scripts are unable to start/stop programs o conf/145344 rc [patch] Fix kitchen sink approach for rc.d scripts ins 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/143084 rc [jail] [patch]: fix rc.d/jail creating stray softlinks o conf/142973 rc [jail] [patch] Strange counter init value in jail rc o conf/142434 rc [patch] Add cpuset(1) support to rc.subr(8) o conf/142304 rc rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack e o conf/141909 rc rc.subr(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/136875 rc [request] _flags appending o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/135338 rc [rc.d] pf startup order seems broken [regression] o conf/134918 rc [patch] rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/134006 rc [patch] Unload console screensaver kernel modules if s o conf/133987 rc [rc.d] defaultroute broken with DHCP in some cases o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/132483 rc rc.subr(8) [patch] setfib(1) support for rc.subr o conf/132476 rc [rc.d] [patch] add support setfib(1) in rc.d/routing o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/127917 rc [patch] dumpon rejects on start with physmem>swap even o bin/126562 rc rcorder(8) fails to run unrelated startup scripts when o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped 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/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/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p o conf/105689 rc [ppp] [request] syslogd starts too late at boot o conf/105568 rc [patch] [request] Add more flexibility to rc.conf, to o conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/56934 rc [patch] rc.firewall rules for natd expect an interface o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/44170 rc [patch] Add ability to run multiple pppoed(8) on start 82 problems total. From owner-freebsd-rc@FreeBSD.ORG Fri Jul 16 16:22:08 2010 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A99571065672; Fri, 16 Jul 2010 16:22:08 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4648FC08; Fri, 16 Jul 2010 16:22:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6GGM8aL012919; Fri, 16 Jul 2010 16:22:08 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6GGM8tY012915; Fri, 16 Jul 2010 16:22:08 GMT (envelope-from linimon) Date: Fri, 16 Jul 2010 16:22:08 GMT Message-Id: <201007161622.o6GGM8tY012915@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: conf/148656: rc.firewall(8): {oip} and {iip} variables in rc.firewall script undefined in FreeBSD 7.2 and 8.0 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, 16 Jul 2010 16:22:08 -0000 Old Synopsis: {oip} and {iip} variables in rc.firewall script undefined in FreeBSD 7.2 and 8.0 New Synopsis: rc.firewall(8): {oip} and {iip} variables in rc.firewall script undefined in FreeBSD 7.2 and 8.0 Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: linimon Responsible-Changed-When: Fri Jul 16 16:21:32 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=148656 From owner-freebsd-rc@FreeBSD.ORG Sat Jul 17 10:56:59 2010 Return-Path: Delivered-To: rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B23011065676; Sat, 17 Jul 2010 10:56:59 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 35EED8FC0C; Sat, 17 Jul 2010 10:56:59 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 2F0E82A28CE6; Sat, 17 Jul 2010 12:56:58 +0200 (CEST) Date: Sat, 17 Jul 2010 12:56:58 +0200 From: Ed Schouten To: ports@FreeBSD.org Message-ID: <20100717105658.GV1742@hoeg.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m+Z5/NEwv9nnRDo7" Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: rc@FreeBSD.org Subject: General note on rc scripts and daemonizing 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, 17 Jul 2010 10:56:59 -0000 --m+Z5/NEwv9nnRDo7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello port maintainers, I think I'd better send an email about this to ports@, because I've seen it in various places and it is getting a bit tiresome to mail all port authors individually. I've seen various cases in the past where people write rc scripts that do the following: command=3D"/usr/local/bin/dog" command_args=3D"--bark > /dev/null 2>&1 &" So in this case `dog --bark' doesn't daemonize itself, so the & is sufficient here, right? Well, it is not. :-) The point is that we simply tell the kernel to redirect stdout/stderr and run it in the background. It doesn't tell the kernel that the process should run in a separate session (see getsid(2)/setsid(2)). This has various implications. The most important one I can think of, is that the daemon can still do open("/dev/tty", ...) if it wants and spam your TTY, even if the daemon is running as user `nobody'. This also means that if you run the rc script from within a pseudo-terminal, it can never actually destroy the pseudo-terminal for you, because maybe the daemon is interested in using it. Below is the output of `pstat -t' on one of my systems, where I decided to fire up MySQL: | LINE INQ CAN LIN LOW OUTQ USE LOW COL SESS PGID STATE | ... | pts/11 0 0 0 0 0 0 0 0 82711 0 G The kernel actually wants to clean up this pseudo-terminal (state =3D G), but it is prevented from doing so. It will only clean it up by the time MySQL is shut down. So how can this be solved? We already have a tool in base called daemon(8). It is simply a wrapper around daemon(3) (which calls setsid(2), which you can use to daemonize processes. So the next time you write an rc script and need to daemonize something which cannot do it by itself, please think of the kittens. ;-) [ CCing this to rc@. Maybe we should add some kind of built-in functionality to call daemon(8)? ] --=20 Ed Schouten WWW: http://80386.nl/ --m+Z5/NEwv9nnRDo7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iEYEARECAAYFAkxBjHoACgkQ52SDGA2eCwW9eACePfuAF5ru1p/VB0hOdtBhCXzD GooAnjOnQln6tR2XRY93kWnlG0OEL6HA =uzUz -----END PGP SIGNATURE----- --m+Z5/NEwv9nnRDo7-- From owner-freebsd-rc@FreeBSD.ORG Sat Jul 17 23:10:01 2010 Return-Path: Delivered-To: rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 350F9106566B for ; Sat, 17 Jul 2010 23:10:01 +0000 (UTC) (envelope-from jhellenthal@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id E32EE8FC1B for ; Sat, 17 Jul 2010 23:10:00 +0000 (UTC) Received: by iwn35 with SMTP id 35so4236425iwn.13 for ; Sat, 17 Jul 2010 16:10:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:cc :subject:in-reply-to:message-id:references:user-agent :x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; bh=acYRNXgtgKTOidiLZ/b9lPms7A3qKG4AwOHyeB9mc6U=; b=YLITH9SgU2XdTSYXplQw9jTyDbYaJsYjN/u14FcJJhOw2+O/50Cb9cmMz6RoTJT2DP vxVlVX6oTwEW/viZPBJ108h3Q1c8wh3b/kjSH59ro0SF1rpUPAep8yvTAnTHmVqDEjS9 YRVCSa1ISnUQWELmHs0iJjJfLpbPw6rwqBdy8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:x-openpgp-key-id:x-openpgp-key-fingerprint:mime-version :content-type; b=epzTnkHK0qkwaItbVwVAGbKFc8jRD9cDsS6KOM2bsrhucbK407nZjeIVksj9TzOpAb Mgi4GGjrVAw/L8jX49umaqQUeUWSG3pW/Y+ytsUnKmw5+gHwaOehHpUxuchmoovgoup9 40BOL0zk4gJjjQwDXZCxo/7t+bTganKIODDPk= Received: by 10.231.79.212 with SMTP id q20mr3088629ibk.103.1279406594940; Sat, 17 Jul 2010 15:43:14 -0700 (PDT) Received: from centel.dataix.local ([99.181.132.254]) by mx.google.com with ESMTPS id g31sm16800368ibh.16.2010.07.17.15.43.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 17 Jul 2010 15:43:14 -0700 (PDT) Sender: "J. Hellenthal" Date: Sat, 17 Jul 2010 18:43:07 -0400 From: jhell To: Ed Schouten In-Reply-To: <20100717105658.GV1742@hoeg.nl> Message-ID: References: <20100717105658.GV1742@hoeg.nl> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-OpenPGP-Key-Id: 0x89D8547E X-OpenPGP-Key-Fingerprint: 85EF E26B 07BB 3777 76BE B12A 9057 8789 89D8 547E MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: ports@freebsd.org, rc@freebsd.org Subject: Re: General note on rc scripts and daemonizing 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, 17 Jul 2010 23:10:01 -0000 On Sat, 17 Jul 2010 06:56, Ed Schouten wrote: In Message-Id: <20100717105658.GV1742@hoeg.nl> > Hello port maintainers, > > I think I'd better send an email about this to ports@, because I've seen > it in various places and it is getting a bit tiresome to mail all port > authors individually. > > I've seen various cases in the past where people write rc scripts that > do the following: > > command="/usr/local/bin/dog" > command_args="--bark > /dev/null 2>&1 &" > > So in this case `dog --bark' doesn't daemonize itself, so the & is > sufficient here, right? Well, it is not. :-) The point is that we simply > tell the kernel to redirect stdout/stderr and run it in the background. > It doesn't tell the kernel that the process should run in a separate > session (see getsid(2)/setsid(2)). > > This has various implications. The most important one I can think of, is > that the daemon can still do open("/dev/tty", ...) if it wants and spam > your TTY, even if the daemon is running as user `nobody'. This also > means that if you run the rc script from within a pseudo-terminal, it > can never actually destroy the pseudo-terminal for you, because maybe > the daemon is interested in using it. > > Below is the output of `pstat -t' on one of my systems, where I decided > to fire up MySQL: > > | LINE INQ CAN LIN LOW OUTQ USE LOW COL SESS PGID STATE > | ... > | pts/11 0 0 0 0 0 0 0 0 82711 0 G > > The kernel actually wants to clean up this pseudo-terminal (state = G), > but it is prevented from doing so. It will only clean it up by the time > MySQL is shut down. > > So how can this be solved? We already have a tool in base called > daemon(8). It is simply a wrapper around daemon(3) (which calls > setsid(2), which you can use to daemonize processes. So the next time > you write an rc script and need to daemonize something which cannot do > it by itself, please think of the kittens. ;-) > > [ CCing this to rc@. Maybe we should add some kind of built-in > functionality to call daemon(8)? ] > Hi Ed, Very nice note as well a very good practice. I have noticed this for a while but never looked into it more so I could not really put a name to it. Thanks. Off topic of ports: While this subject is hot, I have been doing the following on an updated system, current version of xterm on two up-to-date stable/8 machines. I am having trouble narrowing down the cause of the controlling pseudo terminal freezing until ^C is hit after using daemon(1) to spawn ssh in the background to start a remote xterm. # Open a pseudo terminal [pts/13] xterm (the culprit) # Mix up the terminal a little so its not so fresh. [pts/13] ls -l # Use daemon to start a remote xterm through ssh. [pts/13] daemon ssh -M remotehost xterm At this stage the remote x11 forwarded xterm opens and works properly "set this terminal aside, its not the problem". # On the originating pseudo terminal [pts/13] su - Password: ********** host# _ After that you should have to hit ^C to proceed to the next bang line or enter anything for that matter. Any clue at what might be going on or any more information that I could provide to help deduce this ?. Regards, -- jhell,v