From owner-freebsd-questions@FreeBSD.ORG Thu Oct 16 02:07:45 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E49CA16A4B3 for ; Thu, 16 Oct 2003 02:07:45 -0700 (PDT) Received: from gwdu60.gwdg.de (gwdu60.gwdg.de [134.76.8.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5738B43FD7 for ; Thu, 16 Oct 2003 02:07:44 -0700 (PDT) (envelope-from kheuer2@gwdg.de) Received: from gwdu60.gwdg.de (localhost [127.0.0.1]) by gwdu60.gwdg.de (8.12.8p1/8.12.8) with ESMTP id h9G97gcq043584; Thu, 16 Oct 2003 11:07:42 +0200 (CEST) (envelope-from kheuer2@gwdg.de) Received: from localhost (kheuer2@localhost)h9G97f49043581; Thu, 16 Oct 2003 11:07:42 +0200 (CEST) X-Authentication-Warning: gwdu60.gwdg.de: kheuer2 owned process doing -bs Date: Thu, 16 Oct 2003 11:07:41 +0200 (CEST) From: Konrad Heuer To: RJ45 In-Reply-To: Message-ID: <20031016105145.T16424@gwdu60.gwdg.de> References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: questions@freebsd.org Subject: Re: exe order in /usr/local/etc/rc.d X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Oct 2003 09:07:46 -0000 On Thu, 16 Oct 2003, RJ45 wrote: > I have never understood in which order are execurted the scripts which are > in /usr/local/etc/rc.d > > most port applications like mysqld, cyrus-imapd, spamd etc. put their > startup scripts into /usr/local/etc/rc.d but they are not ordered by a > number attached before the script name (like the Unix SysV style) > > anyone has some hint about this ? > How can I Set the startup order into /usr/local/etc/rc.d The scripts are started from /etc/rc; the code fragement looks like: for dir in ${local_startup}; do if [ -d "${dir}" ]; then for script in ${dir}/*.sh; do slist="${slist}${script_name_sep}${script}" done fi done script_save_sep="$IFS" IFS="${script_name_sep}" for script in ${slist}; do if [ -x "${script}" ]; then (set -T trap 'exit 1' 2 ${script} start) elif [ -f "${script}" -o -L "${script}" ]; then echo -n " (skipping ${script##*/}, not executable)" fi done IFS="${script_save_sep}" echo '.' Thus the scripts are executed in alphabetic order. Regards Konrad Heuer (kheuer2@gwdg.de) ____ ___ _______ GWDG / __/______ ___ / _ )/ __/ _ \ Am Fassberg / _// __/ -_) -_) _ |\ \/ // / 37077 Goettingen /_/ /_/ \__/\__/____/___/____/ Germany