'\"macro stdmacro
.if n .pH g1a.sac @(#)sac	40.22 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.\".if \nX=0 .ds x} sac 1M "Networking Services Architecture" "\&"
.\".if \nX=1 .ds x} sac 1M "Networking Services Architecture"
.if \nX=0 .ds x} sac 1M "Essential Utilities" "\&"
.if \nX=1 .ds x} sac 1M "Essential Utilities"
.if \nX=2 .ds x} sac 1M "" "\&"
.if \nX=3 .ds x} sac "" "" "\&"
.TH \*(x}
.SH NAME
\f4sac\f1 \- service access controller
.SH SYNOPSIS
\f4sac \-t \f2sanity_interval\f1
.SH DESCRIPTION
The Service Access Controller (\s-1SAC\s+1)
is the overseer of the server machine.
It is started when the server machine enters multiuser mode.
The \s-1SAC\s+1 performs several important functions
as explained below.
.P
\f2Customizing the \s-1SAC\s+1 environment\fP.
When \f4sac\f1 is invoked, it first looks for the
per-system configuration script \f4/etc/saf/_sysconfig\f1.
\f4sac\f1
interprets \f4_sysconfig\f1 to customize its own environment.
The modifications made to
the \s-1SAC\s+1 environment by \f4_sysconfig\f1 are inherited by all 
the children of the \s-1SAC\s+1.
This inherited environment may be modified by
the children.
.P
\f2Starting port monitors\fP.
After it has interpreted the \f4_sysconfig\f1 file,
the \f4sac\f1 reads
its administrative file
\f4/etc/saf/_sactab\f1.
\f4_sactab\f1
specifies which port monitors are to be started.
For each port monitor to be started, \f4sac\f1 forks a child
[\f4fork\f1(2)]
and creates a \f4utmp\f1 entry with the \f2type\f1 field set to
\f4LOGIN_PROCESS\f1.
Each child then interprets its per-port monitor configuration script
\f4/etc/saf/\f2pmtag\f4/_config\f1,
if the file exists.
These modifications to the environment 
affect the port monitor
and will be inherited by all its children.
Finally, the child process \f4exec\f1s the port monitor,
using the command found in the \f4_sactab\f1 entry.
(See \f4sacadm\f1; this is the command given with the \f4\-c\f1 option
when the port monitor is added to the system.)
.P
\f2Polling port monitors to detect failure\fP.
The \f4\-t\f1 option sets the frequency with which \f4sac\f1 
polls the port monitors on the system.
This time may also be thought of as half of
the maximum latency required to detect
that a port monitor has failed and that recovery action is necessary.
.P
\f2Administrative functions\fP.
The Service Access Controller
represents the administrative point of control for port monitors.
Its administrative tasks are explained below.
.sp .5
When queried (\f4sacadm\f1 with either \f4\-l\f1 or \f4\-L\f1),
the Service Access Controller returns the status 
of the port monitors specified, which \f4sacadm\f1 prints
on the standard output.
A port monitor may be in one of six states:
.sp .5
.TP 1i
\f4ENABLED\f1
The port monitor is currently running and is accepting
connections.
See \f4sacadm\f1(1M) with the \f4\-e\f1 option.
.TP
\f4DISABLED\f1
The port monitor is currently running and is not
accepting connections.
See \f4sacadm\f1 with the \f4\-d\f1 option, and see \f4NOTRUNNING\f1,
below.
.TP
\f4STARTING\f1
The port monitor is in the process of starting up.
\f4STARTING\f1 is an intermediate state 
on the way to \f4ENABLED\f1 or \f4DISABLED\f1.
.TP
\f4FAILED\f1
The port monitor was unable to start and remain running.
.TP
\f4STOPPING\f1
The port monitor has been manually terminated but has
not completed its shutdown procedure.
\f4STOPPING\f1 is an intermediate state on the way to \f4NOTRUNNING\f1.
.TP
\f4NOTRUNNING\f1
The port monitor is not currently running.
(See \f4sacadm\f1 with \f4\-k\f1.)
This is the normal ``not running'' state.
When a port monitor is killed, all ports it was monitoring
are inaccessible. 
It is not possible for an external user to
tell whether a port is not being monitored or the system is down.
If the port monitor is not killed but is in the \f4DISABLED\fP state,
it may be possible (depending on the port monitor being used) to
write a message on the inaccessible port telling the user
who is trying to access the port that it is disabled.
This is the advantage of having a \f4DISABLED\fP state as
well as the \f4NOTRUNNING\fP state.
.in -.5i
.P
When a port monitor terminates,
the \s-1SAC\s+1 removes the \f4utmp\f1 entry for that port monitor.
.P
The \s-1SAC\s+1 receives all requests to enable, disable, start, or
stop port monitors and 
takes the appropriate action.
.P
The \s-1SAC\s+1 is responsible for restarting port monitors that terminate.
Whether or not the \s-1SAC\s+1 will restart a given
port monitor depends on two things:
.sp.5
.RS
.TP 3
\-
the restart count specified for the port monitor
when the port monitor was added by \f4sacadm\f1;
this information is included in
\f4/etc/saf/\f2pmtag\f4/_sactab\f1
.TP
\-
the number of times the port monitor has already been restarted
.RE
.SH "SEE ALSO"
\f4sacadm\fP(1M), \f4pmadm\fP(1M).
.SH FILES
\f4/etc/saf/_sactab
.br
/etc/saf/_sysconfig
.br
/var/adm/utmp
.br
/var/saf/_log\f1
.\"	@(#)sac.1a	1 of 10/1/88
.Ee
