Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Dec 2006 22:10:18 -0500
From:      "Michael P. Soulier" <msoulier@digitaltorque.ca>
To:        "Kevin Brunelle" <kruptos@mlinux.org>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: where are /usr/local/etc/rc.d init scripts run from?
Message-ID:  <fb6605670612231910ne62800alcf9ee76fe1f52c45@mail.gmail.com>
In-Reply-To: <200612231852.56016.kruptos@mlinux.org>
References:  <fb6605670612231515v7f05acdbxc0bebf5e009fd6ff@mail.gmail.com> <200612231852.56016.kruptos@mlinux.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 12/23/06, Kevin Brunelle <kruptos@mlinux.org> wrote:
> They are called from /etc/rc.d/localpkg if they are the old style.
>
> The directories searched are defined with local_startup (which defaults
> to: /usr/local/etc/rc.d /usr/X11R6/etc/rc.d).

Ok, looking in localpkg, I see this.

pkg_start()
{
    # For each dir in $local_startup, search for init scripts matching *.sh
    #
    case ${local_startup} in
    [Nn][Oo] | '')
        ;;
    *)
        echo -n 'Local package initialization:'
        slist=""
        if [ -z "${script_name_sep}" ]; then
            script_name_sep=" "
        fi
        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 '.'
        ;;
    esac
}

So rcorder is not used for the rc scripts in /usr/local/etc/rc.d? That
explains much, since I have a runsvstat.sh script needed to start
runit, and a script to start one of its services starts with an 'm'
and is executing first, which I don't want.

Why is rcorder not used on these files as well? It's such a good system.

> The new style scripts are found in /etc/rc as well.  You may want to look at
> the find_local_scripts_new() function in /etc/rc.subr to see how some of this
> functions.  There is some trickery here because we have to do this in more
> than one step.  Since /usr/local/etc/rc.d/ may not be on a mounted filesystem
> until we run through some of the earlier scripts.

Ok, thanks.

Mike
-- 
Michael P. Soulier <msoulier@digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?fb6605670612231910ne62800alcf9ee76fe1f52c45>