rc script not running at boot time

James D. Parra jamesp at musicreports.com
Thu Aug 26 19:47:40 UTC 2010



From: James D. Parra Sent: August 26, 2010 11:46
> 
> However, upon reboot the service does not start.

Hi James:

I have encounter the same problem and here is what I have done:

1. Add the following lines to the top of you script file:

   # chkconfig:    235 99 01          
   # description:  what ever you want here

2. Run chkconfig to "add" the script:

   chkconfig  --add /etc/rc.d/rc3.d/S50pgstartstop

A Google search on chkconfig should supply you with the reasoning
behind this (much more eloquently than I can).

You might also want to add the following line to your script file:

  touch /var/lock/subsys/S50pgstartstop

IIRC this was required in order to the shutdown to work correctly.

HTH

Regards, Hugh
~~~~~~~

Many thanks Hugh.  Added the above lines to the script and tried to the following;
 chkconfig --add /etc/rc.d/rc3.d/S50pgstartstop
error reading information on service S50pgstartstop: No such file or directory
<snip>

[root at ip-10-161-99-142 ~]# ls -l /etc/rc.d/rc3.d/S50pgstartstop
lrwxrwxrwx 1 root root 23 Aug 26 13:28 /etc/rc.d/rc3.d/S50pgstartstop -> /etc/init.d/pgstartstop
<snip>

The script:
#! /bin/sh
# chkconfig: 235 99 01
# description: pgstart & stop
touch /var/lock/subsys/S50pgstartstop
case "$1" in
start) /usr/bin/pgstart ;;
stop) /usr/bin/pgstop ;;
restart) /bin/sh $0 stop
/bin/sh $0 start ;;
*) echo "Usage: $0 {start|stop}"
exit 1;;
esac
<snip>


The file is there. Any clue as to how I can fix this?

Again, many thanks.

James





More information about the redhat-list mailing list