The `runlevelconf' package contains several scripts, all with the
prefix `rlc-'.  All the scripts use the program `tree', which has to
be in $PATH. All the scripts source the file
$RUNLEVELCONF/rlc.functions.

This manual contains the description of the following programs:

rlc-help
rlc-add
rlc-check
rlc-cons
rlc-doit
rlc-go
rlc-list
rlc-parlist
rlc-parshow
rlc-remove
rlc-show
rlc-sub

Common syntax
*************

With the exception of rlc-help, rlc-cons, and rlc-go, you need to
specify to the script, via a directive, which tree you want to access.
This directive is always the first argument, and it has to be of the
form runlevel's' or runlevel'k'. For example,

rlc-add 3s qmail

says that rlc-add will add `qmail' to the the start tree for runlevel 3.  Or 

rlc-show 5k

says, show the stop(kill) tree for runlevel 5.

Apart from checking that the directive ends with `s' or `k', the
scripts also check if the runlevel you specify are from the list
$RUNLEVEL_LIST, which you had the option to modify during
installation.   

In case rlc-cons and rlc-go, you just need to specify the
runlevel, as in 

rlc-go 3

but you get the same behavior if you specify a "full" directive, such
as

rlc-go 3s

Both the start and the stop trees are to reflect *run* dependence of
services. This means that if you have 

rlc-show 3s ypserv
ypserv
    `-- ypbind 

meaning ypbind needs ypserv to run (this is the case on a YP server) ,
then you probably also have something like

rlc-show 6k ypserv
ypserv
    `-- ypbind

--assuming 6 is the "halt" runlevel.

This assumption makes a difference is rlc-doit's behavior, since it
will make a schedule that would indicate to start ypserv before ypbind
at runlevel 3, but stop ypserv after ypbind at runlevel 6.

********
rlc-help  
********

Tells you the syntax of all the scripts.  Presently, the output is

rlc-add runlevel(s|k) service [depend...]
rlc-check runlevel(s|k) service [service...]
rlc-cons runlevel[s|k]
rlc-doit runlevel(s|k)
rlc-go runlevel[s|k]
rlc-list runlevel(s|k) [service]
rlc-parlist runlevel(s|k) service
rlc-parshow runlevel(s|k) service
rlc-remove runlevel(s|k) [service]
rlc-show runlevel(s|k) [service]
rlc-sub runlevel(s|k) oldservice newservice

If you want an output specific to a directive, you can do something like

rlc-help 3s

to get

rlc-add 3s service [depend...]
rlc-check 3s service [service...]
rlc-cons 3s
rlc-doit 3s
rlc-go 3s
rlc-list 3s [service]
rlc-parlist 3s service
rlc-parshow 3s service
rlc-remove 3s [service]
rlc-show 3s [service]
rlc-sub 3s oldservice newservice

You are also displayed a script specific help, if you mess up the
syntax.  For example,

# rlc-add
rlc-add: Usage
rlc-add runlevel(s|k) service [depend...]

or 

# rlc-add 3s
rlc-add: Usage
rlc-add 3s service [depend...]

*******
rlc-add  
*******

Adds a service to a runlevel's start/stop tree.  

Syntax:

rlc-add runlevel(s|k) service [depend...]

For example, 

rlc-add 3s ypbind ypserv network syslog

says "add `ypbind' to the start tree of runlevel 3, and note that it
depends on `ypserv', `network', and `syslog'".  

If a service is  not to depend on any other service, you do, for
example,

rlc-add 3s network

The script rlc-add is trying to build an as small tree as possible.
For example, if you have 

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
`-- syslog
    |-- qmail
    `-- ypserv

then the commands

rlc-add 3s ypbind ypserv
rlc-add 3s ypbind ypserv network
rlc-add 3s ypbind ypserv network syslog

all yield the same tree:

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind

*********
rlc-check
*********

Checks if the given services are in the start/stop tree of a runlevel

Syntax:

rlc-check runlevel(s|k) service [service...]

For example, if the `3s' tree is

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind 

then you get 

rlc-check 3s ypbind okidoki
ypbind is already added
okidoki is not yet added

********
rlc-cons
********

Checks the consistency of the start and stop trees of a runlevel.
This just means that you get a list of the services appearing in both
the start and stop tree.

Syntax:

rlc-cons runlevel[s|k]

For example, if you have

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind

and 

3k
|-- nfs
|   `-- netfs
|-- qpop3d
|   |-- ldap
|   `-- qmqpd
`-- ypserv
    `-- ypbind

then you would get

# rlc-cons 3 
Runlevel 3 is not consistent;
common services in 3s and 3k:
ypbind
ypserv

********
rlc-doit
********

Creates the schedule for a start/stop tree of a runlevel.  The
schedule is put in a directory under $RUNLEVELCONF.

Syntax:

rlc-doit runlevel(s|k)

For example, if the `3s' tree is

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind 

then 

rlc-doit 3s

will create the directory $RUNLEVELCONF/3s-schedule for the start tree
of runlevel 3 with the files

cat 3s-schedule/1
network
syslog

cat 3s-schedule/2
qmail
qsmtpd
ypserv

cat 3s-schedule/3
ypbind

In case of a stop tree, the scheduling gets reversed. For example, if you have 

3k
|-- netfs
|   |-- nfs
|   `-- sendmail
`-- slapd
    `-- slurpd

then 

rlc-doit 3k

will create the directory $RUNLEVELCONF/3k-schedule for the stop tree
of runlevel 3 with the files


# cat 3k-schedule/1
nfs
sendmail
slurpd

# cat 3k-schedule/2
netfs
slapd


******
rlc-go
******

Reading `$RUNLEVELCONF/runlevel.current', the list of currently running
services, and the start and stop schedules of a runlevel, it produces
`$RUNLEVELCONF/runlevel.start' and `$RUNLEVELCONF/runlevel.stop'.

The file `runlevel.start' contains the list of services to start at
`runlevel'. The order the services appear in `runlevel.start'
correspond to the order the services appear in
`runlevel(s)-schedule'.  Services that are in `runlevel(s)-schedule/1'
are listed first in `runlevel.start', then the services in
`runlevel(s)-schedule/2', etc.

Services that are in both `runlevel.current' and in
`runlevel(s)-schedule' will not be in `runlevel.start'

The file `runlevel.stop' contains the list of services to stop at
`runlevel'. The order the services appear in `runlevel.stop'
correspond to the order the services appear in `runlevel(k)-schedule'.
Services that are in `runlevel(k)-schedule/1' are listed first in
`runlevel.stop', then the services in `runlevel(k)-schedule/2', etc.
If there are services in `runlevel.current' which do not appear in any
of the files `runlevel(k)-schedule/*', they are listed last in
`runlevel.stop'.

If a service is both in a file  under `runlevel(k)-schedule/' and
`runlevel(s)-schedule/', then the service will not appear in
`runlevel.stop'.

Syntax:

rlc-go runlevel[s|k]

For example, suppose you have 

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind

hence

# cat 3s-schedule/1
network
syslog

# cat 3s-schedule/2
qmail
qsmtpd
ypserv

# cat 3s-schedule/3
ypbind

and  


3k
|-- netfs
|   |-- nfs
|   `-- sendmail
`-- slapd
    `-- slurpd

hence 

# cat 3k-schedule/1
nfs
sendmail
slurpd

# cat 3k-schedule/2
netfs
slapd

Now assume 

# cat 3.current
qmail
netfs
slurpd
slapd
routed
gpm


Then 

rlc-go 3

produces the following:

# cat 3.stop 
slurpd
netfs
slapd
gpm
routed

and

# cat 3.start
network
syslog
qsmtpd
ypserv
ypbind

********
rlc-list
********

Lists all the services that depend on `service' in the start/stop tree
of a runlevel.  If `service' is not specified, lists all services in
the tree.

Syntax:

rlc-list runlevel(s|k) [service]

For example, if the `3s' tree is

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind 

then you get

rlc-list 3s syslog
Services depending on syslog:
qmail
ypbind
ypserv

and

rlc-list 3s       
3s:
network
qmail
qsmtpd
syslog
ypbind
ypserv


***********
rlc-parlist
***********

Lists the parents of `service' in the start/stop tree of a runlevel.

Syntax:

rlc-parlist runlevel(s|k) service

For example, if the `3s' tree is

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind 

then you get

rlc-parlist 3s ypbind
Parents of ypbind:
network
syslog
ypserv

***********
rlc-parshow
***********

Shows `service' and its parents in the start/stop tree of a runlevel.

Syntax:

rlc-parshow runlevel(s|k) service

For example, if the `3s' tree is

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind 

then you get

rlc-parshow 3s ypbind
3s-ypbind
|-- network
|   `-- ypserv
|       `-- ypbind
`-- syslog
    `-- ypserv
        `-- ypbind


**********
rlc-remove
**********

Removes `service' and all its children from the start/stop tree of a
runlevel.  If `service' is not specified, removes the whole tree, but
first prompts for approval.

Syntax:

rlc-remove runlevel(s|k) [service]

For example, if the `3s' tree is

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind

then after

rlc-remove 3s syslog

you are left with

3s
`-- network
    `-- qsmtpd

********
rlc-show
********

Shows the tree of the children of `service' in the start/stop tree of
a runlevel.  If `service' is not specified, shows the whole start/stop
tree of the runlevel.

Syntax:

rlc-show runlevel(s|k) [service]

For example, if the `3s' tree is

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind

then you get

rlc-show 3s syslog
syslog
|-- qmail
`-- ypserv
    `-- ypbind


*******
rlc-sub
*******

Replaces one service by another everywhere in the start/stop tree of a
runlevel.  Useful if you mistyped the name of a service.

Syntax:

rlc-sub runlevel(s|k) oldservice newservice

For example, 


if the `3s' tree is

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qnail
    `-- ypserv
        `-- ypbind

then after

rlc-sub 3s qnail qmail

you get 

3s
|-- network
|   |-- qsmtpd
|   `-- ypserv
|       `-- ypbind
`-- syslog
    |-- qmail
    `-- ypserv
        `-- ypbind

