Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Oct 2003 11:07:41 +0200 (CEST)
From:      Konrad Heuer <kheuer2@gwdg.de>
To:        RJ45 <rj45@slacknet.com>
Cc:        questions@freebsd.org
Subject:   Re: exe order in /usr/local/etc/rc.d
Message-ID:  <20031016105145.T16424@gwdu60.gwdg.de>
In-Reply-To: <Pine.LNX.4.21.0310160239500.12611-100000@slacknet.slacknet.com>
References:  <Pine.LNX.4.21.0310160239500.12611-100000@slacknet.slacknet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031016105145.T16424>