|
Home > Archive > Red Hat Topics > May 2006 > rc.local doesn't run at startup ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
rc.local doesn't run at startup ?
|
|
| McHenry 2006-05-31, 1:12 pm |
| My runlevel is 3 as specified in /etc/inittab:
id:3:initdefault:
I would like to run the fetchmail deamon at startup and have added a simple
line in rc.local to do so. When the machine boots, not mail is delivered and
if I check the processes running using "ps -ef" fetchmail is not listed.
However after bootup if I manually run /etc/rc.d/./rc.local the mail is
delivered and "ps -ef" lists the fetchmail daemon command.
[root@declan rc.d]# ls -l
total 112
drwxr-xr-x 2 root root 4096 May 26 19:59 init.d
-rwxr-xr-x 1 root root 2352 Mar 17 2004 rc
drwxr-xr-x 2 root root 4096 May 30 21:16 rc0.d
drwxr-xr-x 2 root root 4096 May 30 21:16 rc1.d
drwxr-xr-x 2 root root 4096 May 30 21:16 rc2.d
drwxr-xr-x 2 root root 4096 May 31 10:12 rc3.d
drwxr-xr-x 2 root root 4096 May 31 10:12 rc4.d
drwxr-xr-x 2 root root 4096 May 31 10:12 rc5.d
drwxr-xr-x 2 root root 4096 May 30 21:16 rc6.d
-rwxr-xr-x 1 root root 243 May 31 19:07 rc.local
-rwxr-xr-x 1 root root 27517 Mar 9 11:35 rc.sysinit
[root@declan rc.d]#
What is going on ?
| |
| Greg Hackney 2006-05-31, 1:12 pm |
| McHenry wrote:
> My runlevel is 3 as specified in /etc/inittab:
> id:3:initdefault:
>
> I would like to run the fetchmail deamon at startup and have added a simple
> line in rc.local to do so. When the machine boots, not mail is delivered and
> if I check the processes running using "ps -ef" fetchmail is not listed.
> However after bootup if I manually run /etc/rc.d/./rc.local the mail is
> delivered and "ps -ef" lists the fetchmail daemon command.
>
> [root@declan rc.d]# ls -l
> total 112
> drwxr-xr-x 2 root root 4096 May 26 19:59 init.d
> -rwxr-xr-x 1 root root 2352 Mar 17 2004 rc
> drwxr-xr-x 2 root root 4096 May 30 21:16 rc0.d
> drwxr-xr-x 2 root root 4096 May 30 21:16 rc1.d
> drwxr-xr-x 2 root root 4096 May 30 21:16 rc2.d
> drwxr-xr-x 2 root root 4096 May 31 10:12 rc3.d
> drwxr-xr-x 2 root root 4096 May 31 10:12 rc4.d
> drwxr-xr-x 2 root root 4096 May 31 10:12 rc5.d
> drwxr-xr-x 2 root root 4096 May 30 21:16 rc6.d
> -rwxr-xr-x 1 root root 243 May 31 19:07 rc.local
> -rwxr-xr-x 1 root root 27517 Mar 9 11:35 rc.sysinit
> [root@declan rc.d]#
>
>
> What is going on ?
You might try temporarily modifying the command to capture the
standard and error output, to see what it complains about. For example:
/usr/bin/fetchmail -d 900 >/tmp/fetchmmail.out 2>&1
--
Greg
| |
| Moe Trin 2006-05-31, 7:12 pm |
| On Wed, 31 May 2006, in the Usenet newsgroup comp.os.linux.redhat, in article
<447d9f34$0$7850$5a62ac22@per-qv1-newsreader-01.iinet.net.au>, McHenry wrote:
>I would like to run the fetchmail deamon at startup and have added a simple
>line in rc.local to do so. When the machine boots, not mail is delivered and
>if I check the processes running using "ps -ef" fetchmail is not listed.
>However after bootup if I manually run /etc/rc.d/./rc.local the mail is
>delivered and "ps -ef" lists the fetchmail daemon command.
Neither here, or in comp.mail.sendmail did you include the file so that one
can see your error, but the usual cause of this exact problem is not putting
the entire PATH to the command in scripts. The boot scripts are normally
executed with a limited environment (including a PATH that only has four
directories in it), which is quite different from your PATH as a user.
For an education, add the line
set > /tmp/boot.environment
to the bottom of rc.local, and after the next boot look at the contents of
that file while comparing the result of you typing the command set as root
and as the user you should be running as.
Standard advice when writing scripts is to either explicitly set the PATH
to that desired, or put the full path to each command.
Old guy
|
|
|
|
|