PROPHET/OS

NAME

vigil: it acts on one vigil

SYNOPSIS

vigil [start|stop|enable|disable] <name>

DESCRIPTION

It acts on one vigil. What there is and how it is doing stands in vigils; this command changes it.

vigil start <name>      run it now, and write nothing
vigil stop <name>       stop it now, and write nothing
vigil enable <name>     run it now and at every start
vigil disable <name>    stop it now and keep it stopped
vigil <name>            whether it runs now and whether it runs again
vigil reload            read the list anew, without a restart

Two pairs, and each pair says what it is. start and stop hold for this boot only: a vigil somebody started stays started until somebody stops it or the level changes. enable and disable are the decision that outlives the restart, and they act at once as well, because otherwise every decision costs two commands and the second one gets forgotten.

The decision lives in the line of the vigil, as a minus in front of the level: 3 becomes -3. One list and no second file that says which of its entries do not count, and the level is kept while it is off, so switching back on does not have to guess what it was.

A vigil is named by its program: vigil stop ntpv stops ntpv. Where the same program stands twice with different arguments, that line carries program:tag, and vigil stop httpv:admin means that one.

The configuration is /system/config/vigils.yaml, one entry under vigils: per vigil, and init reads the same file at startup. init also writes it: this command asks over the channel, through the same right check as start and stop, for a program that may ask another to write a system file may not write it itself.

A vigil that fails is thrown again with a doubling pause, and the attempt that would need longer than a quarter of an hour is not made: the vigil goes to maintenance and waits. vigil start <name> is what takes it out of there, and it clears the counter as well, so the next failure starts the pause over at one second (R12-INIT-04).

There is no word status here. That name belongs to the tool that says what the last program returned, and the bare name answers the question anyway, the way man <name> does.

runs.

reload

The file is read once at the start, so a line somebody adds reaches the machine only through a restart of init. vigil reload reads it again while the machine runs: a vigil that stands in the file as before keeps everything the file does not carry, its run, its state and its counters, and what the file says about it holds at its next start; a line that is new becomes a vigil the level starts; a line that is gone stops and keeps its place until the next start of init, because a run that is still in the air is reaped out of that list.

EXAMPLE

$ vigil --help
vigil [start|stop|enable|disable] <name>
  start and stop act now, enable and disable hold at the next start as well
  without a word: whether it runs now and whether it runs again
  a vigil is named by its program; `vigils` shows what there is
vigil reload
  read the list of the vigils anew, without a restart

SEE ALSO

vigils` (which shows all of this), init, log, loggerv