{
    "mode": "man",
    "parameter": "sv",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/sv/8/json",
    "generated": "2026-08-29T07:23:27Z",
    "synopsis": "sv [-v] [-w sec] command services\n/etc/init.d/service [-w sec] command",
    "sections": {
        "NAME": {
            "content": "sv - control and manage services monitored by runsv(8)\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "sv [-v] [-w sec] command services\n\n/etc/init.d/service [-w sec] command\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The sv program reports the current status and controls the state of services monitored by the\nrunsv(8) supervisor.\n\nservices  consists of one or more arguments, each argument naming a directory service used by\nrunsv(8).  If service doesn't start with a dot or slash and doesn't end with a slash,  it  is\nsearched  in  the default services directory /etc/service/, otherwise relative to the current\ndirectory.\n\ncommand is one of up, down, status, once, pause, cont, hup, alarm,  interrupt,  1,  2,  term,\nkill,  or  exit,  or start, stop, restart, shutdown, force-stop, force-reload, force-restart,\nforce-shutdown.\n\nThe sv program can be sym-linked to /etc/init.d/ to provide an  LSB  init  script  interface.\nThe service to be controlled then is specified by the base name of the ``init script''.\n",
            "subsections": []
        },
        "COMMANDS": {
            "content": "status Report  the current status of the service, and the appendant log service if available,\nto standard output.\n\nup     If the service is not running, start it.  If the service stops, restart it.\n\ndown   If the service is running, send it the TERM signal, and the CONT signal.  If ./run ex‐\nits, start ./finish if it exists.  After it stops, do not restart service.\n\nonce   If the service is not running, start it.  Do not restart it if it stops.\n",
            "subsections": [
                {
                    "name": "pause cont hup alarm interrupt quit 1 2 term kill",
                    "content": "If the service is running, send it the STOP, CONT, HUP, ALRM, INT, QUIT,  USR1,  USR2,\nTERM, or KILL signal respectively.\n\nexit   If  the  service  is  running,  send  it the TERM signal, and the CONT signal.  Do not\nrestart the service.  If the service is down, and no log service exists, runsv(8)  ex‐\nits.   If  the  service is down and a log service exists, runsv(8) closes the standard\ninput of the log service and waits for it to terminate.  If the log service  is  down,\nrunsv(8) exits.  This command is ignored if it is given to an appendant log service.\n\nsv actually looks only at the first character of these commands.\n"
                },
                {
                    "name": "Commands compatible to LSB init script actions",
                    "content": "status Same as status.\n\nstart  Same  as up, but wait up to 7 seconds for the command to take effect.  Then report the\nstatus or timeout.  If the script ./check exists in the  service  directory,  sv  runs\nthis  script  to  check whether the service is up and available; it's considered to be\navailable if ./check exits with 0.\n\nstop   Same as down, but wait up to 7 seconds for the service to become  down.   Then  report\nthe status or timeout.\n\nreload Same as hup, and additionally report the status afterwards.\n"
                },
                {
                    "name": "restart",
                    "content": "Send  the commands term, cont, and up to the service, and wait up to 7 seconds for the\nservice to restart.  Then report the status or timeout.  If the script ./check  exists\nin  the  service directory, sv runs this script to check whether the service is up and\navailable again; it's considered to be available if ./check exits with 0.\n"
                },
                {
                    "name": "shutdown",
                    "content": "Same as exit, but wait up to 7 seconds for the runsv(8) process  to  terminate.   Then\nreport the status or timeout.\n"
                },
                {
                    "name": "force-stop",
                    "content": "Same  as  down,  but wait up to 7 seconds for the service to become down.  Then report\nthe status, and on timeout send the service the kill command.\n"
                },
                {
                    "name": "force-reload",
                    "content": "Send the service the term and cont commands, and wait up to 7 seconds for the  service\nto restart.  Then report the status, and on timeout send the service the kill command.\n"
                },
                {
                    "name": "force-restart",
                    "content": "Send the service the term, cont and up commands, and wait up to 7 seconds for the ser‐\nvice  to  restart.   Then  report the status, and on timeout send the service the kill\ncommand.  If the script ./check exists in the service directory, sv runs  this  script\nto  check  whether the service is up and available again; it's considered to be avail‐\nable if ./check exits with 0.\n"
                },
                {
                    "name": "force-shutdown",
                    "content": "Same as exit, but wait up to 7 seconds for the runsv(8) process  to  terminate.   Then\nreport the status, and on timeout send the service the kill command.\n"
                },
                {
                    "name": "try-restart",
                    "content": "if  the  service is running, send it the term and cont commands, and wait up to 7 sec‐\nonds for the service to restart.  Then report the status or timeout.\n\n"
                },
                {
                    "name": "Additional Commands",
                    "content": "check  Check for the service to be in the state that's been requested.  Wait up to 7  seconds\nfor  the  service to reach the requested state, then report the status or timeout.  If\nthe requested state of the service is up, and the script ./check exists in the service\ndirectory, sv runs this script to check whether the service is up  and  running;  it's\nconsidered to be up if ./check exits with 0.\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-v",
                    "content": "the command to take effect.  Then report the status or timeout.\n",
                    "flag": "-v"
                },
                {
                    "name": "-w _",
                    "content": "",
                    "flag": "-w"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "SVDIR  The environment variable $SVDIR overrides the  default  services  directory  /etc/ser‐\nvice/.\n\nSVWAIT The environment variable $SVWAIT overrides the default 7 seconds to wait for a command\nto take effect.  It is overridden by the -w option.\n",
            "subsections": []
        },
        "EXIT CODES": {
            "content": "sv  exits  0,  if  the  command was successfully sent to all services, and, if it was told to\nwait, the command has taken effect to all services.\n\nFor each service that caused an error (e.g. the directory is not  controlled  by  a  runsv(8)\nprocess,  or  sv  timed  out  while waiting), sv increases the exit code by one and exits non\nzero.  The maximum is 99.  sv exits 100 on error.\n\nIf sv is called with a base name other than sv: it exits 1 on timeout or trouble sending  the\ncommand;  if the command is status, it exits 3 if the service is down, and 4 if the status is\nunknown; it exits 2 on wrong usage, and 151 on error.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "runsv(8), chpst(8), svlogd(8), runsvdir(8), runsvchdir(8), runit(8), runit-init(8)\n\nhttp://smarden.org/runit/\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Gerrit Pape <pape@smarden.org>\n\nsv(8)",
            "subsections": []
        }
    },
    "summary": "sv - control and manage services monitored by runsv(8)",
    "flags": [
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "the command to take effect. Then report the status or timeout."
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": ""
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "runsv",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/runsv/8/json"
        },
        {
            "name": "chpst",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/chpst/8/json"
        },
        {
            "name": "svlogd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/svlogd/8/json"
        },
        {
            "name": "runsvdir",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/runsvdir/8/json"
        },
        {
            "name": "runsvchdir",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/runsvchdir/8/json"
        },
        {
            "name": "runit",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/runit/8/json"
        },
        {
            "name": "runit-init",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/runit-init/8/json"
        }
    ]
}