#ident	"$Header: /net/projects/S2.6/cvs/os_net/src_ws/usr/src/tadcmd/locations/init.d/README,v 1.1 1997/10/09 10:36:53 ang Exp $"
Copyright (c) 1997, Tadpole Technology PLC

This file describes the general mechanism for installing and executing
location scripts used to implement location changes. The general
philosophy is to follow the state change scripts in /etc/init.d.

/var/locations/init.d contains initialization and termination scripts for
changing locations.  These scripts are linked when appropriate to
files in location specific rc.d directory, for the basic location and
the rc[0-9].d directories for sub-locations.

File names in location specific rc.d directories are of the form
[SK]nn<init.d filename> where 'S' means start this job, 'K' means kill
this job, and 'nn' is the relative sequence number for killing or
starting the job. The default sequence number is obtained from the
/var/locations/master file when a location is created.

When changing location (with chloc) the scripts in /var/locations/<old
locname>/rc.d that are prefixed with 'K' are called with the "stop"
argument. This tries to stop all services under location control. The
scripts in /var/locations/<new locname>/rc.d prefixed with 'S' are
then called with the "start" argument which will start all services
associated with the new location.

There is no harm in applying the same sequence number to multiple
scripts.  In this case the order of execution is deterministic but
unspecified.

The standard scripts differ from their /etc/init.d counterparts in that
they also save and restore the location specific database files. The
majority of scripts can simply hand off the process control to the
corresponding /etc/init.d file but they will also restore/remove the
service configuration files as appropriate. The aim of this is to leave
the machine in a state that would be re-gained if the machine were to
be re-booted.

These scripts can also take a "create" argument that asks them to determine
is the service is active and if so to save the database files to the
location specific directory. This facility is used by the saveloc program.

