File: service.8

package info (click to toggle)
sysvinit 2.88dsf-59
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,300 kB
  • ctags: 1,736
  • sloc: ansic: 7,096; sh: 3,883; perl: 371; makefile: 315
file content (108 lines) | stat: -rw-r--r-- 3,329 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
.\" A man page for service(8). -*- nroff -*-
.\"
.\" Copyright (C) 2006 Red Hat, Inc. All rights reserved.
.\"
.\" This copyrighted material is made available to anyone wishing to use,
.\" modify, copy, or redistribute it subject to the terms and conditions of the
.\" GNU General Public License v.2.
.\"
.\" This program is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 
.\" more details.
.\"
.\" You should have received a copy of the GNU General Public License along
.\" with this program; if not, write to the Free Software Foundation, Inc.,
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.\"
.\" Author: Miloslav Trmac <mitr@redhat.com>
.\" Updated by: Petter Reinholdtsen <pere@hungry.com>

.TH service 8 "Jan 2006"

.SH NAME
service \- run a System V init script

.SH SYNOPSIS
\fBservice\fR \fISCRIPT\fR \fICOMMAND\fR [\fIOPTIONS\fR]

\fBservice \-\-status\-all\fR

\fBservice\fR \fB\-\-help\fR | \fB\-h\fR | \fB\-\-version\fR

.SH DESCRIPTION
.B service
runs a System V init script or upstart job in as predictable an
environment as possible, removing most environment variables and
with the current working directory set to \fB/\fR.

The
.I SCRIPT
parameter specifies a System V init script,
located in \fB/etc/init.d/\fISCRIPT\fR, or the name of an upstart
job in \fB/etc/init\fR. The existence of an upstart job of the
same name as a script in /etc/init.d will cause the upstart job
to take precedence over the init.d script.
The supported values of
.I COMMAND
depend on the invoked script.
.B service
passes
.I COMMAND
and
.I OPTIONS
to the init script unmodified. For upstart jobs, start, stop,
status, and reload are passed through to their upstart
equivalents. Restart will call the upstart 'stop' for the job,
followed immediately by the 'start', and will exit with the
return code of the start command.

All scripts should support at least the
.B start
and
.B stop
commands.
As a special case, if
.I COMMAND
is \fB\-\-full-restart\fR, the script is run twice, first with the
.B stop
command, then with the
.B start
command. This option has no effect on upstart jobs.

.B service \-\-status\-all
runs all init scripts, in alphabetical order, with the
.B status
command.  The status is [ + ] for running services, [ - ] for stopped
services and [ ? ] for services without a 'status' command.  This
option only calls status for sysvinit jobs; upstart jobs can be
queried in a similar manner with
\fBinitctl list\fR.

.SH EXIT CODES
.BR service
calls the init script and returns the status returned by it.

.SH FILES
.TP
\fB/etc/init.d\fR
The directory containing System V init scripts.
.TP
\fB/etc/init\fR
The directory containing upstart jobs.

.SH ENVIRONMENT
.TP
\fBLANG\fR, \fBLANGUAGE\fR, \fBLC_CTYPE\fR, \fBLC_NUMERIC\fR, \fBLC_TIME\fR, \fBLC_COLLATE\fR, \fBLC_MONETARY\fR, \fBLC_MESSAGES\fR, \fBLC_PAPER\fR, \fBLC_NAME\fR, \fBLC_ADDRESS\fR, \fBLC_TELEPHONE\fR, \fBLC_MEASUREMENT\fR, \fBLC_IDENTIFICATION\fR, \fBLC_ALL\fR, \fBTERM\fR
The only environment variables passed to the init scripts.

.SH SEE ALSO
.IR /etc/init.d/skeleton ,
.br
.BR update\-rc.d (8),
.br
.BR init (8),
.br
.BR invoke\-rc.d (8).
.br
.BR initctl (8).