Name

job — configuration format for jobd

DESCRIPTION

Jobs are configured using a set of key/value pairs within a JSON configuration file. The only required key is the Label; all other keys are optional.

The following configuration options are available:

Description

A short, one-line description of what the job does.

Enable

If true, the job will be automatically enabled. If the job is on-demand, it will be started as soon as the on-demand conditions are met. If the job is scheduled, it will be started according to the schedule. Otherwise, the job will start immediately.

EnableGlobbing

If true, the program arguments will be passed to glob(3) for possible expansion.

EnvironmentVariables

A dictionary of environment variables to set in the process.

All jobs will be started with a minimal set of environment variables inherited from jobd. These variables may include one or more of the following:

DISPLAY, HOME, LOGNAME, PATH,

NLSPATH, LANG,

PWD, SHELL, TMPDIR, TZ, USER,

LC_ALL, LC_COLATE, LC_CTYPE, and other POSIX locale variables.

Any variables defined in the EnvironmentVariables section will override the default values inherited from jobd.

GroupName

The name of the group that the program will run as.

InitGroups

If false, the initgroups(3) function will not be called to setup the supplemental groups.

KeepAlive

If true, the program will be automatically restarted if it exits.

Label

A globally unique job identifier. Labels should be constructed using reverse domain name notation.

Program

If a string is provided, the string will be treated as the full path to the program to be executed. If the program takes any arguments, you must pass an array instead.

If an array is provided, the array contains arguments that will be passed to exec(3) to execute the program.

Sockets

An array of sockets to be created by jobd(8) and used to launch the job when a client connects to a socket. (TODO: more documentation on this)

StandardErrorPath

The path to a file where stdio(3) standard error should be redirected. By default, errors will be redirected to /dev/null.

StandardInPath

The path to a file where stdio(3) standard input should be redirected. By default, input will be redirected from /dev/null.

StandardOutPath

The path to a file where stdio(3) standard output should be redirected. By default, output will be redirected to /dev/null.

StartInterval

If an integer is provided, the job will be started on a regular interval. The interval should be specified in seconds.

Umask

The value to pass to umask(2) before executing the program. It should be specified in octal notation using a string.

RootDirectory

An alternate root directory for the process, entered via a call to chroot(2).

ThrottleInterval

The amount of time to wait before automatically restarting a process if it dies. This has no effect unless the KeepAlive key is set to true. The default throttle interval is ten seconds.

UserName

The name of the user that the program will run as.

WorkingDirectory

A directory to chdir(2) into prior to executing the process.

EXAMPLES

The following example will write the words "Hello world" to a file named /tmp/hello.log:

{
	"Label": "com.example.hello_world",
	"Program": ["/usr/bin/printf", "Hello world\n"],
	"StandardOutPath": "/tmp/hello.log",
	"Enable": true
}

SEE ALSO

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

AUTHORS

Mark Heily <mark@heily.com>

BUGS

The Description key is not implemented yet.

The EnableGlobbing key is not implemented yet.

The Sockets key is not implemented yet.