id = "daemon"
name = "daemon"
homepage = "https://libslack.org/daemon/"
description = "Turns other processes into daemons."
executables = ["daemon"]
[dotfiles]
paths = ["~/.daemonrc", "~/.daemonrc.d/*"]
exclude = []
secret = []
[commands]
format = 1
label = "Run a command as a daemon"
description = "Start a program detached as a daemon, optionally as a named, respawning instance with log files. Management of existing named daemons (--running, --stop, --restart, --signal, --list), config-file and chroot options are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true }
[[commands.source]]
id = "help"
kind = "manual"
url = "https://libslack.org/daemon/manual/daemon.1.html"
revision = "daemon(1) manual"
evidence = """
usage: daemon [options] [--] [cmd arg...]
-n, --name=name - Guarantee a single named instance
-X, --command="cmd" - Specify the client command as an option
-F, --pidfile=/path - Override standard pidfile name and location
-u, --user=user[:[group]] - Run the client as user[:group]
-D, --chdir=path - Run the client in directory path
-e, --env="var=val" - Set a client environment variable
-i, --inherit - Inherit environment variables
-r, --respawn - Respawn the client when it terminates
-a, --acceptable=# - Minimum acceptable client duration (seconds)
-A, --attempts=# - Respawn # times on error before delay
-L, --delay=# - Delay between respawn attempt bursts (seconds)
-M, --limit=# - Maximum number of respawn attempt bursts
-f, --foreground - Run the client in the foreground
-p, --pty[=noecho] - Allocate a pseudo terminal for the client
-l, --errlog=spec - Send daemon's error output to syslog or file
-o, --output=spec - Send client's output to syslog or file
-O, --stdout=spec - Send client's stdout to syslog or file
-E, --stderr=spec - Send client's stderr to syslog or file
-v, --verbose[=level] - Set the verbosity level
"""
[[commands.field]]
id = "name"
label = "Name"
description = "Guarantee a single named instance; also needed to manage it later."
type = "string"
option = ["--name", "-n"]
sources = ["help"]
[[commands.field]]
id = "pidfile"
label = "Pidfile"
type = "path"
option = ["--pidfile", "-F"]
path = { kind = "file", role = "output", must_exist = false }
effect = "overwrite"
sources = ["help"]
[[commands.field]]
id = "user"
label = "Run as user[:group]"
type = "string"
option = ["--user", "-u"]
sources = ["help"]
[[commands.field]]
id = "chdir"
label = "Working directory"
type = "path"
option = ["--chdir", "-D"]
path = { kind = "directory", role = "input", must_exist = true }
sources = ["help"]
[[commands.field]]
id = "env"
label = "Environment variable"
description = "var=val; repeat to set several."
type = "string"
option = ["--env", "-e"]
multiple = true
sources = ["help"]
[[commands.field]]
id = "inherit"
label = "Inherit environment"
type = "boolean"
option = ["--inherit", "-i"]
sources = ["help"]
[[commands.field]]
id = "respawn"
label = "Respawn when it exits"
type = "boolean"
option = ["--respawn", "-r"]
sources = ["help"]
[[commands.field]]
id = "attempts"
label = "Respawn attempts before delay"
type = "integer"
option = ["--attempts", "-A"]
sources = ["help"]
[[commands.field]]
id = "delay"
label = "Delay between bursts (seconds)"
type = "integer"
option = ["--delay", "-L"]
sources = ["help"]
[[commands.field]]
id = "foreground"
label = "Run client in foreground"
type = "boolean"
option = ["--foreground", "-f"]
sources = ["help"]
[[commands.field]]
id = "errlog"
label = "Daemon error log"
description = "syslog spec or file."
type = "string"
option = ["--errlog", "-l"]
sources = ["help"]
[[commands.field]]
id = "output"
label = "Client output log"
description = "syslog spec or file."
type = "string"
option = ["--output", "-o"]
sources = ["help"]
[[commands.field]]
id = "verbose"
label = "Verbose"
type = "boolean"
option = ["--verbose", "-v"]
sources = ["help"]
[[commands.field]]
id = "command"
label = "Command and arguments"
type = "string"
position = 0
multiple = true
sources = ["help"]
[[commands.task]]
id = "simple"
label = "Run a command detached"
fields = ["name", "output", "errlog", "chdir", "command"]
required = ["command"]
[[commands.task]]
id = "supervised"
label = "Named, respawning service"
set = { respawn = [true] }
lock = ["respawn"]
fields = ["name", "respawn", "attempts", "delay", "output", "errlog", "chdir", "command"]
required = ["name", "command"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["name", "command", "output", "errlog", "chdir", "respawn"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["pidfile", "user", "env", "inherit", "attempts", "delay", "foreground", "verbose"]