{
  "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
    },
    "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-n, --name=name           - Guarantee a single named instance\n-X, --command=\"cmd\"       - Specify the client command as an option\n-F, --pidfile=/path       - Override standard pidfile name and location\n-u, --user=user[:[group]] - Run the client as user[:group]\n-D, --chdir=path          - Run the client in directory path\n-e, --env=\"var=val\"       - Set a client environment variable\n-i, --inherit             - Inherit environment variables\n-r, --respawn             - Respawn the client when it terminates\n-a, --acceptable=#        - Minimum acceptable client duration (seconds)\n-A, --attempts=#          - Respawn # times on error before delay\n-L, --delay=#             - Delay between respawn attempt bursts (seconds)\n-M, --limit=#             - Maximum number of respawn attempt bursts\n-f, --foreground          - Run the client in the foreground\n-p, --pty[=noecho]        - Allocate a pseudo terminal for the client\n-l, --errlog=spec         - Send daemon's error output to syslog or file\n-o, --output=spec         - Send client's output to syslog or file\n-O, --stdout=spec         - Send client's stdout to syslog or file\n-E, --stderr=spec         - Send client's stderr to syslog or file\n-v, --verbose[=level]     - Set the verbosity level\n"
      }
    ],
    "field": [
      {
        "id": "name",
        "label": "Name",
        "description": "Guarantee a single named instance; also needed to manage it later.",
        "type": "string",
        "option": [
          "--name",
          "-n"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "pidfile",
        "label": "Pidfile",
        "type": "path",
        "option": [
          "--pidfile",
          "-F"
        ],
        "path": {
          "kind": "file",
          "role": "output",
          "must_exist": false
        },
        "effect": "overwrite",
        "sources": [
          "help"
        ]
      },
      {
        "id": "user",
        "label": "Run as user[:group]",
        "type": "string",
        "option": [
          "--user",
          "-u"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "chdir",
        "label": "Working directory",
        "type": "path",
        "option": [
          "--chdir",
          "-D"
        ],
        "path": {
          "kind": "directory",
          "role": "input",
          "must_exist": true
        },
        "sources": [
          "help"
        ]
      },
      {
        "id": "env",
        "label": "Environment variable",
        "description": "var=val; repeat to set several.",
        "type": "string",
        "option": [
          "--env",
          "-e"
        ],
        "multiple": true,
        "sources": [
          "help"
        ]
      },
      {
        "id": "inherit",
        "label": "Inherit environment",
        "type": "boolean",
        "option": [
          "--inherit",
          "-i"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "respawn",
        "label": "Respawn when it exits",
        "type": "boolean",
        "option": [
          "--respawn",
          "-r"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "attempts",
        "label": "Respawn attempts before delay",
        "type": "integer",
        "option": [
          "--attempts",
          "-A"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "delay",
        "label": "Delay between bursts (seconds)",
        "type": "integer",
        "option": [
          "--delay",
          "-L"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "foreground",
        "label": "Run client in foreground",
        "type": "boolean",
        "option": [
          "--foreground",
          "-f"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "errlog",
        "label": "Daemon error log",
        "description": "syslog spec or file.",
        "type": "string",
        "option": [
          "--errlog",
          "-l"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "output",
        "label": "Client output log",
        "description": "syslog spec or file.",
        "type": "string",
        "option": [
          "--output",
          "-o"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "verbose",
        "label": "Verbose",
        "type": "boolean",
        "option": [
          "--verbose",
          "-v"
        ],
        "sources": [
          "help"
        ]
      },
      {
        "id": "command",
        "label": "Command and arguments",
        "type": "string",
        "position": 0,
        "multiple": true,
        "sources": [
          "help"
        ]
      }
    ],
    "task": [
      {
        "id": "simple",
        "label": "Run a command detached",
        "fields": [
          "name",
          "output",
          "errlog",
          "chdir",
          "command"
        ],
        "required": [
          "command"
        ]
      },
      {
        "id": "supervised",
        "label": "Named, respawning service",
        "set": {
          "respawn": [
            true
          ]
        },
        "lock": [
          "respawn"
        ],
        "fields": [
          "name",
          "respawn",
          "attempts",
          "delay",
          "output",
          "errlog",
          "chdir",
          "command"
        ],
        "required": [
          "name",
          "command"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "name",
          "command",
          "output",
          "errlog",
          "chdir",
          "respawn"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "pidfile",
          "user",
          "env",
          "inherit",
          "attempts",
          "delay",
          "foreground",
          "verbose"
        ]
      }
    ]
  }
}
