Chris Worth wrote:
> 
> OK gang,
> 
> I've punted my original RPM install of apache.
> 
> I recompiled a new one.  now I need the sucker to start automatically on reboot.
> 
> how do I do that?  and more to the point.  where do I ever learn how this whole 
>init.d
> thing works?  I think I'll feel so enlightened when I understand this.
> 
> thanks,
> 
> chris
> 

Actually Chris there's nothing magical about it once you see it
done...

First, look in /etc/rc.d/init.d and you'll see a bunch of scripts. 
more (or less) any one of them and you'll see they all have the same
format.  If the one you need for Apache isn't already there
(/etc/rc.d/init.d/httpd) then create it, using any of the other
scripts as a template.  Be sure to do a chmod +x on the script!  If
you look at any of them you'll notice that they all at least take a
parameter of 'start' and 'stop' --  In the case statement put the
commands to start your service under the start) section and the
commands to stop the service under the stop) section.

Now, to get it started on boot.  In the directory /etc/rc.d you'll see
the directories rc0.d through rc6.d.  These all represent the various
run levels.  Assuming that you're using run level 3 (console logon
instead of GUI) go to the directory rc3.d  -- this one contains the
scripts used when starting up in level 3.   

If you do an 'ls' of this directory you'll find a some scripts named
K##something and S##something.  They all are symlinks back to scripts
in /etc/rc.d/init.d and are called during startup or shutdown.  The S
is for start and the K is for kill. 

To start a service, create a symlink that starts with S that points
back to the script you created in /etc/rc.d/init.d.  The two digits
that follow the S are used to order the execution of the scripts. 
During startup each S* script will be called with a parameter of
'start', so this calls the associated script in /etc/rc.d/init.d.

If you want to do shutdown processing, do the same thing as before but
use a 'K' prefix.  The associated script will be called with a
parameter of 'stop'.

If you're planning to start up in X, you'd duplicate these links in
the /etc/rc.d/rc5.d directory.

I find this whole thing a fairly elegant way to structure system
startup and shutdown.

Best regards,
 

Barry



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to