1INNWATCH.CTL(5)           InterNetNews Documentation           INNWATCH.CTL(5)
2
3
4

NAME

6       innwatch.ctl - List of supervisory actions taken by innwatch
7

DESCRIPTION

9       The file pathetc/innwatch.ctl is used to determine what actions are
10       taken during the periodic supervisions by innwatch.
11
12       The file consists of a series of lines; blank lines and lines beginning
13       with a number sign ("#") are ignored.  All other lines consist of seven
14       fields, each preceded by a delimiting character, for example:
15
16           !state!when!condition!test!limit!command!reason
17
18       or:
19
20           @state@when@condition@test@limit@command@reason
21
22       The delimiter can be any one of several non-alphanumeric characters
23       that does not appear elsewhere in the line; there is no way to quote it
24       to include it in any of the fields.  Any of "!", ",", ":", "@", ";", or
25       "?" is a good choice.  Each line can have a different delimiter; the
26       first character on each line is the delimiter for that line.  White
27       space surrounding delimiters, except before the first, is ignored, and
28       does not form part of the fields; white space within fields is
29       permitted.  All delimiters must be present.
30
31       The first field is the state to enter if the condition for this control
32       line is true.  It is used as an internal state indicator and in ctlinnd
33       messages to control the server.  If this field is empty, the line
34       number is used.
35
36       The second field specifies when this control line should be used.  It
37       consists of a list of states and special indicators, separated by
38       whitespace.  If the current state matches against any of the states in
39       this field, this line will be used as described below.  The values that
40       may be used are:
41
42       "-" This line matches if the current state is the same as the label on
43           this line, or if the current state is "run", the initial state.
44           This is also the default state if this field is empty.
45
46       "+" This line matches if the current state is "run".
47
48       "*" This line always matches.
49
50       "label"
51           This line matches if the current state is the specified "label".
52
53       "-label"
54           This line matches if the current state is not the specified
55           "label".
56
57       The third field specifies a shell command that is invoked if this line
58       matches.  Do not use any shell filename expansion characters such as
59       "*", "?", or "[" (even quoted, they're not likely to work as intended).
60       The command is executed with its current directory set to the news
61       spool articles directory (patharticles).
62
63       If the command succeeds, as indicated by its exit status, it is
64       expected to have printed a single integer to standard output.  This
65       gives the value of this control line, to be used below.  If the command
66       fails, the line is ignored.
67
68       The fourth field specifies the operator to use to test the value
69       returned above.  It should be one of the two letter numeric test
70       operators defined in test(1) such as "eq", "lt" and the like.  The
71       leading dash ("-") should not be included.
72
73       The fifth field specifies a constant with which to compare the value
74       using the operator just defined.  This is done by invoking the command:
75
76           test value -operator constant
77
78       The line is said to succeed if it returns true.
79
80       The sixth field specifies what should be done if the line succeeds, and
81       in some cases if it fails.  Any of the following words may be used:
82
83       "throttle"
84           Causes innwatch to throttle the server if this line succeeds.  It
85           also sets the state to the value of the line's label.  If the line
86           fails, and the state was previously equal to the label on this line
87           (that is, this line had previously succeeded), then a "ctlinnd go"
88           command will be sent to the server, and innwatch will return to the
89           "run" state.  The "ctlinnd throttle" command is only performed if
90           the current state is "run" or a state other than the label of this
91           line, regardless of whether the command succeeds.
92
93       "pause"
94           Is identical to "throttle" except that the server is paused via the
95           "ctlinnd pause" command.
96
97       "shutdown"
98           Sends a "ctlinnd shutdown" command to the server.  It is for
99           emergency use only.
100
101       "flush"
102           Sends a "ctlinnd flush" command to the server.
103
104       "go"
105           Causes innwatch to send a "ctlinnd go" command to the server and to
106           set the state to "run".
107
108       "exit"
109           Causes innwatch to exit.
110
111       "skip"
112           The remainder of the control file is skipped for the current pass.
113
114       The last field specifies the reason that is used in those "ctlinnd"
115       commands that require one.  More strictly, it is part of the reason, as
116       innwatch appends some information to it.
117
118       In order to enable other sites to recognize the state of the local innd
119       server, this field should usually be set to one of several standard
120       values.  Use for instance "No space" if the server is rejecting
121       articles because of a lack of filesystem resources, or "loadav" if the
122       server is rejecting articles because of a lack of CPU resources.
123
124       Once innwatch has taken some action as a consequence of its control
125       line, it skips the rest of the control file for this pass.  If the
126       action was to restart the server (that is, issue a "ctlinnd go"
127       command), then the next pass will commence almost immediately, so that
128       innwatch can discover any other condition that may mean that the server
129       should be suspended again.
130

EXAMPLES

132           !!! inndf . ! lt ! 10000 ! throttle ! No space (spool)
133           !!! inndf -i . ! lt ! 1000 ! throttle ! No space (inodes)
134
135       The first line causes the server to be throttled if the free space
136       drops below 10000 units (using whatever units inndf uses), and
137       restarted again when free space increases above the threshold.
138
139       The second line does the same for inodes.
140
141       The next three lines act as a group and should appear in the following
142       order.  It is easier to explain them, however, if they are described
143       from the last up.
144
145           ! load ! load hiload ! loadavg ! lt ! 5 ! go ! loadav
146           : hiload : + load : loadavg : gt : 8 : throttle : loadav
147           / load / + / loadavg / gt / 6 / pause / loadav
148
149       The final line causes the server to be paused if innwatch is in the
150       "run" state and the load average rises to, or above, six.  The state is
151       set to "load" when this happens.  The previous line causes the server
152       to be throttled when innwatch is in the "run" or "load" state, and the
153       load average rises above eight.  The state is set to "hiload" when this
154       happens.  Note that innwatch can switch the server from "pause" to
155       "throttle" if the load average rises from below six to between six and
156       seven, and then to above eight.  The first line causes the server to be
157       sent a "ctlinnd go" command if innwatch is in the "load" or "hiload"
158       state, and the load average drops below five.
159
160       Note that all three lines assume a mythical command "loadavg" that is
161       assumed to print the current load average as an integer.  In more
162       practical circumstances, a pipe of uptime into AWK is more likely to be
163       useful.
164

BUGS

166       The "run" state is not actually identified by the label with that three
167       letter name, and using it will not work as expected ("go" is the wanted
168       state in that case).
169
170       Using an unusual character for the delimiter such as "(", "*", "&",
171       "`", "'", and the like, is likely to lead to obscure and hard to locate
172       bugs.
173

HISTORY

175       Written by <kre@munnari.oz.au> for InterNetNews.  Rewritten into POD by
176       Julien Elie.
177

SEE ALSO

179       ctlinnd(8), inndf(8), news.daily(8), rc.news(8).
180
181
182
183INN 2.6.5                         2022-01-23                   INNWATCH.CTL(5)
Impressum