From owner-freebsd-questions@FreeBSD.ORG Sun Dec 24 03:10:20 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6601E16A412 for ; Sun, 24 Dec 2006 03:10:20 +0000 (UTC) (envelope-from msoulier@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.freebsd.org (Postfix) with ESMTP id 0188C13C448 for ; Sun, 24 Dec 2006 03:10:19 +0000 (UTC) (envelope-from msoulier@gmail.com) Received: by nf-out-0910.google.com with SMTP id x37so3715773nfc for ; Sat, 23 Dec 2006 19:10:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=iPxgWZbENMPJS08qiDIzUrnUyXqARf4UuMb2OjkxTh8iLDJ3pGCOV4aDNO6EBmE3bhW99KJP5tKMNjRCrLHb5dK6AbfBi3K65l1L4m3BsYthLQyJsW4d8PECI0ILRV4dvncqHBeO+5Iyv2A4rMhqsefXyn70OnwKyuZAM2r9cOE= Received: by 10.82.167.5 with SMTP id p5mr683293bue.1166929818924; Sat, 23 Dec 2006 19:10:18 -0800 (PST) Received: by 10.82.177.8 with HTTP; Sat, 23 Dec 2006 19:10:18 -0800 (PST) Message-ID: Date: Sat, 23 Dec 2006 22:10:18 -0500 From: "Michael P. Soulier" Sender: msoulier@gmail.com To: "Kevin Brunelle" In-Reply-To: <200612231852.56016.kruptos@mlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200612231852.56016.kruptos@mlinux.org> X-Google-Sender-Auth: 9d1c07cedab36ac1 Cc: freebsd-questions@freebsd.org Subject: Re: where are /usr/local/etc/rc.d init scripts run from? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Dec 2006 03:10:20 -0000 On 12/23/06, Kevin Brunelle 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 "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