From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Jul 14 20:30:04 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0572C106566C for ; Wed, 14 Jul 2010 20:30:04 +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 BF5438FC15 for ; Wed, 14 Jul 2010 20:30:03 +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 o6EKU3HL090184 for ; Wed, 14 Jul 2010 20:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6EKU3EI090178; Wed, 14 Jul 2010 20:30:03 GMT (envelope-from gnats) Resent-Date: Wed, 14 Jul 2010 20:30:03 GMT Resent-Message-Id: <201007142030.o6EKU3EI090178@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, John Hein Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE7911065674 for ; Wed, 14 Jul 2010 20:24:46 +0000 (UTC) (envelope-from jhein@gossamer.timing.com) Received: from mout.perfora.net (mout.perfora.net [74.208.4.194]) by mx1.freebsd.org (Postfix) with ESMTP id BCB1D8FC14 for ; Wed, 14 Jul 2010 20:24:46 +0000 (UTC) Received: from gossamer.timing.com ([206.168.13.144]) by mrelay.perfora.net (node=mrus4) with ESMTP (Nemesis) id 0MS65a-1OfHbM3uVW-00Sqj6; Wed, 14 Jul 2010 16:24:38 -0400 Message-Id: <19518.7426.72496.859154@gossamer.timing.com> Date: Wed, 14 Jul 2010 14:24:34 -0600 From: John Hein To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: vanhu@netasq.com Subject: ports/148605: security/ipsec-tools rc.d/racoon startup script fails on boot (with racoon_create_dirs=yes and /var on mfs) X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2010 20:30:04 -0000 >Number: 148605 >Category: ports >Synopsis: security/ipsec-tools rc.d/racoon startup script fails on boot (with racoon_create_dirs=yes and /var on mfs) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 14 20:30:02 UTC 2010 >Closed-Date: >Last-Modified: >Originator: John Hein >Release: FreeBSD 5.x+ >Organization: >Environment: >Description: This is a followon for ports/117128. The fix there doesn't work on boot when the rc.d/racoon script is sourced in /etc/rc. The reason is that on 4.x startup scripts were executed on boot. In 5.x and later in run_rc_script in /etc/rc.subr, it is sourced on boot. This was not detected on my 4.x-based appliance until we updated FreeBSD (to something newer than 4.x) recently. As a result the racoon_create_dirs=NO in rc.d/racoon is not overridden by a 'yes' setting in rc.conf (because _rc_conf_loaded is true and thus load_rc_config doesn't override the NO). Also (a second problem with rc.d/racoon on 5.x+), on boot rc.d scripts are normally invoked with faststart instead of start, so the test at the end fails, too. >How-To-Repeat: - install ipsec-tools - rm -rf /var/db/racoon (or have /var on an mfs) - add to /etc/rc.conf: racoon_enable=yes racoon_create_dirs=yes rc_debug=yes - reboot Observe that you get ... /usr/local/etc/rc.d/racoon: WARNING: /var/db/racoon is not a directory. ... and racoon does not start. >Fix: 1) Don't set racoon_create_dirs=NO if it's already set. 2) Create directories on 'faststart' as well as 'start'. Index: security/ipsec-tools/files/racoon.sh.in =================================================================== RCS file: /base/FreeBSD-CVS/ports/security/ipsec-tools/files/racoon.sh.in,v retrieving revision 1.7 diff -u -p -r1.7 racoon.sh.in --- security/ipsec-tools/files/racoon.sh.in 27 Mar 2010 00:14:44 -0000 1.7 +++ security/ipsec-tools/files/racoon.sh.in 14 Jul 2010 19:30:22 -0000 @@ -17,7 +17,7 @@ # [ -z "$racoon_enable" ] && racoon_enable="NO" # Disable by default #racoon_flags="" # Flags to racoon program -racoon_create_dirs=NO # Create $required_dirs (for +racoon_create_dirs=${racoon_create_dirs:-NO} # Create $required_dirs (for # /var mfs)? . /etc/rc.subr @@ -38,7 +38,7 @@ racoon_cleanup() { } load_rc_config $name -if [ "$1" = start ] && checkyesno "${name}_create_dirs"; then +if [ "$1" = start -o "$1" = faststart ] && checkyesno "${name}_create_dirs"; then /bin/mkdir -p $required_dirs fi run_rc_command "$1" >Release-Note: >Audit-Trail: >Unformatted: