1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>systemd.service</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/></head><body><div class="refentry" title="systemd.service"><a id="systemd.service"/><div class="titlepage"/><div class="refnamediv"><h2>Name</h2><p>systemd.service — systemd service configuration files</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><p><code class="filename">systemd.service</code></p></div><div class="refsect1" title="Description"><a id="id312255"/><h2>Description</h2><p>A unit configuration file whose name ends in
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd.service</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry" title="systemd.service"><a name="systemd.service"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd.service — systemd service configuration files</p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><p><code class="filename">systemd.service</code></p></div><div class="refsect1" title="Description"><a name="id525303"></a><h2>Description</h2><p>A unit configuration file whose name ends in
4
2
<code class="filename">.service</code> encodes information
5
3
about a process controlled and supervised by
6
4
systemd.</p><p>This man page lists the configuration options
33
31
<code class="filename">.service</code> suffix removed) and
34
32
dynamically creates a service unit from that
35
33
script. This is useful for compatibility with
36
SysV.</p></div><div class="refsect1" title="Options"><a id="id312367"/><h2>Options</h2><p>Service files must include a
34
SysV.</p></div><div class="refsect1" title="Options"><a name="id525414"></a><h2>Options</h2><p>Service files must include a
37
35
<code class="literal">[Service]</code> section, which carries
38
36
information about the service and the process it
39
37
supervises. A number of options that may be used in
114
112
below) should be set to open access to
115
113
the notification socket provided by
117
<code class="varname">NotifyAccess=</code> is not
118
set, it will implicitly be set to
115
<code class="varname">NotifyAccess=</code> is
116
not set, it will be implicitly set to
119
117
<code class="option">main</code>.</p></dd><dt><span class="term"><code class="varname">RemainAfterExit=</code></span></dt><dd><p>Takes a boolean value
120
118
that specifies whether the service
121
119
shall be considered active even when
303
301
time span value such as "5min
304
302
20s". Pass 0 to disable the timeout
305
303
logic. Defaults to
306
90s.</p></dd><dt><span class="term"><code class="varname">Restart=</code></span></dt><dd><p>Configures whether the
304
90s.</p></dd><dt><span class="term"><code class="varname">WatchdogSec=</code></span></dt><dd><p>Configures the
305
watchdog timeout for a service. This
306
is activated when the start-up is
307
completed. The service must call
308
<span class="citerefentry"><span class="refentrytitle">sd_notify</span>(3)</span>
309
regularly with "WATCHDOG=1". If the
310
time between two such calls is larger
311
than the configured time then the
312
service is placed in a failure
314
<code class="varname">Restart=</code>
315
to <code class="option">on-failure</code> or
316
<code class="option">always</code> the service
317
will be automatically restarted. The
318
time configured here will be passed to
319
the executed service process in the
320
<code class="varname">WATCHDOG_USEC=</code>
321
environment variable. If
323
<code class="varname">NotifyAccess=</code> (see
324
below) should be set to open access to
325
the notification socket provided by
327
<code class="varname">NotifyAccess=</code> is not
328
set, it will be implicitly set to
329
<code class="option">main</code>. Defaults to 0,
331
feature.</p></dd><dt><span class="term"><code class="varname">Restart=</code></span></dt><dd><p>Configures whether the
307
332
main service process shall be
308
333
restarted when it exits. Takes one of
309
334
<code class="option">no</code>,
321
346
<code class="option">on-failure</code> it will be
322
347
restarted only when it exited with an
323
exit code not equalling 0, or when
324
terminated by a signal. If set to
348
exit code not equalling 0, when
349
terminated by a signal, when an
350
operation times out or when the
351
configured watchdog timeout is
325
353
<code class="option">on-abort</code> it will be
326
354
restarted only if it exits due to
327
355
reception of an uncaught signal. If
328
356
set to <code class="option">always</code> the
329
357
service will be restarted regardless
330
whether it exited cleanly or not, or
358
whether it exited cleanly or not,
331
359
got terminated abnormally by a
332
signal.</p></dd><dt><span class="term"><code class="varname">PermissionsStartOnly=</code></span></dt><dd><p>Takes a boolean
360
signal or hit a timeout.</p></dd><dt><span class="term"><code class="varname">PermissionsStartOnly=</code></span></dt><dd><p>Takes a boolean
333
361
argument. If true, the permission
334
362
related execution options as
458
486
accepted. If <code class="option">all</code> all
459
487
services updates from all members of
460
488
the service's control group are
461
accepted. This option must be set to
489
accepted. This option should be set to
462
490
open access to the notification socket
464
<code class="varname">Type=notify</code> (see above).</p></dd><dt><span class="term"><code class="varname">Sockets=</code></span></dt><dd><p>Specifies the name of
492
<code class="varname">Type=notify</code> or
493
<code class="varname">WatchdogUsec=</code> (see
494
above). If those options are used but
495
<code class="varname">NotifyAccess=</code> not
496
configured it will be implicitly set
498
<code class="option">main</code>.</p></dd><dt><span class="term"><code class="varname">Sockets=</code></span></dt><dd><p>Specifies the name of
465
499
the socket units this service shall
466
500
inherit the sockets from when the
467
service (ignoring the different suffix
468
of course) is started. Normally it
501
service is started. Normally it
469
502
should not be necessary to use this
470
503
setting as all sockets whose unit
471
504
shares the same name as the service
505
(ignoring the different suffix of course)
472
506
are passed to the spawned
473
507
process.</p><p>Note that the same socket may be
474
508
passed to multiple processes at the
503
537
<code class="filename">/etc/fstab</code>'s
504
538
fs_passno column. See
505
539
<span class="citerefentry"><span class="refentrytitle">fstab</span>(5)</span>
506
for details.</p></dd></dl></div></div><div class="refsect1" title="See Also"><a id="id354175"/><h2>See Also</h2><p>
540
for details.</p></dd><dt><span class="term"><code class="varname">StartLimitInterval=</code>, </span><span class="term"><code class="varname">StartLimitBurst=</code></span></dt><dd><p>Configure service
541
start rate limiting. By default
542
services which are started more often
543
than 5 times within 10s are not
544
permitted to start any more times
545
until the 10s interval ends. With
546
these two options this rate limiting
548
<code class="varname">StartLimitInterval=</code>
549
to configure the checking interval
550
(defaults to 10s, set to 0 to disable
551
any kind of rate limiting). Use
552
<code class="varname">StartLimitBurst=</code> to
553
configure how many starts per interval
554
are allowed (defaults to 5). These
555
configuration options are particularly
556
useful in conjunction with
557
<code class="varname">Restart=</code>.</p></dd><dt><span class="term"><code class="varname">StartLimitAction=</code></span></dt><dd><p>Configure the action
558
to take if the rate limit configured
560
<code class="varname">StartLimitInterval=</code>
562
<code class="varname">StartLimitBurst=</code> is
564
<code class="option">none</code>,
565
<code class="option">reboot</code>,
566
<code class="option">reboot-force</code> or
567
<code class="option">reboot-immediate</code>. If
568
<code class="option">none</code> is set,
569
hitting the rate limit will trigger no
570
action besides that the start will not
572
permitted. <code class="option">reboot</code>
573
causes a reboot following the normal
574
shutdown procedure (i.e. equivalent to
575
<span class="command"><strong>systemctl reboot</strong></span>),
576
<code class="option">reboot-force</code> causes
577
an forced reboot which will terminate
578
all processes forcibly but should
579
cause no dirty file systems on reboot
580
(i.e. equivalent to <span class="command"><strong>systemctl
581
reboot -f</strong></span>) and
582
<code class="option">reboot-immediate</code>
583
causes immediate execution of the
584
<span class="citerefentry"><span class="refentrytitle">reboot</span>(2)</span>
585
system call, which might result in
586
data loss. Defaults to
587
<code class="option">none</code>.</p></dd></dl></div></div><div class="refsect1" title="See Also"><a name="id535170"></a><h2>See Also</h2><p>
507
588
<span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span>,
508
589
<span class="citerefentry"><span class="refentrytitle">systemctl</span>(8)</span>,
509
590
<span class="citerefentry"><span class="refentrytitle">systemd.unit</span>(5)</span>,