[lug] Apache start on boot

Riggs, Rob RRiggs at doubleclick.net
Tue Aug 7 15:11:32 MDT 2001


The chkconfig magic that Scott was explaining does all that for you.

Chkconfig installs the "S" (or start) symlinks and the "K" (or kill)
symlinks in the appropriate init directories. Red Hat runs through all of
the "K" symlinks, then all of the "S" symlinks when it enters a runlevel, in
the order of the filenames. In this case the startup link would be
"S08httpd" and "K92httpd". 

-----Original Message-----
From: John Hernandez [mailto:John.Hernandez at noaa.gov]
Sent: Tuesday, August 07, 2001 2:25 PM
To: lug at lug.boulder.co.us
Subject: Re: [lug] Apache start on boot


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  |
  ----------------------------------------------------
_______________________________________________
Web Page:  http://lug.boulder.co.us
Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list