\font\chapfont=cmbx10 scaled\magstep3
\font\subrubfont=cmbx10 scaled\magstephalf

\parskip=\bigskipamount
\parindent=0mm
\hsize=6.3 truein
\hoffset=1.0 truein
\vsize=9.7 truein
\voffset=1.0 truein

\footline={\hfil}
\headline={\it\firstmark\hfil\folio}
\def\makeheadline{\vbox to 0pt{\vskip-.7truecm
    \ifnum\pageno=1 \else
        \ifnum\pageno<0 \line{\it\hfil\folio}\smallskip \hrule
        \else \line{\the\headline}\smallskip\hrule\fi\fi
        \vss}\nointerlineskip}

\newcount\chapcount \newcount\subcount \newcount\subsubcount
\chapcount=0 \subcount=0 \subsubcount=0

\def\chapter#1\par{\vskip 0pt plus.4\vsize \goodbreak
    \vskip 0pt plus-.4\vsize \bigskip \bigskip
    \advance \chapcount by 1 \subcount=0 \subsubcount=0
    \chapcontents{#1}\mark{\the\chapcount.\enspace#1}%
    {\chapfont \setbox0=\hbox{\the\chapcount.\enspace}\hangindent=\wd0
        \baselineskip=20truept \raggedright
        \noindent \box0 #1\bigskip \nobreak}}

\def\subrub#1\par{\vskip 0pt plus.3\vsize \goodbreak
    \vskip 0pt plus-.3\vsize \bigskip
    \advance \subcount by 1 \subsubcount=0
    \subcontents{#1}%
    {\subrubfont \setbox0=\hbox{\the\chapcount.\the\subcount\enspace}%
        \baselineskip=17truept \hangindent=\wd0
        \raggedright \noindent \box0 #1\medskip \nobreak}}

\def\subsubrub#1\par{\vskip 0pt plus.3\vsize \goodbreak
    \vskip 0pt plus-.3\vsize \bigskip
    \advance \subsubcount by 1
    \subsubcontents{#1}%
    {\bf\setbox0=\hbox{\the\chapcount.\the\subcount.\the\subsubcount\enspace}%
        \baselineskip=14truept \hangindent=\wd0
        \raggedright \noindent \box0 #1\medskip \nobreak}}

\newwrite\contents
\immediate\openout\contents=\jobname.contents

\def\chapcontents#1{\immediate\write\contents{\noexpand\chapline%
    {\the\pageno}{\the\chapcount}{#1}}}
\def\subcontents#1{\immediate\write\contents{\noexpand\subline%
    {\the\pageno}{\the\chapcount.\the\subcount}{#1}}}
\def\subsubcontents#1{\immediate\write\contents{\noexpand\subsubline%
    {\the\pageno}{\the\chapcount.\the\subcount.\the\subsubcount}{#1}}}

\long\def\bye{\immediate\closeout\contents\vfil\supereject\docontents\end}

\def\docontents{\pageno=-1\bf\parskip=0pt\parindent=0pt
    \def\punkter{\leaders\hbox to .75em{\hss.\hss}\hfill}
    \def\chapline##1##2##3{\smallskip\noindent##2\enspace##3\punkter##1}
    \def\subline##1##2##3{\smallskip\noindent\qquad##2\enspace##3\punkter##1}
    \def\subsubline##1##2##3{\smallskip\noindent
        \qquad\qquad##2\enspace##3\punkter##1}
    \vglue1cm
    \input \jobname.contents
    \vfil\supereject}

\newskip\ttglue{\tt \global\ttglue=.5em plus.25em minus.15em}
\chardef\other=12
\def\ttverbatim{\begingroup \catcode`\\=\other \catcode`\{=\other
    \catcode`\}=\other \catcode`\$=\other \catcode`\&=\other
    \catcode`\#=\other \catcode`\%=\other \catcode`\~=\other
    \catcode`\_=\other \catcode`\^=\other
    \obeyspaces \obeylines \tt}
{\obeyspaces\gdef {\ }}
\def\;{\char'73 }
\catcode`\;=\active
{\obeylines\gdef;{\ttverbatim\spaceskip=\ttglue\let^^M=\ \let;=\endgroup}}
\font\BIG=cmbx10 scaled\magstep5

\null\vfil
\centerline{\BIG N A N N Y}\bigskip\bigskip
\centerline{``A VAX without a Nanny is like a child without a mother.''}
\medskip\centerline{A Creation Of}
\centerline{Zar Limited}
\vfil

The contents of this document and all matter described herein are
licensed solely by Zar Limited and must not be duplicated or transferred
without written consent of Zar Limited. Questions and comments can be
directed to:

\bigskip
\line{\hskip 2in Daniel Zirin\hss}
\line{\hskip 2in Zar Limited\hss}
\line{\hskip 2in P.O.~Box 372\hss}
\line{\hskip 2in Pasadena, Ca 91102\hss}
\line{\hskip 2in U.~S.~A.\hss}
\bigskip\bigskip\eject

\pageno=1

\chapter Introduction

Nanny is a program to maintain an even balance of CPU for all
non-system processes, to perform special memory management functions,
to logoff idle processes, to allow individual users special commands to
manipulate processes with the same UIC, and to do various other
functions available to system users or standard users.

Nanny runs as a detached system process in an endless loop, checking
for new processes, updating the states of old processes, checking for
processes removed from the system, and performing other functions. Each
loop is a cycle and at the end of each cycle, Nanny will wait a specified
time (usually between 15 and 60 seconds) before starting another cycle.
During each cycle, Nanny may also read commands from a system-wide
permanent mailbox assigned to the logical name NANNYS\$BOX. Included with
this package are several programs which use Nanny's commands. When you
distribute these programs to your VAX community, it is a good idea to
protect the source and only allow access to the executable. If you feel
too threatened by allowing use of one or many Nanny commands, a bit mask
exists to disable one or all of Nanny's commands.

Each time Nanny is started, she reads predefined values from a
parameter file and, optionally, a Nanny command file to determine
your system's site-specific requirements and system dependent values
that allow each system a means of modifying Nanny in accord with the
needs of your computer. For more flexibility, a special command permits
you to reread these values. In addition, you can ask that Nanny use
multiple parameter files for defining Nanny's actions during specific
times of the day.

Each and every action Nanny takes, including any errors that may
occur, are written into a log file. This log file is always closed when
Nanny isn't writing data to the logfile, so you may edit or type the
logfile at any time. Many errors and/or status messages from the Nanny
will also appear on designated Nanny operator terminals.

The next few sections will describe each command and function of
Nanny.

\chapter Priorities

Nanny has a priority dither function to keep processes from hogging the
CPU (usually interactive processes). To enable priority dither, you need
to change bits in the function enable bit mask (explained later). The
following algorithm determines what priority a process may have after
each cycle if the priority dither is enabled:
$$
\eqalign{newpri = &oldpri + 1 \hbox{\quad if}\cr
                  &cpuused < cycletime / numusers\cr}
$$
or
$$
\eqalign{newpri = &oldpri - 1 \hbox{\quad if}\cr
                  &cpuused > ( cycletime / numusers ) * 1.1\cr}
$$
$Numusers$ are all processes with the same login priority AND the same
job mode (such as batch or interactive mode) AND does not increase
because of duplicate users. For example, if the users DXL, SHR, and
DMR were all batch jobs with a login priority of 3, $numusers$ for DXL
would be the value 3. But if DXL added another job to the same batch
queue (with the same login priority), $numusers$ would still be 3 only
allowing DXL one third of the CPU no matter how many jobs he added to
the same queue (this is optional and can be determined by bit flags in
the function enable bit mask for each process type). $Cpuused$ is your
accumulated CPU usage since the last cycle. Priorities are not lowered
less than the process' login priority less one and are not raised
above the process' login priority. The $cycletime$ is determined from
the parameter file, described in detail later. It is also possible to
ask Nanny to use a running average in determining CPU use by changing
a parameter file variable.

\chapter Idle processes

All non-system interactive processes are checked during each cycle to
determine if the user has been idle. If the process has been idle for
more than the allowed time, the process is deleted. This action, though,
is not taken without warnings. A warning is sent to the process at $maxtime$
divided by 2 and again at $maxtime-cycle\ time$ before logout. When the
process is logged out, an appropriate message is displayed at the process's
terminal. $Idle\ time$, $maxtime$, and $cycle\ time$ are constants in the
parameter file.

The value $maxtime$ starts out as the default idle time. Users are then
allowed to change their own $maxtime$ values within the minimum and maximum
idle time values using the Nanny command IDLESET. Default, minimum, and
maximum idle time settings are defined in the parameter file.

It is possible to have a process not appear idle to Nanny when in fact,
it is (such as KERMIT is server mode). To handle this, Nanny has another
optional $maxelapsed$ parameter file variable that will force a user to
exit an image after the time specified by $maxelapsed$ (usually something
like 18-20 hours).

\chapter Memory Management

During peak use hours on your CPU, responce time for interactive users
deteriorates as less an less memory is available and more and more users
login (especially if you have to start swapping processes out of core).
To increase responce time, Nanny has bits in the function enable bit mask
to allow Nanny to manage memory for your overcrowded VAX.

If you enable one or more of the function bits corresponding to memory
management, you must specify $maxmemory$ and $freememory$ values in the
parameter file to define when memory management will start. When memory
use by processes on your system (all processes) exceeds $maxmemory$, Nanny
will start suspending batch jobs with low priorities to temporarily release
more memory to interactive processes. A batch job has the potential to be
suspended if another batch job exists with a higher priority or if all of
the CPU cycles are being used by interactive processes. Once a batch job
is suspended by Nanny, the swapper targets the batch job as the best
candidate for being outswapped next (saving other interactive users that
may be temporarily idle for a few seconds). Nanny will resume batch jobs
when memory use drops below $freememory$ using a FIFO (First In First Out)
algorithm). Nanny also has the option to resume batch jobs after a specified
amount of time in suspension.

To determine what values to set $freememory$ and $maxmemory$, wait until
your system is nice and busy and then use a ``SHOW SYSTEM'' command to total
the ``Mem'' column. Subtract 500 from this value and you have a good starting
point for $maxmemory$. The $freememory$ value should be set to $maxmemory$
minus a typical batch job's WSEXTENT+100. Once you have initial settings
for $freememory$ and $maxmemory$ you should ignore the above suggestions
and tailor to your desires and to the behavior of your system.

\chapter System Announcements

On VAX clusters, it is nice to know how busy a computer is before you login.
Nanny has a function bit to automatically create a replacement string for
the logical name SYS\$ANNOUNCE that shows the name of the computer (determined
by \$GETSYI system service and using the logical name SYS\$NODE as a backup),
the DECNET address (if any), the version of VMS, the date and time of the
last system boot, the current login limit, the process load, and the current
and maximum memory usage.

\chapter Wake-up Calls

If your users would like to be reminded of important meetings, Nanny offers
a wake-up call service (this was the original reason Nanny was created in
the first place). Using the WAKE, WCLR, and WSHOW Nanny commands, you can
ask Nanny to send a message to your terminal screen at a certain date/time
in the future. Since Nanny may not always be operating (an operator system
shutdown for example), Nanny saves wake-up calls in a file pointed to by
NANNY\$DUMP and reads this file at startup if it exists. But, if the system
unexpectedly crashes, all wake-up calls will be lost.

\chapter Commands

All commands sent to Nanny must take the form:

\nobreak{\tt\qquad command mbxch pid [arg1 [arg2 [\dots] ] ]}

The command must not be abbreviated and the entire message must be
followed by a space (ascii character 32). Each command sent must have
a mailbox device name and your process I.D.~following the command. Any
arguments required by the command (brackets indicate use if required)
must be present and each argument delimited by at least one space. The
maximum length of a command sent to Nanny can be 128 bytes long.
Process I.D.s must be represented in hexadecimal form. If Nanny
receives an unknown command or a command not properly assembled,
it will be ignored. If a command is unneeded or unwanted, you may
disable its use. A parameter file constant allows one command or all
commands to be disabled from system use. This constant is described
later.

After the message is sent to Nanny, the user may optionally read a
status byte from the mailbox specified with the command. The byte will
either be 1 for successful completion, or 32 to signify an error
occurred while attempting to complete the command.

\subrub ADDACC

The command ADDACC will add a user record to your system's accounting
data file via the system service \$SNDACC. ADDACC requires one
argument: the character string to insert into the accounting data file.
The character string will be preceded with the requestor's username.

\subrub DIE

The command DIE will request Nanny to return all processes to their
original priorities and terminate execution. This command requires no
arguments. If the requestor's group UIC number is greater than the
defined system group UIC number (explained later), the command will
not be performed.

\subrub ENTER

The command ENTER will ask the Nanny to start monitoring a process
removed with the FORGET command. This command requires one argument:
The target process I.D.. If the requesting process group UIC number
is greater than the defined system group UIC number, no action will
be taken.

\subrub FORGET

The command FORGET will ask to remove a process from Nanny's
observation. This command requires one argument: the target process
I.D.. If the requesting process group UIC number is greater than the
defined system group UIC number, no action will be taken.

\subrub FREE

The FREE command will tell Nanny to deallocate a device allocated with
the GRAB command. This command requires one argument: the name of the
device to be deallocated. If the requesting process group UIC number
is greater than the defined system group UIC number, no action will be
taken.

\subrub GRAB

The GRAB command allocates a device to disallow system access to the
device. This command requires one argument: the name of the device to
be allocated. If the requesting process group UIC number is greater
than the defined system group UIC number, no action will be taken.

\subrub IDLESET

The IDLESET command asks Nanny to change a user's maxidle setting within
the boundaries defined by minimum and maximum idle cycle values in the
parameter file. This command requires two arguments: the process I.D.
to change the maxidle setting and the new maxidle setting. Only user's
with a group UIC less than or equal to the system group UIC are allowed
to change a different user's maxidle setting.

\subrub IGNORE

The IGNORE command asks Nanny to close the mailbox NANNY\$PEEK (see the
LISTEN command).

\subrub ISHOW

The ISHOW command asks Nanny to return the requested user's maxidle
setting, the system minimum and maximum idle cycle settings, and the
Nanny cycle time. This information is returned in the return mailbox
prior to receiving the status of this command in the same mailbox. The
data is sent as four longword integers (sixteen bytes) in the order
listed above. This command has one optional argument: the process I.D.
of the user to return maxidle information. If no argument is specified,
the user making the request is assumed.

\subrub KILL

The command KILL will request Nanny to delete a process. The process
must have the same UIC as the request process or no action will be
taken. This command requires one argument: the target process I.D..

\subrub LISTEN

The LISTEN command asks Nanny to open a mailbox called NANNY\$PEEK and
send a copy of each message destined for Nanny's logfile to NANNY\$PEEK.
In addition, a system update of the current process load will be sent
to NANNY\$PEEK for each Nanny cycle. By default, NANNY\$PEEK is closed.
For an example of reading messages from NANNY\$PEEK, see the program
LISTACP.

\subrub NEW

The command NEW will close the current log file, open a new one, and
reread the parameter file. This command has no arguments and can be
issued by all processes. If the requesting process group UIC number is
greater than the defined system group UIC number, no action will be
taken.

\subrub ODIS

The command ODIS will disable a previously enabled operator terminal
from receiving all operator messages. This command has one optional
argument: a terminal device name to disable. If no terminal is specified,
the requestor's terminal is assumed.

\subrub OEN

The command OEN will enable a terminal as an operator terminal to
receive all operator messages. This command has one optional argument:
a terminal device name to enable. If no terminal is specified, the
requestor's terminal is assumed.

\subrub PAUSE

The command PAUSE will pause or suspend executing jobs in a specified
queue. This command requires one argument: the name of the queue to
pause.

\subrub QSTART

The command QSTART will start or restart a specified queue. The
command requires one argument: the name of the queue to start.

\subrub QSTOP

The command QSTOP will stop a specified batch or print queue.
This command requires one argument: the name of the queue to stop.

\subrub READ

The command READ will ask Nanny to use a specified parameter file at
an optional date/time. This command requires one argument and allows
two: the parameter filename to read as argument one and an absolute or
delta time as the optional argument two. If no absolute or delta time
is specified, Nanny will not read the new parameter file until a NEW
command is issued or midnight (which ever comes first). If the requesting
process group UIC number is greater than the defined system group UIC
number, no action will be taken.

\subrub REQUEUE

The command REQUEUE will take the current job in a paused or stopped
print queue and requeue the job at the end of the print queue. This
command requires one argument: the name of the print queue.

\subrub RESUME

The command RESUME will remove a process from a suspended state via
the system service \$RESUME. This command requires one argument: the
target process I.D.. If the target process and the requesting process
do not have the same UIC, no action will be taken.

\subrub STOP

The command STOP will cause a process executing an image to terminate
the image with the system service \$FORCEX. The requesting process and
target process must have the same UICs. This command requires one
argument: the target process I.D..

\subrub SUSPEND

The command SUSPEND will cause a process to enter a suspended state.
This command has one argument: the target process I.D.. Both processes
must have the same UIC or no action will be taken.

\subrub VERSION

The command VERSION asks Nanny to return the current version number
of Nanny. The version number is returned as an ASCII text string of
unknown length (something like ``V?.?''). This command has no arguments.

\subrub WAKE

The WAKE command will queue a message to be sent to a user or terminal
at a specified date and time. This command is limited to 25
outstanding messages throughout the system and is anonymous in nature.
The message has a maximum length of 40 bytes. The wake-up call
function accepts three arguments: a terminal name or username, an
absolute time (format: ``dd-mmm-yyyy hh:mm:ss.ss''\; fields within the
absolute time may be omitted, but punctuation may not), and a message
preceded by a double quote. Only one space may delimit each argument.
An example would be:

\nobreak
{\tt\qquad WAKE ZAR 12-MAY-1982 12:00:00.00 ``Time to eat lunch.}

or

\nobreak
{\tt\qquad WAKE TTB2: {-}- ::. ``This tests the wake-up call.}

If a username is specified for the first argument, a colon should not follow
the name. If the wake-up call expires and the user is not logged on
the system, the message will not be sent. If the user specified is
logged on to more than one terminal, the user will be notified at each
terminal. For an example on sending WAKE requests to Nanny, see the
WAKEACP program.

\subrub WCLR

The WCLR command will remove a wake-up call from Nanny's memory. It
requires one argument: the wake-up call identification number (between
10 and 35) or ``*'' (all wake-up calls). Only users with system UICs can
cancel a wake-up call issued by another user. For an example on clearing
wake-up calls, see the program WAKEACP.

\subrub WDUMP

The WDUMP command will save all current wake-up calls to a dump file.
It requires one argument: the filename of the dump file to store the
wake-up calls. Only users with system UICs can issue the WDUMP command.

\subrub WSHOW

The WSHOW command will return wake-up queue information to the
caller's return mailbox (before the actual return status sent). The
command takes no arguments and returns information in the following
format:

\nobreak
{\tt\qquad id own-uic destination date/time}

where `id' is the wake-up call identification number multiplied by
$-1$ (2 bytes), `own-uic' is the UIC of the issuing process (4 bytes),
`destination' is the name of a terminal or user to send the message
(12 bytes), and `date/time' is the system binary time when the call
will be sent (8 bytes). Nanny will send one packet of information (26
bytes) for each wake-up call in its memory after which a dummy packet
with an `id' equal to $-1$ will be sent signifying the end of the
queue. The next message sent will be the Nanny return status code.
For an example on issuing the WSHOW command to Nanny, see the program
WAKEACP.

\chapter Parameter File

The parameter file is a standard ASCII text file containing input
constants for Nanny. These constants will set guidelines for Nanny to
follow when determining new priorities, logging off idle terminals,
and performing other functions. The parameter file is read once when
Nanny is started, and each night at midnight. The following
sub-paragraphs will define each constant of the parameter file in
detail. To format a constant for a FORTRAN list-directed I/O
statement, enter the value into the parameter file with no leading
blanks or zeros (leading blanks or zeros are optional when reading
variables with a list-directed I/O statement) and follow the constant
with at least one space (ASCII character 32).

\subrub Alternate Parameter Filename

This character value defines the next parameter file that
will be used followed by an optional 23 byte character absolute or
delta time to read the specified parameter file. If no time is
specified after the filename (if the filename exists) then the
specified alternate parameter file will be read when a NEW command
is issued or at midnight (which ever comes first). Two examples
would be ``SYS\$MANAGER:NANNY1.INP {-}- 18:0:0.0'' to ask that the new
parameter file be read at 6pm and ``SYS\$MANAGER:NANNY2.INP 0 1:0:0.0''
to ask that the new parameter file be read one hour from the reading
of the current parameter file.

\subrub Nanny Command Filename

This character value defines the name of a Nanny command file
(explained in detail later) to be read immediately.

\subrub Process Name

This 15 byte character value is Nanny's process name. It should be
different from any other process name on the system. The value is
read from the parameter file with an (A15) FORTRAN format statement.

\subrub System Group UIC Number

This value is the group number portion of the system's UIC (User
Identification Code). This value MUST be represented as an octal 6
digit number and may and may take a value between 1 and 255. While
Nanny is searching for processes to pick on, she will ignore processes
with a UIC group portion less than or equal to this value (for example
if SYSGRP (the value under discussion) is 3 and Nanny comes across a
process with a UIC of [2,1], the process will be ignored. If SYSGRP is
5 and the process's UIC was [7,1], the process will be entered into
Nanny's tables).

\subrub System Account

The system account is the account name (or number) all system
processes are charged to. To find out your system account, log-in as
the user SYSTEM and issue the command ``;SHOW PROCESS/QUOTA;''. In the
upper-left of the display will be ``;Account name: xxxxxxxx;''. Any
process that Nanny finds with this account name string will be
disregarded. The value is read from the parameter file with an (A8)
FORTRAN format statement (the first eight bytes are used to determine
the value).

\subrub Cycle Time

The cycle time is the time Nanny waits between process checks. The
value is represented in hundredths of seconds (i.e. 1000 is equal to
10.00 seconds). A good value should be between 30 and 60 seconds
(although values between 10 seconds and 2 minutes are allowed). This
value is read from the parameter file with a list-directed I/O
statement.

\subrub Cycle Average

The priority dither feature of Nanny will allow you to specify a
number to averge CPU use. This value determines how many cycles will
be used to generate an average CPU use statistic. Values from 0--10
are allowed. A value of zero (0) implies one (1). This value is read
from the parameter file with a list-directed I/O statement.

\subrub Def/Min/Max Idle Time And Maximum Elapsed Time

The default idle time is the total elapsed time before a interactive
user is removed from the system. Minimum and maximum idle time are
the lower and upper boundaries to allow user's to change their default
idle time setting. Idle terminals are a waste of resources and process
slots. These three values are expressed in Nanny cycle times (specified
by the previous line in the parameter file). The maximum elapsed time
is the maximum allowed elapsed time since login that a process may
exist. If a process exceeds this value, Nanny forces the process to
exit its image. This is good for programs like KERMIT (in server mode)
that trick Nanny into thinking the process is never idle. This value is
also expressed in Nanny cycle time. These values are read with a list-
directed I/O statement.

\subrub Non-idle Time And Non-idle I/O

Non-idle time is the amount of CPU needed to consider a interactive
process not idle. The value is expressed in hundredths of seconds
(i.e. 5 is 0.05 seconds of CPU). A good value would be between 2 and
20 (allowed values are between 0 and 299). Non-idle I/O is the amount
of combined buffered and direct I/O required to be non-idle. These
two values are read with a FORTRAN list-directed I/O statement.

\subrub Maximum Memory Usage And Low Memory Usage

If the total physical memory usage of all processes monitored by Nanny
exceeds the first value of this line, Nanny will start suspending low
priority batch jobs (after which the SWAPPER will swap out the batch
job rather than interactive processes). Typically, this value should be
85\% of your system's total memory capacity. A value of 0 (zero) indicates
you don't want Nanny to suspend processes when memory usage peaks. Values
may be between 2048 pages and 65536 pages (1--32 megabytes). If the total
physical memory usage of all processes monitored by Nanny is less than the
second value in this line and Nanny has previously suspended processes,
Nanny will resume the highest priority batch job suspended. This value
should be the `Maximum memory usage' minus the average maximum working
set extent of a typical batch job on your system. A value of 0 (zero) is
redundant with the previous parameter. Valid values are 2048--65536 pages.
These values are read from the parameter file with a list-directed I/O
statement.

\subrub Maximum Suspend Time

This line contains a value expressed in Nanny cycle time units called
maxsuspend. If a process suspended by Nanny's memory suspension function
exceeds maxsuspend, the process is resumed. When suspending a process
on VMS it is possible to catch the process while it has a lock out on
a file (sometimes that file is SYS\$SYSTEM:SYSUAF.DAT). If other processes
on the system depend on eventually gaining access to a file locked by a
suspended process, they can hang. Good values for maxsuspend are between
15-60 minutes. These values are read from the parameter file with a list-
directed I/O statement.

\subrub Time Change Days

This line contains two integer values: the day-of-the-year to advance
the system time, and the day-of-the-year to backup the system time.
The time change will occur on the day requested at approximately 2:00
in the morning. Nanny does not check for any time dependant programs
operating on the system prior to changing the time (if you also have
strict accounting procedures, you should probably not use this feature).
A value of zero for both integers disables this feature (the function
enable mask also can disable this feature). Valid values are 0-366.
These values are read from the parameter file with a list-directed I/O
statement.

\subrub Working Set Purge

This line should read ``;YES;'' if you want Nanny to purge her working
set after each cycle and ``;NO;'' if you want her to just purge it each
night at midnight. Purging Nanny's working set for every cycle may
save your system 100 to 150 pages of memory, but pagefaulting will be
high. Nanny will also start automatically purging memory if you have
a maximum memory usage specified (previous line in the parameter file)
and memory is considered low.

\subrub Number Of Disks To Watch

This is an integer specifying the number of disks you wish Nanny to
check for free space and error counts. This value is read with a FORTRAN
list directed I/O statement. If this is 0 (zero), skip the next two
sections.

\subrub Free Disk Space

This line contains a single integer used in determining if disk space
is low in the disk watch algorithm. A disk is full if the maximum
blocks divided by this number is greater than the free disk blocks.
A good number is 50 (2\% available). This value is read from the
parameter file with a list-directed I/O statement.

\subrub Disk Checking

You must now have $x$ lines where $x$ is the number of disks to watch
(two lines above in the parameter file). Each line must have the device
names of disks Nanny will check for low space and errors. The disk names
must be less than 64 bytes long and each name must be followed by a space
(ascii character 32). A maximum of 16 disks can be specified. Nanny checks
every 15 minutes if each disk has available disk space and an increase of
10 errors. If either of the checks is true, messages are sent to Nanny
specified operator terminals.

\subrub Number Of Nanny Operators

This is an integer specifying the number of terminals you wish Nanny
operator messages be sent. This value is read with a FORTRAN list
directed I/O statement. If this is 0 (zero), skip the next section.

\subrub Nanny Operators

You must now have $x$ lines where $x$ is the number of terminals to
send Nanny operator messages (previous line in the parameter file).
Each line must have the device names of terminals to be designated as
Nanny operator terminals. Some Nanny errors and many Nanny status
messages are sent to these terminals. Included in this list of
terminals is ;OPA0:; (the console). The terminal names must be followed
by a space (ascii character
32). A maximum of eight terminals may be specified.

\subrub Command Disable Mask

This value is a bit mask to disable one or more of Nanny's commands.
The value must be expressed in hexadecimal form and have exactly 8
digits. To disable a command, set the bit corresponding to the command
to be disabled. To enable a command, clear the bit. The following
define each bit of the mask and the command the bit represents:

{\obeylines\parindent=2em
Bit 1 -- This bit, if set, will disable the command ADDACC
Bit 2 -- This bit, if set, will disable the command DIE
Bit 3 -- This bit, if set, will disable the command ENTER
Bit 4 -- This bit, if set, will disable the command FORGET
Bit 5 -- This bit, if set, will disable the command FREE
Bit 6 -- This bit, if set, will disable the command GRAB
Bit 7 -- This bit, if set, will disable the command IDLESET
Bit 8 -- This bit, if set, will disable the command IGNORE
Bit 9 -- This bit, if set, will disable the command ISHOW
Bit 10 -- This bit, if set, will disable the command KILL
Bit 11 -- This bit, if set, will disable the command LISTEN
Bit 12 -- This bit, if set, will disable the command NEW
Bit 13 -- This bit, if set, will disable the command ODIS
Bit 14 -- This bit, if set, will disable the command OEN
Bit 15 -- This bit, if set, will disable the command PAUSE
Bit 16 -- This bit, if set, will disable the command QSTART
Bit 17 -- This bit, if set, will disable the command QSTOP
Bit 18 -- This bit, if set, will disable the command READ
Bit 19 -- This bit, if set, will disable the command REQUEUE
Bit 20 -- This bit, if set, will disable the command RESUME
Bit 21 -- This bit, if set, will disable the command STOP
Bit 22 -- This bit, if set, will disable the command SUSPEND
Bit 23 -- This bit, if set, will disable the command VERSION
Bit 24 -- This bit, if set, will disable the command WAKE
Bit 25 -- This bit, if set, will disable the command WCLR
Bit 26 -- This bit, if set, will disable the command WDUMP
Bit 27 -- This bit, if set, will disable the command WSHOW
Bits 28 through 32 -- unused.\par}

If the disable mask was equal to 00008009 (hex), the commands ADDACC,
FORGET, and QSTART would be disabled. The value FFFFFFFF disables all
commands and 00000000 enables all commands.

\subrub Function Enable Mask

This value is a bit mask to enable one or more of Nanny's functions.
The value must be expressed in hexadecimal form and have 8 digits. To
enable a function, set the bit corresponding to the function to be
enabled. To disable the function, clear the bit. The following defines
each bit of the mask and the function the bit represents:

{\parindent=4em

\item{Bit 1 --}This bit, if set, will allow Nanny to modify batch
process priorities if CPU usage is unfairly distributed.

\item{Bit 2 --}This bit, if set, will allow Nanny to modify detached
process priorities if CPU usage is unfairly distributed.

\item{Bit 3 --}This bit, if set, will allow Nanny to modify
interactive process priorities if CPU usage is unfairly distributed.

\item{Bit 4 --}This bit, if set, will allow Nanny to modify network
process priorities if CPU usage is unfairly distributed.

\item{Bit 5 --}This bit, if set, will allow Nanny to modify subprocess
priorities if CPU usage is unfairly distributed.

\item{Bit 6 --}This bit, if set, will cause duplicate users CPU totals
to be combined when determining CPU distribution. If disabled,
duplicate users will not exist.

\item{Bit 7 --}This bit, if set, will cause processes suspended by
Nanny's memory suspension function to resume after maxsuspend (defined
in the parameter file).

\item{Bit 8 --}This bit, if set, will allow Nanny to suspend batch
processes if memory is low.

\item{Bit 9 --}This bit, if set, will allow Nanny to suspend detach
processes if memory is low (not available yet).

\item{Bit 10 --}This bit, if set, will allow Nanny to suspend interactive
processes if memory is low (not available yet).

\item{Bit 11 --}This bit, if set, will allow Nanny to suspend network
processes if memory is low (not available yet).

\item{Bit 12 --}This bit, if set, will allow Nanny to suspend subprocesses
if memory is low (not available yet).

\item{Bit 13 --}This bit, if set, tells Nanny to only logoff idle process
trees. If clear, Nanny will logoff idle subprocesses owned by a target
idle process before the main interactive target process will be logged
off.

\item{Bit 14 --}This bit, if set, will allow Nanny to logoff idle
interactive system processes.

\item{Bit 15 --}This bit, if set, will send a logoff warning to idle
processes at 1/2 the total maximum idle time.

\item{Bit 16 --}This bit, if set, will send a logoff warning to idle
processes at approximately 60 seconds before logoff (depending on the
cycle time).

\item{Bit 17 --}This bit, if set, will prefix the logoff warning, set
by enabling bit 16, with three form-feeds (to clear the terminal
screen in a secure environment).

\item{Bit 18 --}This bit, if set, will send a warning to interactive
users with a CPU quota prior to exceeding the CPU quota.

\item{Bit 19 --}This bit, if set, will turn on preference account
priority dither (not available yet).

\item{Bit 20 --}This bit, if set, will disallow a single user to issue
multiple wake-up calls.

\item{Bit 21 --}This bit, if set, will consider a process not-idle only
if the process has met both the minimum CPU and minimum I/O values in
the parameter file. If clear, this bit will cause processes that meet
either the minimum CPU or the minimum I/O requirement to be considered
not-idle.

\item{Bit 22 --}27 -- Unused.

\item{Bit 28 --}This bit, if set, will dynamically update the logical
name SYS\$ANNOUNCE with the system load.

\item{Bit 29 --}This bit, if set, will update the system time at daylight
savings time on the days of the year specified by parameter file constants.
It is suggested you leave this off if you operate a VAXCluster unless you
understand the side effects of changing the time. The time change occurs
at approximately 2:00 in the morning on the days requested and does not
attempt to fix accounting records or other problems that may arise from
changing the time. The time is advanced or backed up by exactly one hour.

\item{Bit 30 --}Reserved.

\item{Bit 31 --}Causes debugging messages to be sent to the logfile
and some functions are not performed (such as idle logoff).

\item{Bit 32 --}Causes debugging messages to be sent to the logfile
and execute all desired functions.\par}

The value 3FFFFFFF enables all functions and 00000000 disables all
functions.

\subrub Number Of Users To Ignore

This is an integer specifying the number of users you wish Nanny
to ignore and remove from the internal process tables. This value is
read with a FORTRAN list directed I/O statement. If this is 0 (zero),
skip the next section.

\subrub Ignoring Users

You must now have $x$ lines where $x$ is the number of users to
ignore (previous line in the parameter file). Each line must have
a username of a person the Nanny will entirely ignore. The usernames
must be followed by a space (ascii character 32). A maximum of 32 names
can be specified.

\subrub Number Of Terminals To Ignore

This is an integer specifying the number of terminals you wish Nanny
to ignore and remove from the internal process tables any user logged
onto the ignored terminal(s). This value is read with a FORTRAN list
directed I/O statement. If this is 0 (zero), skip the next section.

\subrub Ignoring Terminals

You must now have $x$ lines where $x$ is the number of terminals to
ignore (previous line in the parameter file). Each line must have
the device name of a terminal Nanny will ignore (OPA0: for example).
The device names must be specified as ``;ddun:;'' or ``;_ddun:;''
(never use concealed devices!) and each name followed by a space
(ascii character 32). A maximum of 16 names can be specified.

\chapter Command File

The Nanny command file is a standard ASCII text file containing valid
commands for Nanny. The commad file is read if line two of the parameter
file requests a specified command file be read. The command file (unlike
the parameter file) is read until the end of file is detected and can
contain blank or comments anywhere within the file (comments follow
the bang or exclamation mark character).

Unlike commands sent to Nanny's mailbox, all commands in this file
must not specify a return mailbox and must not specify a requestor
process I.D.. All commands are processed regardless of the bit settings
in the command disable bit mask (defined in the parameter file). Only
a subset of Nanny commands are available for use in the command file.
They are ADDACC, DIE, FREE, GRAB, IGNORE, LISTEN, ODIS, OEN, PAUSE,
QSTART, QSTOP, READ, REQUEUE, WAKE, WCLR, WDUMP, and the special command
SPAWN. The SPAWN command takes one argument: the name of a DCL command
file to run as a detached process (external and asynchronous to Nanny).

All commands may be preceded by an optional date/time string. If a
date/time string is specified, the command is restricted to the
date and time preceding the command and will not be run at any
other time. The date/time string takes two forms: a date followed
by a colon followed by a time, or a weekday name followed by a
colon followed by a time. The date field should be formatted as
``dd-mmm-yyyy'' and the time field must be specified as
``hh:mm:ss.ss''. The weekday field may be one of the set ``SUNDAY'',
``MONDAY''...``SATURDAY''. Both the date and weekday fields must
use uppercase letters. An example of valid date/time strings would
be ``{-}-:8:0:0.0'' to execute the following command at 8am every day.
Another example would be ``SATURDAY:0:0:0.0'' to restrict the
following command to run only at midnight every saturday.

A good use for the Nanny command file is to have restricted time
commands to start and stop queues, run midnight batch jobs, and
end the command file with time restricted ``READ'' commands to
reread the parameter file (and the command file) and the next
time interval such as ``{-}-:10:0:0.0 READ NANNY.INP {-}- 11:0:0.0''.

\chapter Installation

To install Nanny, log-in as the user SYSTEM. Then, create a directory
to store Nanny's files. Ideally, this directory should be protected to
prohibit access to the world (non-system users). A suggested command
would be:

\nobreak
\qquad;$ CREATE/DIR/PROT=(S:RW,O:RW,G,W) SYS$SYSROOT:[SYSMGR.NANNY];

Edit the files STARTNAN.COM and NANNY.INP (parameter file). Use BUILD.COM
to create all executables. Add ``;@STARTNAN;'' to SYS\$MANAGER:SYSTARTUP.COM
and run the program NANNYACP to talk to Nanny while she's running (except
for wake-up calls). Use WAKEACP for sending, deleting, and showing wake-up
calls. Use LISTACP in conjunction with the LISTEN and IGNORE commands in
the command disable bit mask.

Be careful that the logical names NANNY\$START and NANNY\$DUMP (if used)
are created in executive mode in the system logical name table.

Lastly, check both BUILD.COM and NMAIN.FOR for hints on how to find the
Author and/or a new update kit.
\bye
