daemontools Tools
Tools to work with D.J. Bernstein's Daemontools.
Usage
daemontoolsHome
Print the daemontools service home path
Arguments
- none
Return codes
0- success1- No environment file found
Usage
daemontoolsInstall
Install daemontools and dependencies
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
Usage
daemontoolsInstallService [ --home serviceHome ] serviceFile [ serviceName ] [ --name serviceName ] [ --log logHome ] [ --escalate ] [ --log-arguments ... -- ] [ --arguments ... -- ] [ -- ... ]
Install a daemontools service which runs a binary as the file owner.
Installs a daemontools service with an optional logging daemon process. Uses daemontools/_service.sh and daemontools/_log.sh files as templates.
Arguments
--home serviceHome- Path. Optional. OverrideDAEMONTOOLS_HOMEwhich defaults to/etc/service. Specify once.serviceFile- Binary. Required. The daemon to run. The user of this file will be used to run this file and will run as this user and group.serviceName- String. Optional. The daemon service name. If not specified uses thebasenameofserviceFilewith any extension removed.--name serviceName- String. Optional. The daemon service name. If not specified uses thebasenameofserviceFilewith any extension removed.--log logHome- Path. Optional. The root logging directory where a directory calledserviceNamewill be created which contains themultilogoutputcurrent--escalate- Flag. Optional. Only if the source file is owned by a non-root user.--log-arguments ... --- ArgumentsList. Optional. List of arguments for the logger.--arguments ... --- ArgumentsList. Optional. List of arguments for the service.-- ...- Arguments. Optional. List of arguments for the service.
Return codes
0- Success1- Environment error2- Argument error
Usage
daemontoolsIsRunning [ --help ]
Is daemontools running?
Arguments
--help- Flag. Optional. Display this help.
Return codes
0- Success1- Environment error2- Argument error
Usage
daemontoolsProcessIds
List any processes associated with daemontools supervisors
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
Requires
pgrep read printf
Usage
daemontoolsRemoveService serviceName
Remove a daemontools service by name
Arguments
serviceName- String. Required. Service name to remove.
Return codes
0- Success1- Environment error2- Argument error
Usage
daemontoolsRestart
Restart the daemontools processes from scratch. Dangerous. Stops any running services and restarts them.
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
Usage
daemontoolsManager [ --home serviceHome ] [ --interval intervalSeconds ] [ --stat statFile ] [ --chirp chirpSeconds ] [ --action actions ] service0 file1
Runs a daemon which monitors files and operates on services. To request a specific action write the file with the action as the first line. Allows control across user boundaries. (e.g. user can control root services) Specify actions more than once on the command line to specify more than one set of permissions.
Arguments
--home serviceHome- Directory. Optional. Service directory home. Defaults toDAEMONTOOLS_HOME.--interval intervalSeconds- PositiveInteger. Optional. Number of seconds to check for presence of the file. Defaults to 10.--stat statFile- FileDirectory. Optional. Output thesvstatstatus to this file everyintervalSeconds. If not specified nothing is output.--chirp chirpSeconds- PositiveInteger. Optional. Output a message saying we're alive everychirpSecondsseconds.--action actions- String. Optional. Onr or more actions permittedstart,stop,restart, use comma to separate. Default isrestart.service0- Directory. Required. Service to control (e.g./etc/service/application/)file1- File. Required. Absolute path to a file. Presence offiletriggersaction
Return codes
0- Success1- Environment error2- Argument error
Environment
- DAEMONTOOLS_HOME - Directory. Constant for the directory where services are monitored by daemontools
- The default home directory for
daemontools
Non-production starting/stopping
Usage
daemontoolsExecute [ --help ]
Launch the daemontools daemon Do not use this for production Run the daemontools root daemon
Arguments
--help- Flag. Optional. Display this help.
Return codes
0- Success1- Environment error2- Argument error
Usage
daemontoolsTerminate [ --timeout seconds ]
Terminate daemontools as gracefully as possible
Arguments
--timeout seconds- Integer. Optional.
Return codes
0- Success1- Environment error2- Argument error
Requires
throwArgument decorate usageArgumentInteger throwEnvironment catchEnvironment validate statusMessage svscanboot id svc svstat