If I do a:

echo "foobar" > /etc/init.d/foobar
chmod 744 /etc/init.d/foobar
ln -s /etc/init.d/foobar /etc/rc.d/rc3.d/S99foobar

on a SLES 11, then when will the "foobar" command launch during boot? as the last S99? or a normal start script format would be needed for that?


The SysVinit start/stop scripts are launched in alphanumerical order according to the sorting order of the default "C" (aka POSIX) locale, so S99foobar will start after any S99[a-e]* scripts but before any S99[g-z]* scripts.

The scripts are launched by /etc/init.d/rc master script. The relevant code is essentially:

for link in /etc/rc.d/rc3.d/S[0-9][0-9]*; do
    test -x "$link" || continue

    # omitted optimization: if previous runlevel already started this service, don't start it again
    # omitted logic: if $DO_CONFIRM is set, prompt for each service
    # omitted logging

    $link start; status=$?

    # omitted status reporting/logging logic based on value of $status

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.