Debian Codegraph @

man8/service.rst

raw
1 ===================
2 service
3 ===================
4
5 ---------------------------------------------------------
6 run a System V init script
7 ---------------------------------------------------------
8
9 :Manual section: 8
10 :Manual group: System Manager's Manual
11 :Author:
12 Miloslav Trmac <[email protected]>,
13 Petter Reinholdtsen <[email protected]>
14
15 :Version: Jan 2006
16 :Copyright: 2006 Red Hat, Inc., Petter Reinholdtsen <[email protected]>
17 :License: GNU General Public License v2 (GPLv2)
18
19
20 SYNOPSIS
21 ========
22
23
24 ``service`` *SCRIPT* *COMMAND* [*OPTIONS*]
25
26 ``service`` ``--status-all``
27
28 ``service`` ``--help`` | ``-h`` | ``--version``
29
30
31 DESCRIPTION
32 ===========
33
34 ``service`` runs a System V init script or systemd unit in as predictable an
35 environment as possible, removing most environment variables and with the
36 current working directory set to ``/``.
37
38
39 The
40 *SCRIPT*
41 parameter specifies a System V init script, located in */etc/init.d/SCRIPT*,
42 or the name of a systemd unit. The existence of a systemd unit of the same
43 name as a script in ``/etc/init.d`` will cause the unit to take precedence
44 over the init.d script.
45 The supported values of *COMMAND* depend on the invoked script. ``service``
46 passes *COMMAND* and *OPTIONS* to the init script unmodified. For systemd
47 units, start, stop, status, and reload are passed through to their
48 systemctl/initctl equivalents.
49
50 All scripts should support at least the ``start`` and ``stop`` commands.
51 As a special case, if *COMMAND* is ``--full-restart``, the script is run
52 twice, first with the ``stop`` command, then with the ``start``
53 command. Note, that unlike ``update-rc.d``\(8\), ``service`` does not
54 check ``/usr/sbin/policy-rc.d``.
55
56 ``service --status-all`` runs all init scripts, in alphabetical order, with
57 the ``status`` command. The status is [ + ] for running services, [ - ] for
58 stopped services and [ ? ] for services without a ``status`` command. This
59 option only calls status for sysvinit jobs.
60
61 EXIT CODES
62 ==========
63
64 ``service`` calls the init script and returns the status returned by it.
65
66 FILES
67 ==========
68
69 ``/etc/init.d``
70 The directory containing System V init scripts.
71
72 ``/{lib,run,etc}/systemd/system``
73 The directories containing systemd units.
74
75 ENVIRONMENT
76 ===========
77
78 ``LANG``, ``LANGUAGE``, ``LC_CTYPE``, ``LC_NUMERIC``, ``LC_TIME``, ``LC_COLLATE``, ``LC_MONETARY``, ``LC_MESSAGES``, ``LC_PAPER``, ``LC_NAME``, ``LC_ADDRESS``, ``LC_TELEPHONE``, ``LC_MEASUREMENT``, ``LC_IDENTIFICATION``, ``LC_ALL``, ``TERM``, ``PATH``
79 The only environment variables passed to the init scripts.
80
81 SEE ALSO
82 ========
83
84 | */etc/init.d/skeleton*
85 | ``update-rc.d``\(8\)
86 | ``init``\(8\)
87 | ``invoke-rc.d``\(8\)
88 | ``systemctl``\(1\)