Scripts in /usr/local/etc/rc.d wont execute at startup

Scripts in /usr/local/etc/rc.d wont execute at startup

Post by Richard Be » Tue, 11 Jun 2002 01:04:01



Hi all!

My scripts in /usr/local/etc/rc.d wont start at startup. I can execute
them manually and they work. Ive looked att some posts that concerned
this problem but couldnt find any solution... Below is some info on my
system and one of the scripts... What can have gone wrong???

mail# uname -a
FreeBSD mail.(domain removed) 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Mon
Jan 28 14:31:56 GMT 2002    

mail# cd /usr/local/etc/rc.d/
mail# ls -l
total 8
-rwxr-x--x  1 root  wheel   407 May 22 06:23 apache2.sh
-r-xr-xr-x  1 root  wheel  5700 Jan 23 12:00 courier.sh

mail# grep local_startup /etc/rc.conf /etc/defaults/rc.conf
/etc/defaults/rc.conf:local_startup="/usr/local/etc/rc.d
/usr/X11R6/etc/rc.d"   # startup script d

mail# less apache2.sh
#!/bin/sh
PREFIX=/usr/local

case "$1" in
start)
        [ "ssl" = "ssl" -a -f "$PREFIX/etc/apache2/ssl.crt/server.crt"
] && SSL=ssl
        [ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl
start${SSL} > /dev/null && echo -n ' apache2'
        ;;
stop)
        [ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop >
/dev/null && echo -n ' apache2'
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0

 
 
 

Scripts in /usr/local/etc/rc.d wont execute at startup

Post by Richard Be » Tue, 11 Jun 2002 01:04:57


Hi all!

My scripts in /usr/local/etc/rc.d wont start at startup. I can execute
them manually and they work. Ive looked att some posts that concerned
this problem but couldnt find any solution... Below is some info on my
system and one of the scripts... What can have gone wrong???

mail# uname -a
FreeBSD mail.(domain removed) 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Mon
Jan 28 14:31:56 GMT 2002    

mail# cd /usr/local/etc/rc.d/
mail# ls -l
total 8
-rwxr-x--x  1 root  wheel   407 May 22 06:23 apache2.sh
-r-xr-xr-x  1 root  wheel  5700 Jan 23 12:00 courier.sh

mail# grep local_startup /etc/rc.conf /etc/defaults/rc.conf
/etc/defaults/rc.conf:local_startup="/usr/local/etc/rc.d
/usr/X11R6/etc/rc.d"   # startup script d

mail# less apache2.sh
#!/bin/sh
PREFIX=/usr/local

case "$1" in
start)
        [ "ssl" = "ssl" -a -f "$PREFIX/etc/apache2/ssl.crt/server.crt"
] && SSL=ssl
        [ -x ${PREFIX}/sbin/apachectl ] && ${PREFIX}/sbin/apachectl
start${SSL} > /dev/null && echo -n ' apache2'
        ;;
stop)
        [ -r /var/run/httpd.pid ] && ${PREFIX}/sbin/apachectl stop >
/dev/null && echo -n ' apache2'
        ;;
*)
        echo "Usage: `basename $0` {start|stop}" >&2
        ;;
esac

exit 0

 
 
 

Scripts in /usr/local/etc/rc.d wont execute at startup

Post by Yun Huang Yon » Tue, 11 Jun 2002 01:32:48



>Hi all!

>My scripts in /usr/local/etc/rc.d wont start at startup. I can execute
>them manually and they work. Ive looked att some posts that concerned
>this problem but couldnt find any solution... Below is some info on my
>system and one of the scripts... What can have gone wrong???

>mail# uname -a
>FreeBSD mail.(domain removed) 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Mon
>Jan 28 14:31:56 GMT 2002    

>mail# cd /usr/local/etc/rc.d/
>mail# ls -l
>total 8
>-rwxr-x--x  1 root  wheel   407 May 22 06:23 apache2.sh
>-r-xr-xr-x  1 root  wheel  5700 Jan 23 12:00 courier.sh

>mail# grep local_startup /etc/rc.conf /etc/defaults/rc.conf
>/etc/defaults/rc.conf:local_startup="/usr/local/etc/rc.d
>/usr/X11R6/etc/rc.d"   # startup script d

These seem fine and are the same as my defaults which are working.

Check that your /etc/rc isn't broken?  Seeing as you're familiar with
shell scripting it should be pretty easy to spot if it is.

Do you get "Local package initialization:" appearing on your console
at boot time?

yun

 
 
 

Scripts in /usr/local/etc/rc.d wont execute at startup

Post by Richard Be » Thu, 20 Jun 2002 10:43:25




> >Hi all!

> >My scripts in /usr/local/etc/rc.d wont start at startup. I can execute
> >them manually and they work. Ive looked att some posts that concerned
> >this problem but couldnt find any solution... Below is some info on my
> >system and one of the scripts... What can have gone wrong???

> >mail# uname -a
> >FreeBSD mail.(domain removed) 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Mon
> >Jan 28 14:31:56 GMT 2002    

> >mail# cd /usr/local/etc/rc.d/
> >mail# ls -l
> >total 8
> >-rwxr-x--x  1 root  wheel   407 May 22 06:23 apache2.sh
> >-r-xr-xr-x  1 root  wheel  5700 Jan 23 12:00 courier.sh

> >mail# grep local_startup /etc/rc.conf /etc/defaults/rc.conf
> >/etc/defaults/rc.conf:local_startup="/usr/local/etc/rc.d
> >/usr/X11R6/etc/rc.d"   # startup script d

> These seem fine and are the same as my defaults which are working.

> Check that your /etc/rc isn't broken?  Seeing as you're familiar with
> shell scripting it should be pretty easy to spot if it is.

> Do you get "Local package initialization:" appearing on your console
> at boot time?

> yun

Well, I'm not familiar with scripting... :)

Anyway, the scripts seem to run at startup:

/var/log/dmesg.today:
<snip>
Local package initialization:
 apache
 courierfilter
 authdaemond
 courierd
 generating-ESMTP-SSL-certificate...
 esmtpd
 imapd
 msql2

but no processes get started. If I then log in and run them manually
they work perfectly.... Strange, huh?

 
 
 

1. prob w/ /etc/rc.d/rc.local - wont boot

OK, I have a problem...

I added a line to /etc/rc.d/rc.local, which apparently
comtains some sort of an error. Now when I try to boot
linux - off HDD or floppy - it gets to that line and
hangs. Since I can't get at the problem file without first
booting linux, this seems to be a bit of a problem...

If anyone could tell me either (a) how to change the file
without booting linux, (b) how to bypass that file from the
boot sequence, or (c) how to crash out of the boot sequence
to a login prompt (or some such), then I'd be eternally
grateful.

Email answers preferred due to v.fast news timeout.

Cheers,
Phil

--

  _        
 |_)|_ *|
 |  | )||   http://http2.brunel.ac.uk:8080/~ee92pmh/
 ========

2. linux frozen

3. Script to create startup scripts in /etc/init.d or /etc/rc?.d

4. Can't boot

5. /usr/local/etc/rc.d - scripts not running

6. can stdout be dynamically redirected in c shell

7. script in /usr/local/etc/rc.d not working

8. /bin/top won't run anymore...

9. linux refuses to execute rc.M and other /etc/rc.d scripts

10. which user does /etc/rc.d/rc.local / rc.sysinit run as?

11. /etc/rc.local does not startup httpd

12. /etc/rc.local cannot startup my daemons.

13. /usr/local/etc/rc.d is ignored