NAME

lcfg-boot - LCFG boot component

DESCRIPTION

The boot component manages which LCFG components and SystemV init scripts are started or stopped when the system moves from one run level to another (eg boot time, shutdown etc).

It has three main functions :-

Both LCFG components and SystemV init scripts are managed; for brevity, this document refers to services to refer to the union of these.

Services stop/start

The boot component recalculates which services (LCFG components and init scripts) should be started or stopped at one of two events :-

The resource list boot.services is evaluated to determine which services should be running at the target run level. Each service has an associated resource boot.levels_service which is a list of the run levels that this service should be active in.

The component now produces an ordered list of services which shouldn't be running in the target run level and require stopped. Each service has an associated resource boot.stop_service which indicates two things. Firstly it indicates the service's stop priority level. This is similar to the familiar SystemV rc priority levels; services with lower priority levels are stopped before those with higher priority levels. The priority level can also take the value NO which indicates that the service should never be stopped at a transition (used for services which are only ever started). The resource also indicates whether the service should be stopped for this event (restart and/or configure). The majority of services will only specify the restart event; ie the service will only be stopped at a runlevel transition. The use of the configure event is described later. A default value for boot.stop_service is 0 restart; this indicates that the priority is 0 and that the component should only be stopped at a runlevel transition. Having produced this list, the component stops the services in priority order.

The component now produces an ordered list of services which aren't already running but should now be in the target run level. Each service has an associated resource boot.start_service which has similar syntax and meaning to the boot.stop_service resource. The only difference is that services with a start priority of 100 or above are not started if a previous service has requested a reboot.

Once all necessary services are stopped or started, the component checks to see if any service has requested a reboot (by use of the standard LCFG RequestBoot macro); if so, the component will schedule an immediate reboot. Only services with a boot.reboot_service resource value including the current event type are checked; the default value for this resource is restart which indicates that this component should only be able to trigger a reboot at a runlevel transitition.

Run method

The boot component's run method is used to call a specified method, usually run, of certain LCFG components to perform, typically, some routine maintenance function. It is normally called nightly (via cron). It does not support SystemV scripts.

The resource boot.run is the list of components to be called. Each LCFG component on this list has an associated boot.user_component and boot.runmethod_component resource. The first resource indicates which userid to use to call the component; the default value is root. The second resource indicates which method to call of the component; the default value is run.

This method can also be used to call arbitrary shell commands. If an element of the boot.run list has an associated resource boot.type_component of direct, the associated boot.runmethod_component resource specifies a shell command to be executed.

Once all the specified components have been called, the boot component performs the same reboot check as it does when starting/stopping services. Adding the value run to a component's boot.reboot_service resource will allow that component to trigger a reboot.

Suspend/Resume

The boot component's suspend method will call the suspend method of those LCFG components listed in the resource boot.suspend, in the order as specified in the resource. The resume method will call the resume methods of the same components, but in reverse order.

Configure event - what for ?

Normally new services which are added to the boot.services resource are not started until the next runlevel transition ( usually boot time). Sometimes, however, it is useful to start a service as soon as it has been added to the boot.services resource. This can be achieved by adding the value configure to the service's boot.start_service resource. Similarily, adding this value to the service's boot.stop_service resource will result in the service being stopped as soon as it is removed from the boot.services list.

Adding the value configure to a service's boot.reboot_service will result in that service being able to trigger a reboot if it has been started or stopped as a result of a configure event.

RESOURCES

Services stop/start

services

List of services (LCFG components and SystemV scripts) to be managed by the component.

levels_service

The run levels in which this service should be running.

start_service

The start priority level for this service. Also indicates in which boot event(s) this service will be started. The default value is 99 restart.

stop_service

The stop priority level for this service. Also indicates in which boot event(s) this service will be stopped. The default value is 0 restart.

reboot_service

Indicates for which boot event<s> this service will be allowed to trigger a reboot. The default value is restart.

initdir

The directory which contains the init scripts, this defaults to /etc/init.d. This is not currently used by the code.

Run method

run

List of LCFG components to be called when the boot component's run method is invoked.

runmethod_component

The method to be called of the given component. The default value is run.

user_component

The userid to use to call the component. The default value is root.

reboot_component

Adding run to this resource will allow the specified component to trigger a reboot.

Suspend/Resume

suspend

A list of LCFG components to suspend and resume (by calling their suspend and resume methods). Components are suspended in the order given in the resource, and resumed in the reverse order.

FILES

/var/lcfg/tmp/boot.status

This file indicates the current run level and those services which should be running at this level.

/var/lcfg/tmp/boot.order

This file indicates the order in which components were started at the last runlevel transitition.

PLATFORMS

Scientific5, Scientific6, Fedora13

AUTHOR

Alastair Scobie <ascobie@inf.ed.ac.uk>