1SYSTEMD.SCOPE(5) systemd.scope SYSTEMD.SCOPE(5)
2
3
4
6 systemd.scope - Scope unit configuration
7
9 scope.scope
10
12 Scope units are not configured via unit configuration files, but are
13 only created programmatically using the bus interfaces of systemd. They
14 are named similar to filenames. A unit whose name ends in ".scope"
15 refers to a scope unit. Scopes units manage a set of system processes.
16 Unlike service units, scope units manage externally created processes,
17 and do not fork off processes on its own.
18
19 The main purpose of scope units is grouping worker processes of a
20 system service for organization and for managing resources.
21
22 systemd-run --scope may be used to easily launch a command in a new
23 scope unit from the command line.
24
25 See the New Control Group Interfaces[1] for an introduction on how to
26 make use of scope units from programs.
27
28 Note that, unlike service units, scope units have no "main" process:
29 all processes in the scope are equivalent. The lifecycle of the scope
30 unit is thus not bound to the lifetime of one specific process, but to
31 the existence of at least one process in the scope. This also means
32 that the exit statuses of these processes are not relevant for the
33 scope unit failure state. Scope units may still enter a failure state,
34 for example due to resource exhaustion or stop timeouts being reached,
35 but not due to programs inside of them terminating uncleanly. Since
36 processes managed as scope units generally remain children of the
37 original process that forked them off, it is also the job of that
38 process to collect their exit statuses and act on them as needed.
39
41 Implicit Dependencies
42 Implicit dependencies may be added as result of resource control
43 parameters as documented in systemd.resource-control(5).
44
45 Default Dependencies
46 The following dependencies are added unless DefaultDependencies=no is
47 set:
48
49 • Scope units will automatically have dependencies of type Conflicts=
50 and Before= on shutdown.target. These ensure that scope units are
51 removed prior to system shutdown. Only scope units involved with
52 early boot or late system shutdown should disable
53 DefaultDependencies= option.
54
56 Scope files may include a [Scope] section, which carries information
57 about the scope and the units it contains. A number of options that may
58 be used in this section are shared with other unit types. These options
59 are documented in systemd.kill(5) and systemd.resource-control(5). The
60 options specific to the [Scope] section of scope units are the
61 following:
62
63 RuntimeMaxSec=
64 Configures a maximum time for the scope to run. If this is used and
65 the scope has been active for longer than the specified time it is
66 terminated and put into a failure state. Pass "infinity" (the
67 default) to configure no runtime limit.
68
70 systemd(1), systemd-run(1), systemd.unit(5), systemd.resource-
71 control(5), systemd.service(5), systemd.directives(7).
72
74 1. New Control Group Interfaces
75 https://www.freedesktop.org/wiki/Software/systemd/ControlGroupInterface/
76
77
78
79systemd 249 SYSTEMD.SCOPE(5)