Re: init order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 01, 2003 at 12:06:48AM -0800, Jesse Keating wrote:
> On Friday 31 January 2003 22:46, Tony Nugent uttered:
> > # for s in $(chkconfig --list | grep 3:on | cut -d\  -f1) ; do chkconfig
> > --level 5 $s on ; done
> >
> > Oh, on second thought, this might be needed first to ensure that anything
> > not set to start at runlevel 3 is also not started at runlevel 5...
> >
> > # for s in $(chkconfig --list | grep 3:off | cut -d\  -f1) ; do chkconfig
> > --level 5 $s off ; done
> 
> Most of these though won't alter what _order_ during that init phase they will 
> start.  The user had a problem becuase one service tried to start before 
> another was already running.  For that, not only do you have to set it to 
> start at a certian run level, you have to set which ORDER it starts, and 
> thats done by the preceding number to the service name in the rc#.d/ 
> directory.
 
All startup scripts live in /etc/rc.d/init.d

chkconfig is a program that maintains the symbolic links in the
/etc/rcN.d directories. These directories contain symbolic links back
into the init.d directory. These links determine what services start and
stop when starting or stopping a runlevel N.

The order that each service is started and stopped is determined by the
name given to the symbolic link. For startup the name starts with S
followed by a number and then the name of the script in init.d. So the
sorted order of all the S* symbolic links determines the startup order.

chkconfig gets the numbers in the link from a comment in the script in
init.d. So for instance, my systems mysqld script in init.d has this line
near the top:

# chkconfig: - 78 12

The three numbers are:

  -    - Sometimes the number here specifies what run levels this
         process should run at. Not sure why its used at all.
  78   - The start order number. So the S script name will be S78mysqld
  12   - The stop order number. So there will be a link called K12mysqld

The man page for chkconfig has some information of these numbers.

That's my understanding of how it works anyway.
-- 
Norman Gaywood -- School of Mathematical and Computer Sciences
University of New England, Armidale, NSW 2351, Australia
norm@turing.une.edu.au     http://turing.une.edu.au/~norm
Phone: +61 2 6773 2412     Fax: +61 2 6773 3312



-- 
Psyche-list mailing list
Psyche-list@redhat.com
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux