[nycbug-talk] Script in /usr/local/etc/rc.d doesn't run

Dan Langille dan
Sat Dec 31 13:52:27 EST 2005


On 31 Dec 2005 at 13:46, Francisco Reyes wrote:

> I have one script in /usr/local/etc/rc.d that doesn't run. Any ideas why?
> It is marked as executable
> 
> ls -l /usr/local/etc/rc.d/
> -r-xr-xr-x  1 root  wheel   441B Dec 30 20:36 start-program.sh

+x and .sh extension is all that's needed AFAIK.

> 
> 
> The script is just:
> 
> #!/bin/sh
> 
> log="/var/log/program.log"

What are the permissions on that file?  Does it exist?

> echo ----------------->>$log
> /bin/date >>$log
> echo Entering program.sh >>$log
> 
> case "$1" in
>        start)
>                echo Starting program
>                echo ================= >>$log
>                echo Starting program >>$log
>                /home/root/bin/archivec.pl >> $log
>                echo beyond program call >> $log
>                ;;
>        stop)
>                echo No Stopping procedure yet
>                ;;
>        *)
>                echo Need parameter
>                echo Valid parameter: start
>                ;;
> esac
> 
> --
> All the echo are just debuggin tools.. It seems the script simply doesn't 
> run.

1 - What makes you conclude it does not run?

2 - replace the script content with something smaller: touch 
/var/run/MYFILE for example.  Then compare the timestamp on that file 
each time.

3 - What version of FreeBSD?  Perhaps you need something in 
/etc/rc.conf to allow this script to run.  I'm thinking of 
postgresql_enable="YES" for example.

-- 
Dan Langille : http://www.langille.org/
BSDCan - The Technical BSD Conference - http://www.bsdcan.org/






More information about the talk mailing list