@V7 54 2 -5
@L3 COUK1247
80
@V9 0
@YCHAPTER 19 - MUSS USER MANUAL
@G@RCHAPTER 19 - ACCOUNTING AND USER MANAGEMENT@G
@V10 1 9 250
@T% 10
@BControlling users and accounting for their use of the system is
dependent on conditions in a particular installation. The aim of the
MUSS accounting system is to provide a set of primitive operations
that the System Manager of an installation can use to build an
accounting regime appropriate to his needs.
@BThe basic system maintains accounts for four resources. These are:@
@T% 30
@Q 12
@
(i) CPUTIME@IThe amount of CPU time used (time slices).@
@
(ii) NO OF FILES@IThe maximum number of files
that a user can have in his
directory.@
@
(iii) FILESTORE@IThe maximum amount of filestore (Kbytes)
a user can occupy.@
@
(iv) SUBORDS@IThe maximum number of subordinates
a user can have.
@BThe user, SYSTEM has infinite amounts of all resources
which it can distribute to other users in the system. Any other user
can create new subordinate users, if it has an allocation for SUBORDS.
@BSome high-level procedures are provided along with the basic
system to be used as an example of the use of the primitives and to
provide simple facilities for those who need no more.
@S219.1 COMMANDS
@BThe commands associated with accounting and user management fall
into two categories, basic (primitive) commands and high-level commands.
The primitive commands are those which deal with separate accounting
and user management tasks, while the latter commands are only a collection
of applications for primitive ones.
@S319.1.1 Primitive Commands
@BThe set of consumable balances and incomes and reusable maxima for a user is c
alled his
"parameters". The parameter numbers for the standard resources are:@
@Q 8
@T% 20 40
@
%CPU time balance%- 1@
%CPU time income%- 3@
%Maximum files%- 4@
%Maximum file store%- 5@
%Maximum subords%- 6@
@
@
1) @JCREATE.USER(II)
@BThis command creates a new user with the name specified in P1 as
a subordinate of the current user. The name must be unique within
the installation.@
@
@
2) @JERASE.USER(II)
@BThis procedure removes current user's subordinate (with username  P1) from the
 system. The
subordinate's balances of consumables and maxima of reusables are
added to the current user's corresponding values. The subordinate
must not have any subordinates or used any reusables.@
@
@
3) @JSET.USER.PARAM(II,I,I)
@BThis procedure re-distributes a balance, maximum or
income between a user and one of his subordinates (P1).
P2 is the parameter number. P3 is the amount (POSITIVE) to
which the parameter is to be set. The change must not reduce either
user's parameters to less than zero.
@
@
4) @JNEW.PASSWORD(II,II)
@BChanges the password of the current user (P2 zero) or one of his
subordinates (P2 is username) to the value in P1.@
@
@
5) @JCATALOGUE.USERS(I)
@BReturns a new segment containing a table of information on the
current user and his subordinates (if any). There is one entry for
each subordinate and a subordinate's subordinates immediately follow
his entry (defined recursively). The format of each entry in the
table is:@
@3
@U 25
@
@
               @O                        @O
               @O| USERNAME (8 bytes)   |@O
               @O| PASSWORD (8 bytes)   |@O
               @O| LEVEL (1 byte) *     |@O
               @O| spare (3 bytes) *    |@O
               @O| BALANCE 1 (4 bytes)  |@O
               |                      |
@
               @O|                      |@O
               @O| BALANCE m (4 bytes)  |@O
               @O| INCOME 1 (4 bytes)   |@O
               |                      |
@
               @O|                      |@O
               @O| INCOME m (4 bytes)   |@O
               @O| MAXIMUM 1 (4 bytes)  |@O
               |                      |
@
               @O| MAXIMUM n (4 bytes)  |@O
@
     * This will be 0 for current user, 1 for immediate,
       subordinate, 2 for subordinate's subordinate, and
       so on.
@0
@BPW1 holds the number of users in the table, PW2 holds the segment
number. PW3 is set to the maximum number of subordinates that the
user is allowed to create. PW4 holds the number of consumable
resources, PW5 the number of reusable resources (the m and n values
respectively in the figure above).@
@
@
6) @JPAYOUT()
@BThis procedure causes each user's income for each consumable
resource to be added to his balance and then, if necessary, this
reduced to his limit. It may only be invoked by an authorised
user.@
@
@
7) @JFIND.U(II,II)@
@BThis procedure returns in PW1 the UID of the user
specified by username (P1) and password (P2).
The UID of the subordinate may be obtained
without giving a password.
@S219.2 HIGH-LEVEL COMMANDS
@
@
1) @JNEW.USER([C], [C])@
@BThis procedure creates a new set of users as subordinates
of the current user.
@BPrior to the creation of individual users, values for new
users resources are read from P1. This should contain CPU
time income, maximum files, maximum file store (1/2K blocks) and
maximum subordinates. Entries are all unsigned decimal
integers on separate lines. An empty line or one which has
other than integer value in it is interpreted as a zero. This
list may be terminated using an "@@" on a separate line,
in which case the rest of the resources will be set to zero.
@BNames of users are read from another document (P2). This
must contain pairs of username and password, each on a
separate line. The default for password is "X", however
if more users are to be created the default password must
also appear in P2. Operation may be terminated by an "@@".
@BDefault for P1 and P2 is the currently selected stream.
When the command is used interactively, appropriate prompts
will appear to steer the operation.@
@
@
2) @JDELETE.USER([C])
@BThis procedure removes a user's subordinate from the system, transferring his
resource
allocations back to his superior. The subordinate must not have any
subordinates,or have used any other reusables. P1 is the
source document which contains names of users to be deleted,
terminated by an "@@". The default is the current stream.
@
@
3) @JSET.ACCOUNT([C],[C],[C])
@BThis command redistributes balance, income and maxima between a
user and one or more of his subordinates. It works in a similar way
to the command NEW.USER by reading new income/maxima,
new balance (CPU time) and finally usernames.
@BP1 is the source from which positive integers
indicating the new values of the user's income/maxima are to be read.
@BP2 is the source from which balance is read. Both P1 and P2
may be terminated by an "@@" on a separate line. In each case the
remaining resources will be left intact.
@BUsernames will be read from P3, one name per line
and terminated by an "@@". The default for P1, P2 and P3 is the
currently selected stream.
@
@
4) @JLIST.ACCOUNTS(C,[C])
@BThis command lists the accounts parameters for the current user
and his immediate subordinates (P1 equals S), or all
his subordinates (P1 equals A).
@BFor each user, the name and level (0 = self, 1 = subordinate,
etc) and a set of accounts with appropriate captions are output
to the destination document (P2). The currently selected
output stream is the default for P2.
@F
