{
    "mode": "man",
    "parameter": "SERVICE",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/SERVICE/8/json",
    "generated": "2026-10-06T11:45:36Z",
    "synopsis": "service SCRIPT COMMAND [OPTIONS]",
    "sections": {
        "NAME": {
            "content": "service - run a System V init script\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "service SCRIPT COMMAND [OPTIONS]\n",
            "subsections": [
                {
                    "name": "service --status-all",
                    "content": "service --help | -h | --version\n"
                }
            ]
        },
        "DESCRIPTION": {
            "content": "service  runs a System V init script or systemd unit in as predictable an environment as pos‐\nsible, removing most environment variables and with the current working directory set to /.\n\nThe SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT, or  the\nname  of  a  systemd  unit.  The  existence of a systemd unit of the same name as a script in\n/etc/init.d will cause the unit to take precedence over the  init.d  script.   The  supported\nvalues  of  COMMAND  depend on the invoked script. service passes COMMAND  and OPTIONS to the\ninit script unmodified. For systemd units, start, stop, status, and reload are passed through\nto their systemctl/initctl equivalents.\n\nAll scripts should support at least the start and stop commands.  As a special case, if  COM‐\nMAND  is  --full-restart, the script is run twice, first with the stop command, then with the\nstart command. Note, that  unlike  update-rc.d(8),  service  does  not  check  /usr/sbin/pol‐\nicy-rc.d.\n\nservice  --status-all  runs all init scripts, in alphabetical order, with the status command.\nThe status is [ + ] for running services, [ - ] for stopped services and [ ? ]  for  services\nwithout a status command.  This option only calls status for sysvinit jobs.\n",
            "subsections": []
        },
        "EXIT CODES": {
            "content": "service calls the init script and returns the status returned by it.\n",
            "subsections": []
        },
        "FILES": {
            "content": "",
            "subsections": [
                {
                    "name": "/etc/init.d",
                    "content": "The directory containing System V init scripts.\n"
                },
                {
                    "name": "/{lib,run,etc}/systemd/system",
                    "content": "The directories containing systemd units.\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "",
            "subsections": [
                {
                    "name": "LANG, LANGUAGE, LC_CTYPE, LC_NUMERIC, LC_TIME, LC_COLLATE, LC_MONETARY, LC_MESSAGES, LC_PA‐",
                    "content": ""
                },
                {
                    "name": "PER, LC_NAME, LC_ADDRESS, LC_TELEPHONE, LC_MEASUREMENT, LC_IDENTIFICATION, LC_ALL, TERM, PATH",
                    "content": "The only environment variables passed to the init scripts.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "/etc/init.d/skeleton\nupdate-rc.d(8)\ninit(8)\ninvoke-rc.d(8)\nsystemctl(1)\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Miloslav Trmac <mitr@redhat.com>, Petter Reinholdtsen <pere@hungry.com>\n\nLicense: GNU General Public License v2 (GPLv2)\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "2006 Red Hat, Inc.,  Petter Reinholdtsen <pere@hungry.com>\n\n\nJan 2006                                                                                  SERVICE(8)",
            "subsections": []
        }
    },
    "summary": "service - run a System V init script",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "update-rc.d",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/update-rc.d/8/json"
        },
        {
            "name": "init",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/init/8/json"
        },
        {
            "name": "invoke-rc.d",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/invoke-rc.d/8/json"
        },
        {
            "name": "systemctl",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/systemctl/1/json"
        }
    ]
}