AND.PRIORITIES(5)
π NAME π
okay so bestie, this is and.priorities(5) β yes, section 5, file formats, we love a system-config moment π
β and it's all about /etc/and.priorities, the priority database for the auto nice daemon. that's the whole assignment. π
β¨ VERSION β¨
This manual page documents and.priorities for and version 1.2.2. periodt, that's the version, don't come for me.
π¦ DESCRIPTION π¦
So. This is the priority database file for and. It stores (user, group, command, parent, nicelevels) tuples β and from here on out we're calling those entries, okay? β and its whole job is to figure out the new nice level (or the kill signal, for that matter) when a job reaches one of the time limits defined in /etc/and.conf. (Peep lv1time, lv2time, and lv3time on the and.conf manual page for the deets, bestie.)
For how ambiguities between the fields (user, group, command, parent) are dealt with when searching the database to determine the new nice level for a job β that's the affinity setting in /etc/and.conf. Go look at it, it's giving very much "the rules of the search".
β οΈ not me warning you: if more than one entry matches with the same accuracy (e.g. with aparent=entry and anancestor=entry), the last entry wins! fr fr, order matters.
Comments start with a # in the first column. Empty lines are ignored. And unlike with other configuration files, lines cannot be concatenated with a backslash. Furthermore, this file is case sensitive. that's just how it is. π
π§ host-specific sections π§
and allows for host-specific sections in the configuration file. These work as lines of the form on somehost and work as follows: the parser determines if the host name (as returned by gethostname) matches the extended regular expression that follows the on keyword. If it does, it just keeps processing the file as if nothing had happened. If it does not match, however, everything up to the next on keyword is skipped. So if you want to end a host-specific section, you must write on .* (which matches all hosts) to switch back to normal. iconic behavior honestly. π
Don't forget to kill -HUP the auto nice daemon to enable the changes. like, the file edits are cute but nothing happens until you do that. π
π₯ SETTINGS π₯
A valid entry consists of a line of six columns, separated by one or more spaces. These columns are: (in that order)
- user β the user ID the command is running under. May be a user name (which will be looked up in the password file and, if enabled, via NIS), or a numeric user ID, or an asterisk for any user.
- group β the group ID the command is running under. May be a group name (which will be looked up in the group file and again, if enabled, via NIS), or a numeric group ID, or an asterisk for any group.
- command β the name of the command, without path. May be a command, a regular expression to match multiple commands, or an asterisk for any command. Note that
"foobar"will not match"/usr/bin/foobar"β you probably mean".*foobar"or even".*foobar.*". yeah. she's picky like that. π - parent β there are two modes of operation for the parent field, determined by a keyword:
parent=foobarwill match if a process' direct parent process matches the command or regular expression after the equal sign, whereasancestor=foobarwill match if any ancestor process matches. After the keyword and the equal sign goes the name of the parent process, without path. May be a command, a regular expression to match multiple commands, or an asterisk for any command. (You can just use the asterisk if you want to ignore parents for this entry.) Note that again"foobar"will not match"/usr/bin/foobar", as withcommand. - nicelevel 1 β the nice level after
lv1timeCPU time was used by the command. Positive numbers and0are interpreted as nice levels; negative numbers are interpreted as signals to be sent to the command. A "nice level" of19will almost stop the job,-9will actually kill it. (Like inkill -9.)lv1timecan be set in/etc/and.conf. - nicelevel 2 β same but after
lv2time. - nicelevel 3 β same but after
lv3time.
π EXAMPLES π
Here are some entries from the real world (i.e. from "my" cluster at the Institute). As lv[123]time, 5 min., 20 min., and 1 hour is assumed. (Which is the default. See /etc/and.conf for details.) You might also check the default priority database that comes with and.
# A finer default nice level
* * * * 4 8 12
# User dau is an idiot, so treat him like accordingly
dau * * * 19 19 19
# Netscape sometimes goes berserk, we must stop it
* * netscape * 4 -9 -9
# Most hosts are free for everyone but some are
# especially for the FOO group
* * * * 4 8 12
on (bar|baz)
* * * * 8 12 16
# ... or, more radical: * * * * -9 -9 -9
* foo * * 4 8 12
on .*
# KDE screen savers...
* * .*kss * 16 16 16
# Grid jobs (assuming they are started by a master
# process)
* * * ancestor=grid_master 10 10 10
# Now some clever yet deceitful user might start all
# his jobs using a shell script named grid_master.
# He shall regret... whereas the original grid_master
# (owned by grid) is left alone.
* * grid_master * -9 -9 -9
grid * grid_master * 0 0 0
ngl those comments in the examples are a lil spicy and very much a product of their time π but the entries? the entries are valid and that's what matters. the last two lines are lowkey genius β same command name, but one entry catches the impostor and the other protects the real one. ate. π
π FILES π
/etc/and.prioritiesβ the priority database (in plain text). Contains the(user, group, command, nicelevels)tuples. This is what this manual page is about. yeah. that one. π«Ά
π SEE ALSO π
and(8), and.conf(5), kill(1), regex(7), renice(8)
go read those too, iykyk.
π INTERNET π
π AUTHOR π
The auto nice daemon and this manual page were written by Patrick Schemitz <schemitz@users.sourceforge.net>
and that's the whole page, bestie π this one came out under Unix, dated 27 Mar 2005 β so if you're reading this in the group chat years later, hi, the info still slaps. now go kill -HUP something. β¨π¦πΈ
π¦ where this page comes from
- debian bookworm: and 1.2.2-4.2
- debian trixie: and 1.2.2-4.3+b2
- ubuntu jammy: and 1.2.2-4.2
- ubuntu noble: and 1.2.2-4.2
- ubuntu questing: and 1.2.2-4.3
- ubuntu resolute: and 1.2.2-4.3build1
- ubuntu stonking: and 1.2.2-4.3ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms