and.8.man 3.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
.TH AND 8 "__DATE__" "Unix" "Administrator's Tools"

.SH "NAME"
and \- auto nice daemon

.SH "SYNOPSIS"
.B and
.RB [ \-htvsx ]
.RB [ \-i
.IR interval ]
.RB [ \-c
.IR /path/to/and.conf ]
.RB [ \-d
.IR /path/to/and.priorities ]


.SH "VERSION"
This manual page documents
.B and
version __VERSION__.

.SH "DESCRIPTION"
The auto nice daemon activates itself in certain intervals and renices and
even kills jobs according to their priority and CPU usage.

Renice levels and kill signals can be defined in terms of users, groups,
and commands. Wildcards can be specified for any of these. In addition,
commands can be specified using POSIX regular expressions. To allow for
network-wide configuration and priority files, a mechanism for hostname-based
evaluation is provided, again supporting regular expressions for specifying
host names.

Jobs owned by root are left alone. Jobs are never increased in their priority.

Here are some real-world examples:

A certain user is notorious for wasting CPU with next-to-irrelevant jobs.
One line is sufficient to renice all of his jobs to about 19.
This is a typical situation for a LART (Luser's Attitude Readjustment Tool)
like
.B and.

A CPU server is dedicated to a certain group, but others may also use
it when it's idle. Just define default nice levels of e.g. 18 and a lower
nice level for the privilegued group, say nice level 12.

A certain web browser who shall remain unnamed tends to go berserk once
in a while. You can configure 
.B and
to kill -9 it after e.g. 20 CPU minutes.


.SH "COMMAND\-LINE OPTIONS"

.TP 0.5i
.B \-c /path/to/and.conf
Specifies the configuration file. If this flag is omitted,
.I /etc/and.conf
is used instead.

.TP 0.5i
.B \-d /path/to/and.priorities
Specifies the priority database file. If this flag is omitted,
.I /etc/and.priorities
is used instead.

.TP 0.5i
.B \-h
Produces a short help text.

.TP 0.5i
.B \-i interval
Sets the interval between nice level checks. This flag overrides the
interval specified in the configuration file, if any. The default interval of
.I 60
seconds is used if neither -i nor an interval directive in the configuration
file is given.

.TP 0.5i
.B \-s
Log to stdout. Without this switch, logging goes to syslog (normal
operations) or
.I ./debug.and
(test mode). Useful for debugging config files.

.TP 0.5i
.B \-t
Run in test mode only, i.e. don't really renice or kill anything.
In this mode, logging goes into
.I ./debug.and
instead of syslog.

.TP 0.5i
.B \-v
Increase verbosity. For maximum verbosity, this flag can be specified
multiple times. Be warned that this will blow up your log files, so
you should use it in test mode only.

.TP 0.5i
.B \-x
Run in full operational mode, i.e. really renice or kill things.
This is the default.

.SH "SIGNALS"

On
.B kill -HUP
the auto nice daemon will reload its configuration file and priority
database.


.SH "FILES"

.TP 0.5i
.B  /etc/and.conf
General configuration file. Stores default nice level, default interval,
the "time zones" and the database lookup affinity.

.TP 0.5i
.B /etc/and.priorities
The priority database (in plain text). Contains the (user, group, command,
nicelevels) tuples.

.TP 0.5i
Both files have their own manual pages.

.TP 0.5i
.B ./debug.and
Contains logging and status information for debugging purposes. 
Used in test mode only.

132 133 134 135 136 137
.TP 0.5i
.B /var/run/and.pid
Process identifier file.  Stores the PID for the currently running
.I and
process.  This file is not written in test mode.

138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
.SH "SEE ALSO"
.BR and.conf (5),
.BR and.priorities (5),
.BR kill (1),
.BR regex (7),
.BR renice (8)


.SH "INTERNET"
.B http://and.sourceforge.net/


.SH "AUTHOR"
The auto nice daemon and this manual page were written by
Patrick Schemitz <schemitz@users.sourceforge.net>