GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
APPJAIL-HEALTHCHECK(1) FreeBSD General Commands Manual APPJAIL-HEALTHCHECK(1)

appjail-healthcheckKeep your jails healthy and running

appjail healthcheck get [-eHIipt] -n nro jail

appjail healthcheck list [-eHIipt] [-n nro] jail

appjail healthcheck remove [all|nro nro] jail

appjail healthcheck run jail

appjail healthcheck set [-E|-e] [-h command] [-i seconds] [-K seconds] [-k seconds] [-l signal] [-N name] [-n [auto|nro]] [-R number] [-r command] [-S signal] [-s seconds] [-T number] [-t seconds] [-u seconds] jail

The utility creates a healthchecker to supervise the jail's health. Technically it supervise whether a healthchecker runs correctly or not, so it checks the health of each healthchecker, not the jail, but we can assume that if a healthchecker fails, it's probably that the jail or the application running inside the jail will get the same result.

The options are as follows:

[-eHIipt] -n nro jail
Get information about current healthcheckers, that is, the keyword that represent the information to be obtained. Multiple keywords can be specified, which are displayed as a table-like interface in the order in which they are specified. If no keyword is specified, the defaults are nro, enabled, name, status, health_cmd and recover_cmd.

See KEYWORDS for a list of available keywords.

Not required when using -p. The \t character is used to delimit columns, so as not to show strange values, this option shows instead of \t in the case that a value contains the latter.
Shows the name of the columns.
Include empty values. By default, a minus sign is displayed when a value is empty.
Don't complain when nro doesn't exist.
Columnate the list.
Tabulate columns and values.
nro
Identifier.
[-eHIipt] [-n nro] jail
get but shows each keyword for each healthchecker in a nice table.
, -H, -I, -p, -t
get.
Perform the same task as described in get.
nro
nro.
[all|nro nro] jail
Remove a given healthchecker.
Remove all healthcheckers.
nro
Remove the healthchecker specified by nro.
jail
Run enabled healthcheckers in foreground.

Note that you should run this subcommand only for debugging, although you can view the log that appjail-startup(1) generates for this purpose. See appjail-logs(1) for more details.

One misconception is that you might think that healthcheckers work forever. They were not designed with this in mind because a service that constantly crashes is useless and should be fixed as soon as possible. What Healthcheckers do is inform you when the command they run fails and attempts to repair the service they supervise time out, but all of this works within limits defined by the set subcommand.

[-E|-e] [-h command] [-i seconds] [-K seconds] [-k seconds] [-l signal] [-N name] [-n [auto|nro]] [-R number] [-r command] [-S signal] [-s seconds] [-T number] [-t seconds] [-u seconds] jail
[-E|-e]
Enable (-E) or disable (-e) this healthchecker.
command
Command to evaluate the jail's health. If this option is not set, the command specified by the parameter is used.

Prefix command with host: to run the command from the host or with jail: to run the command from the jail. If no prefix is specified, the default value is the one specified by the parameter.

If the keyword %j is in command, it will be replaced by the jail name.

seconds
Interval to check the jail's health. If this option is not set, the value specified by the parameter is used.
seconds
Send a SIGKILL signal to the process created by the command specified by -r after seconds has been reached only if it is still running. If this option is not set, the value specified by the parameter is used.
seconds
Send a SIGKILL signal to the process created by the command specified by -h after seconds has been reached only if it is still running. If this option is not set, the seconds specified by the parameter is used.
signal
Signal to send on timeout. See -u. If this option is not set, the signal specified by the parameter is used.
name
Healthchecker name.
nro
Identifier. An identifier is composed of a positive number. Use auto (default) to get the lowest identifier value.
number
Number of attempts to heal the jail when it is failing and to start the command specified by -r. If this option is not set, the number specified by the parameter is used.
command
Command to heal the jail if it is considered to be failing. If this option is not set, the command specified by the parameter is used.

Prefix command with host: to run the command from the host or with jail: to run the command from the jail. If no prefix is specified, the default value is the one specified by the parameter.

If the keyword %j is in command, it will be replaced by the jail name.

signal
Signal to send on timeout. See -t. If this option is not set, the signal specified by the parameter is used.
seconds
Delay before running the healthchecker. If this option is not set, the value specified by the parameter is used.
number
The maximum number of attempts reached before the jail is considered unhealthy. If this option is not set, the value specified by the parameter is used.
seconds
Send the signal specified by -t to the process created by the command specified by -h after seconds has been reached only if it is still running. If this option is not set, the value specified by the parameter is used.
seconds
Send the signal specified by -l to the process created by the command specified by -r after seconds has been reached only if it is still running. If this option is not set, the value specified by the parameter is used.

All healthcheckers run in parallel and are described step by step as follows:

  1. Set the status to starting.
  2. If the is greater than 0, the process sleeps for the indicated seconds.
  3. Sleep the process for the given interval.
  4. Execute the health command. If the health type is host, it executes the given command on the host, otherwise if it is jail it executes the command on the jail.
  5. If the timeout (in seconds) is reached, the signal configured for the health command is sent.
  6. The SIGKILL signal is sent to the health command when its kill after (in seconds) is reached. You should probably set it to be greater than its timeout.
  7. If the health command is successful, set the status to healthy and repeat step , otherwise set the status to failing and if the current is reached, continue with step 8, otherwise continue with step 3.
  8. If the current total of recoveries is reached, set the status to unhealthy and close the healthchecker, otherwise add one to the recovery count and continue with step 9.
  9. Execute the recover command. If the recover type is host, it executes the given command on the host, otherwise if it is jail it executes the command on the jail.
  10. If the timeout (in seconds) is reached, the signal configured for the recover command is sent.
  11. The SIGKILL signal is sent to the recover command when its kill after (in seconds) is reached. You should probably set it to be greater than its timeout.
  12. If the recover command fails, set the status to unhealthy and close the healthchecker, otherwise set the status to healthy and continue with step 3.

Identifier.
Shows if the healthchecker is enabled, 0 if it is not.
See set -h.
See set -h.
See set -i.
See set -k.
See set -N.
See set -r.
See set -k.
See set -u.
See set -l.
See set -T.
See set -r.
See set -R.
See set -s.
Healthchecker status.

There are four states:

  • : Initial state. The healthchecker is initializing.
  • : The command specified by -h was executed successfully.
  • : The command specified by -h was executed unsuccessfully.
  • : State set when the total recovery attempts have been reached or when the recovery command (specified by -r) has been executed without success.
See set -t.
See set -S.

The appjail healthcheck utility exits 0 on success, and >0 if an error occurs.

appjail-logs(1) appjail-startup(1) appjail-quick(1) sysexits(3)

Jesús Daniel Colmenares Oviedo <DtxdF@disroot.org>

April 16, 2024 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.