Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rc.local not finishing

14 views
Skip to first unread message

cyber0ne

unread,
Mar 9, 2006, 5:36:52 PM3/9/06
to
I'm trying to add some services to my boot sequence, and I'm under the
impression that I can accomplish this by adding their SysV init scripts
to rc.local, right? So here is my rc.local file:

--------------------------------
#!/bin/sh
#
# /etc/rc.d/rc.local: Local system initialization script.
#
# Put any local setup commands in here:

# Start IMAP
if [ -x /etc/rc.d/rc.imap ]; then
. /etc/rc.d/rc.imap start
fi

# Start IMAP-SSL
if [ -x /etc/rc.d/rc.imaps ]; then
. /etc/rc.d/rc.imaps start
fi

# Start SpamAssassin
if [ -x /etc/rc.d/rc.spamd ]; then
. /etc/rc.d/rc.spamd
fi

# Start Authlib
if [ -x /etc/rc.d/rc.authlib ]; then
. /etc/rc.d/rc.authlib
fi

# All done.
--------------------------------

Problem is, no matter what order I put these in, only the first one
gets executed. The other three are ignored. Did I do something wrong
here that would cause the whole thing to exit once the first one is
done? How can I get all four (and subsequent future additions) to be
executed?


Regards,
David P. Donahue
ddon...@ccs.neu.edu
http://www.cyber0ne.com

Grant

unread,
Mar 9, 2006, 5:48:08 PM3/9/06
to
On 9 Mar 2006 14:36:52 -0800, "cyber0ne" <cybe...@gmail.com> wrote:

> I'm under the
>impression that I can accomplish this by adding their SysV init scripts
>to rc.local, right? So here is my rc.local file:

Take out the dots (source), you want to call other scripts, not
bring them into rc.local.

Grant.
--
Cats are smarter than dogs. You can't make eight cats pull
a sled through the snow.

Joost Kremers

unread,
Mar 9, 2006, 6:07:15 PM3/9/06
to


i had the same problem in my rc.local, and your message prompted me to do
some searching. i found my problem, and i'm guessing yours is the same: my
guess is that each of the rc scripts that you source in your rc.local ends
in 'exit 0'. the problem is that the rc scripts are *sourced*, i.e. the
commands in them are executed in the same shell as rc.local. that means
that when an exit command is encountered in one of the sourced scripts, the
shell running *rc.local* will terminate.

note that if you grep the rc scripts, you won't find that many that
actually use exit statements. and the ones that do (rc.cups is one) are
not sourced, but executed. rc.M for example has this:

#v+

if [ -x /etc/rc.d/rc.cups ]; then
# Start CUPS:
/etc/rc.d/rc.cups start
elif [ -x /etc/rc.d/rc.lprng ]; then
# Start LPRng (lpd):
. /etc/rc.d/rc.lprng start
fi

#v-

notice how rc.cups is executed, but rc.lprng is sourced?

so the solution to your problem is obviously not to source your rc scripts
in rc.local but to call them.

--
Joost Kremers joostk...@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9

cyber0ne

unread,
Mar 9, 2006, 7:20:22 PM3/9/06
to
Ah, learn something new every day. Thanks :)


-David

Vigil

unread,
Mar 15, 2006, 7:17:06 PM3/15/06
to
On Thu, 09 Mar 2006 23:07:15 +0000, Joost Kremers wrote:

> so the solution to your problem is obviously not to source your rc scripts
> in rc.local but to call them.

That's probably why I see "/bin/sh /etc/rc.d/rc.M" is the process list,
then.

--

.

0 new messages