From owner-freebsd-questions@FreeBSD.ORG Sat May 15 06:44:35 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B025B1065672 for ; Sat, 15 May 2010 06:44:35 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 713908FC12 for ; Sat, 15 May 2010 06:44:35 +0000 (UTC) Received: from r55.edvax.de (port-92-195-11-18.dynamic.qsc.de [92.195.11.18]) by mx02.qsc.de (Postfix) with ESMTP id DE8DD253F4; Sat, 15 May 2010 08:44:33 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id o4F6iWtt001415; Sat, 15 May 2010 08:44:33 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 15 May 2010 08:44:32 +0200 From: Polytropon To: umage Message-Id: <20100515084432.36a8812f.freebsd@edvax.de> In-Reply-To: <4BEDEBC6.5000505@gmail.com> References: <4BEDEBC6.5000505@gmail.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: ipfw natd rules not loading on startup X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 May 2010 06:44:35 -0000 Just a sidenote: On Sat, 15 May 2010 02:33:10 +0200, umage wrote: > However, if I > run the script manually, or call it from the end of /etc/rc, it will add > these rules as well. Currently I am using a workaround. It's not a good idea to modify /etc/rc. In your case, using the mechanism s of /etc/rc(.shutdown).local is a good way to call scripts that do not fit the rc.d concept. See "man rc.local" for details. So I would suggest something for /etc/rc.local like this: #!/bin/sh if [ -z "${source_rc_confs_defined}" ]; then if [ -r /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs elif [ -r /etc/rc.conf ]; then . /etc/rc.conf elif [ -r /etc/rc.conf.local ]; then . /etc/rc.conf.local fi fi echo -n " custom-firewall" /your/firewall/script.sh --here The final dot + newline in the messages will be added by rc, if I remember correctly. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...