daemontools Tools
Tools to work with D.J. Bernstein's Daemontools.
daemontoolsHome
Print the daemontools service home path
Usage
daemontoolsHome
Print the daemontools service home path Return Code: 0 - success Return Code: 1 - No environment file found
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
daemontoolsInstall
Install daemontools and dependencies
Usage
daemontoolsInstall
Install daemontools and dependencies
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
daemontoolsInstallService
Install a daemontools service which runs a binary as the
Usage
daemontoolsInstallService [ --log-path path ] serviceFile [ serviceName ]
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- Optional. Path. OverrideDAEMONTOOLS_HOMEwhich defaults to/etc/service. Specify once.serviceFile- Required. Binary. 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- Optional. String. The daemon service name. If not specified uses thebasenameofserviceFilewith any extension removed.--name serviceName- Optional. String. The daemon service name. If not specified uses thebasenameofserviceFilewith any extension removed.--log logHome- Optional. Path. The root logging directory where a directory calledserviceNamewill be created which contains themultilogoutputcurrent--escalate- Optional. Flag. Only if the source file is owned by a non-root user.--log-arguments ... --- Optional. ArgumentsList. List of arguments for the logger.--arguments ... --- Optional. ArgumentsList. List of arguments for the service.-- ...- Arguments. Optional. List of arguments for the service.
Return codes
0- Success1- Environment error2- Argument error
daemontoolsIsRunning
Is daemontools running?
Usage
daemontoolsIsRunning
Is daemontools running?
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
daemontoolsProcessIds
List any processes associated with daemontools supervisors
Usage
daemontoolsProcessIds
List any processes associated with daemontools supervisors
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
Requires
pgrep read printf
daemontoolsRemoveService
Remove a daemontools service by name
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
daemontoolsRestart
Restart the daemontools processes from scratch.
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
daemontoolsManager
Runs a daemon which monitors files and operates on services.
Usage
daemontoolsManager [ --interval seconds ] [ --stat statFile ] [ --action actions ] service0 file0 [ service1 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- Optional. Service directory home. Defaults toDAEMONTOOLS_HOME.--interval intervalSeconds- Optional. Number of seconds to check for presence of the file. Defaults to 10.--stat statFile- Optional. Output thesvstatstatus to this file everyintervalSeconds. If not specified nothing is output.--chirp chirpSeconds- Optional. Output a message saying we're alive everychirpSecondsseconds.--action actions- Optional. String. Onr or more actions permittedstart,stop,restart, use comma to separate. Default isrestart.service0- Required. Directory. Service to control (e.g./etc/service/application/)file1- Required. File. 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
daemontoolsExecute
Launch the daemontools daemon
Usage
daemontoolsExecute
Launch the daemontools daemon Do not use this for production Run the daemontools root daemon
Arguments
- none
Return codes
0- Success1- Environment error2- Argument error
daemontoolsTerminate
Terminate daemontools as gracefully as possible
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 usageRequireBinary statusMessage svscanboot id svc svstat