Name

jobctl — control jobs

Synopsis

jobctl {label} disable

jobctl {label} enable

jobctl {label} list

jobctl {label} refresh

jobctl {label} restart

jobctl {label} mark [ degraded | maintenance | outdated ]

jobctl {label} clear

Description

jobctl manages jobs for jobd. Each job has a unique label.

The following subcommands and options are available:

jobctl label disable

Disable the job. If the job is currently running, it will be automatically stopped.

jobctl label enable

Enable the job. If the job is currently stopped, it will be automatically started.

jobctl [label] list

Display status information about a job. If label is omitted, status about all jobs will be displayed.

jobctl label refresh

Signal the job to reload it's running configuration. If the job is currently stopped, this subcommand has no effect. Not all jobs support the ability to refresh their configuration. If the new configuration has errors, the job may be transitioned to the "degraded" or "maintenance" states, depending on the severity of the error.

jobctl label restart [-f, --force]

Sends a SIGTERM to the process, waits for the process to exit, and then starts a new copy of the process.

If the --force option is added, the process will be forcibly stopped by sending it a SIGKILL. This may cause data loss and is only recommended if the process cannot be stopped through normal means.

By default, all members of the process' process group are sent the same signal.

jobctl label mark <degraded|maintenance|outdated>

Mark a job as faulted. The fault states are: degraded, maintenance, and outdated.

A job is "degraded" when a non-critical problem is detected with the configuration or the environment. The job will continue to run, but may not be providing optimal service. This situation usually calls for manual intervention by a system administrator.

A job is in "maintenance" mode when a critical problem is detected with the configuration or the environment. The job will not run, and will be stopped as part of transitioning to maintenance mode. This situation calls for manual intervention by a system administrator.

A job is in "outdated" mode when the job configuration has changed. The job will continue to run, but is using outdated information. This situation calls for an administrator to run the "jobctl refresh" command to cause the process to reload it's configuration.

jobctl label clear

Clear faults in a job, and attempt to bring the job back online. This command should be run by an administrator after they have taken action to correct the fault.

If the job is currently in the "degraded" state, (TODO: what happens? refresh or restart?)

If the job is currently in "maintenance" mode, clearing the job will cause it to be started.

If the job is currently in "outdated" mode, clearing the fault will cause the "refresh" command to be issued. Alternatively, running the "job refresh" command directly will implicitly clear the "outdated" fault.

ENVIRONMENT

The jobctl command does not rely on any environment variables.

EXIT STATUS

The jobctl command exits 0 on success, and >0 if an error occurs

SEE ALSO

jobcfg(1) jobd(8) job(5)

AUTHORS

Mark Heily <mark@heily.com>

BUGS

The list subcommand does not work if you provide a label.

The refresh and restart subcommands are not implemented yet.

The clear and mark subcommands are not implemented yet.