3 service \- Manage an operating system service.
6 \fBservice [-b -c -n -p -r] (up|run|edit|update)\fR \fI<binary|self>\fR
7 [\fB-args\fR \fI<args>\fR] [\fB-dev\fR \fI<special>\fR]
8 [\fB-period\fR \fI<ticks>\fR]
9 [\fB-script\fR \fI<path>\fR] [\fB-label\fR \fI<name>\fR]
10 [\fB-config\fR \fI<path>\fR] [\fB-state\fR \fI<state>\fR]
11 [\fB-maxtime\fR \fI<time>\fR]
13 \fBservice down\fR \fI<label>\fR
15 \fBservice refresh\fR \fI<label>\fR
17 \fBservice restart\fR \fI<label>\fR
19 \fBservice clone\fR \fI<label>\fR
21 \fBservice shutdown\fR
35 The \fBservice\fR utility instructs the reincarnation server (\fBRS\fR)
36 to perform an action for a given system service (an OS server
37 or device driver). The action may concern an existing system service
38 (SHIFT+F6 to list them all), or a new system service to be started
39 (actions \fBup\fR and \fBrun\fR).
54 \fBservice up\fR \fI<binary>\fR
57 Starts a new system service identified by the given \fI<binary>\fR,
58 which must be specified using an absolute path. When the service
59 unexpectedly exits (for example, as a result of a crash or a panic), \fBRS\fR
60 will intercept the event and restart the service automatically.
61 If the service fails to restart, \fBRS\fR will automatically bring
62 it down allowing for graceful degradation of service. If a critical
63 system service fails to restart, \fBRS\fR will immediately resort to
64 a system-wide panic. The \fBup\fR action takes the following options:
67 disable the usage of binary exponential restart time in \fBRS\fR.
70 \fBRS\fR normally relies on the binary on the disk to restart a
73 option instructs \fBRS\fR to keep an in-memory copy of the binary and
74 use the copy to restart the service upon termination. This is necessary
75 when the location on the disk may change or if the service itself is
76 required to read the binary from the disk (e.g. the disk driver).
79 by default, \fBRS\fR performs blocking startup of the system service. As
80 a result, the \fBup\fR action does not terminate until the system service
81 completes initialization.
84 option changes the default behavior by performing non-blocking startup
85 and thus terminating the \fBup\fR action immediately without waiting for
86 the service to complete initialization.
89 instructs \fBRS\fR to keep a replica of the system service in background
90 and use the replica to restart the service upon termination. This is
91 necessary when the service itself is required to create a working
92 service instance (e.g. \fBPM\fR).
95 when saving an in-memory copy, instructs \fBRS\fR to reuse and share the copy
96 of an existing service with the same program name, if available.
99 specifies the command line arguments to use to run the program
100 given by \fI<binary>\fR. The default is to use no arguments.
102 .BI \-dev " <special>"
103 specifies the device file to associate to the system service (used only for
104 device drivers). The default is to associate no device file to the service.
106 .BI \-period " <ticks>"
107 specifies the period to use for the system service.
108 When a period is specified, \fBRS\fR sends a ping request to
109 the system service after every period. If the response does not arrive
110 in time, \fBRS\fR will kill the misbehaving service and restart a new one.
111 The period must be specified in ticks, but can be appended with HZ to
112 make it seconds. The default is to use no period for the service.
114 .BI \-script " <path>"
115 specifies the recovery script to associate to the system service. When a
116 recovery script is used, \fBRS\fR will not attempt to restart the service
117 upon termination. \fBRS\fR will instead invoke the script and
118 delegate the recovery process to it. The script may perform several
119 operations, including instructing \fBRS\fR to restart the service
120 (\fBrestart\fR action) or bring it down (\fBdown\fR action).
121 The default is to associate no recovery script to the service.
123 .BI \-label " <name>"
124 specifies the label to use for the system service. The label is used to
125 univoquely identify the system service. The default is to use the program
128 .BI \-config " <path>"
129 specifies the absolute path of the system configuration file with the settings
130 of the system service. See
132 for the syntax to use in the system configuration file.
133 The default is to use the global system configuration file \fB/etc/system.conf\fR.
136 \fBservice run\fR \fI<binary>\fR
139 Runs a new system service identified by the given \fI<binary>\fR,
140 which must be specified using an absolute path. Similar to
141 \fBservice up\fR \fI<binary>\fR, but instructs \fBRS\fR not to
142 restart the service upon termination. This action is currently a shorthand
143 for \fBservice up\fR \fI<binary>\fR \fB-script\fR \fI/etc/rs.single\fR, which
144 uses a recovery script that simply brings down the service upon termination.
145 This action should be only used for short-lived programs that need system
146 service privileges and do not require crash recovery support.
149 \fBservice edit\fR \fI<binary>\fR [\fB-label\fR \fI<name>\fR]
152 Edits settings of an existing system service identified by the given
153 label \fI<name>\fR. This action can be used to dynamically update the
154 properties of any system service, including those contained in the
155 boot image (e.g. \fBVM\fR). There are a few exceptions to the properties
156 that can be actually overridden dynamically. For example, the device file
157 associated to the service will no be updated. This
158 action takes the same options supported by the \fBup\fR action.
161 \fBservice update\fR \fI<binary|self>\fR
164 Live updates an existing system service with a new version identified by the
165 given \fI<binary>\fR, which must be specified using an absolute path.
166 The existing service will be identified from the label given (if explicitly
167 specified), or from the program name. If \fI<self>\fR is specified as
168 an argument instead, \fBRS\fR will perform a self update of the
169 system service (i.e. an update of the service with its own replica). This
170 is intended for testing purposes. In this case, a label \fI<name>\fR
171 must be explicitly specified. Live update support is still in an early
172 stage of development and is subject to change in future revisions. This
173 action takes all the options supported by the \fBup\fR action and the
174 following additional options:
176 .BI \-state " <state>"
177 specifies the state of the service required by the update. The default
178 is a state in which the service is blocked not processing any work.
180 .BI \-maxtime " <time>"
181 specifies the maximum amount time for the service to prepare
182 for the update. The default is 0 (unlimited).
185 \fBservice down\fR \fI<label>\fR
188 Stops an existing system service identified by the given \fI<label>\fR. \fBRS\fR
189 will bring down the service without attempting to restart it. Critical system
190 services cannot be shut down.
193 \fBservice refresh\fR \fI<label>\fR
196 Refreshes an existing system service identified by the given \fI<label>\fR.
197 \fBRS\fR will kill the service and attempt to restart it.
200 \fBservice restart\fR \fI<label>\fR
203 Restarts an existing terminated system service identified by the
204 given \fI<label>\fR. This action can only be used from a recovery script.
207 \fBservice clone\fR \fI<label>\fR
210 Clones an existing system service to create a replica \fBRS\fR will use
211 to restart the service upon termination.
214 \fBservice shutdown\fR
217 Tells \fBRS\fR the system is about to shutdown and no system service should
218 be restarted upon termination.
222 .B service up /sbin/is -period 5HZ
223 # Start the IS server and check its status every 5 seconds.
226 .B service up /usr/sbin/dp8390 -args DPETH0=pci
227 # Start the DP8390 ethernet driver, passing one argument.
230 .B service down lance
231 # Stop the system service with label lance.
239 Cristiano Giuffrida <giuffrida@cs.vu.nl>