AND.CONF(5)

πŸ’– AND.CONF(5) πŸ’–

okay bestie, welcome to the manual page for /etc/and.conf β€” the general config file for the auto nice daemon. it lives in the File Formats section of the manual, and yes, the vibe is immaculate. πŸŽ€


✨ VERSION ✨

this page documents and.conf for and version 1.2.2. noted. πŸ’…


🌸 DESCRIPTION 🌸

so this is THE general config file for and, your fave little auto nice daemon. it holds all the settings like the default nice level, the renice intervals, the three stages of renicing, and the affinity of the priority database β€” aka the weight of (user, group, command) when it's out here resolving nice levels from the database. all of those get explained below, don't worry. 🫢

now, the rules of the file, listen up:

  • comments start with a # in the first column β€” first column only, she's picky
  • empty lines are just ignored, they're not the moment
  • unlike other config files, you cannot concatenate lines with a backslash. no. not happening. 🚫
  • and this file is case sensitive. periodt.

and here's the iconic part: and allows for host-specific sections in the config file. these work as lines of the form on somehost, and they work like this: the parser checks if the host name (as returned by gethostname) matches the extended regular expression that follows the on keyword. if it matches β€” slay, 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 wanna end a host-specific section, you have to write on .* (which matches all hosts, she's universal like that) to switch back to normal.

🚨 bestie do NOT forget to kill -HUP the auto nice daemon to actually enable the changes. no cap.

⭐ SETTINGS ⭐

  • defaultnice β€” the default nice level. a number between 0 and 19. jobs where no entry can be found in /etc/and.priorities get reniced to this level, no matter how much CPU time they've used so far. if you'd rather renice unknown jobs gradually, you can do that by supplying three asterisks as the (user, group, command) tuple in /etc/and.priorities. the default nice level is 0.
  • interval β€” the default interval between nice checks of the auto nice daemon, in seconds. this value can be overridden by the -i command-line option of and. the default interval is 60 seconds.
  • lv1time
  • lv2time
  • lv3time β€” the ranges for the nice levels. jobs with less than lv1time seconds CPU time are not reniced. jobs between lv1time and lv2time seconds get reniced to the first level in an.priorities; jobs between lv2time and lv3time seconds to the second level; jobs with more than lv3time seconds get reniced to the third level. defaults are 120, 1200, and 3600 seconds.
  • minuid, mingid β€” minimum user id and group id to be considered for renicing. processes whose user id is below minuid are left alone, and same for processes with a group id below mingid. (note that even if you set minuid to zero, root processes are left alone. yes really. πŸ™ˆ)
  • affinity β€” the strategy for picking the right priority entry for a user/group/job triple. the strategy is a permutation of "cgu", "c"ommand, "g"roup, "u"ser. the order specifies the affinity of the priority lookup method. suppose you have an entry for all jobs of user foo, another entry for all jobs of group bar, and yet another entry for the command baz. furthermore suppose user foo (who happens to belong to group bar) starts a job named baz β€” which entry should be chosen?? this is what the affinity setting means. for example "cug" means an exact match of the command has priority over both an exact match of the user and the group. the default affinity is "cug", which is probably sensible for most cases, since it's the job that takes up CPU time, not the user or group ID. main character energy is the job, fr fr. πŸ‘‘

🌈 EXAMPLES 🌈

Default Configuration

# This is the default configuration:
defaultnice 0
interval 60
lv1time 300
lv2time 1800
lv3time 3600
affinity cug
minuid 0
mingid 0

Default Configuration, with terminals

# Normal default configuration for all
defaultnice 0
interval 60
lv1time 300
lv2time 1800
lv3time 3600
# Hosts foo, bar, baz are terminals and must
# be more responsive, so earlier renice.
on (foo|bar)
lv1time 120
lv2time 600
lv3time 1200
on .*
# This is for all hosts again
affinity cug

Group-specific Hosts

defaultnice 0
interval 60
lv1time 300
lv2time 1800
lv3time 3600
# Normal affinity for all hosts.
affinity cug
# Hosts bar, baz belong to group foo, which
# is privileged on these hosts, so override
# affinity. (Note regexp!)
on ba[rz]
affinity guc
on .*
minuid 500
mingid 100

πŸ¦‹ FILES πŸ¦‹

  • /etc/and.conf β€” general configuration file. stores the default nice level, default interval, the "time zones" and the database lookup affinity. this is literally what this whole manual page is about. iykyk. πŸ’œ

πŸŽ€ SEE ALSO πŸŽ€

and(8), and.priorities(5), kill(1), regex(7), renice(8)


🌐 INTERNET 🌐

http://and.sourceforge.net/


πŸ‘‘ AUTHOR πŸ‘‘

the auto nice daemon and this manual page were written by Patrick Schemitz <schemitz@users.sourceforge.net>. iconic behavior, we love to see it. 🫢


and that's the whole page bestie!! this all shipped back on 27 Mar 2005 under the Unix manual section, and honestly? it still ate. go forth, configure your daemon, and remember to kill -HUP πŸ’–βœ¨