[lug] Apache start on boot

John Hernandez John.Hernandez at noaa.gov
Tue Aug 7 14:24:52 MDT 2001


Having administered Solaris boxes in the past, there's one crucial difference with respect to Sys-V init stuff.  Solaris will traverse the rc1.d and rc2.d directories, running all the S scripts, on its way up to run-level 3.  Then on it's way to run-level 0, it traverses them in reverse.  RedHat, on the other hand, will only run the scripts in the rc?.d directory that corresponds with your inittab initdefault entry.  That's why you see all that duplication in rc2.d, rc3.d, and rc5.d on RedHat.

So, for example, if you boot to run-level 5, put your scripts in rc5.d.

Cheers,
John


"Scott A. Herod" wrote:
> 
> Note, that if you add:
> 
> # chkconfig: 2345 08 92
> # description: My start and stop script.
> 
> (Yes it needs to be commented.)
> 
> to the start of your script in init.d, you can use chkconfig to
> automatically
> set the Start and Kill symlinks for you.  See the chkconfig man page and
> some of the existing init.d scripts.
> 
> Scott
> 
> dan radom wrote:
> >
> > here's the script i use to start apache...
> >
> > <snip>
> > #!/bin/sh
> > # dan at radom.org | modified 01.03.2001
> > case "$1" in
> >   start)
> >  echo -n "starting httpd..."
> >  /usr/local/apache/bin/apachectl start
> > ;;
> >
> >   stop)
> >  echo -n "stopping httpd..."
> >  /usr/local/apache/bin/apachectl stop
> > ;;
> >
> >   restart)
> >  echo -n "stopping httpd..."
> >         /usr/local/apache/bin/apachectl restart
> > ;;
> >
> >   fullstatus)
> >  /usr/local/apache/bin/apachectl fullstatus
> > ;;
> >
> >   status)
> >  /usr/local/apache/bin/apachectl status
> > ;;
> >
> >   graceful)
> >  /usr/local/apache/bin/apachectl graceful
> > ;;
> >
> >   configtest)
> >  /usr/local/apache/bin/apachectl configtest
> > ;;
> >
> >   help)
> >  /usr/local/apache/bin/apachectl help
> > ;;
> >
> >   *)
> >  echo "*** Usage: httpd {start|stop|restart|fullstatus|status|graceful|configtest|help}"
> >  exit 1
> > esac
> > </snip>
> >
> > the script is in init.d and symlinked to my runlevel...rc3.d
> >
> > hope this helps,
> >
> > dan
> >
> > * Chad Wasinger (cswasinger at qwest.net) wrote:
> > > Man this RH sure is different than Solaris. Ok no matter where I put this I
> > > can't get Apache httpd to start on boot.
> > > I put an S99 script in /etc/rc2.d and /etc/rc3.d and still no go, what is
> > > the trick?
> > >
> > > Thanks to everyone for the help so far!
> > >
> > > Chad
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug

-- 

  - John Hernandez - Network Engineer - 303-497-6392 -
 |  National Oceanic and Atmospheric Administration   |
 |  Mailstop R/OM12. 325 Broadway, Boulder, CO 80305  |
  ----------------------------------------------------



More information about the LUG mailing list