]> git.ipfire.org Git - thirdparty/systemd.git/blob - units/systemd-nspawn@.service.in
1927c4d485318a580bc191d44d5596c5cd8338ae
[thirdparty/systemd.git] / units / systemd-nspawn@.service.in
1 # This file is part of systemd.
2 #
3 # systemd is free software; you can redistribute it and/or modify it
4 # under the terms of the GNU Lesser General Public License as published by
5 # the Free Software Foundation; either version 2.1 of the License, or
6 # (at your option) any later version.
7
8 [Unit]
9 Description=Container %i
10 Documentation=man:systemd-nspawn(1)
11 PartOf=machines.target
12 Before=machines.target
13 After=network.target
14
15 [Service]
16 ExecStart=@bindir@/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth --settings=override --machine=%i
17 KillMode=mixed
18 Type=notify
19 RestartForceExitStatus=133
20 SuccessExitStatus=133
21 Slice=machine.slice
22 Delegate=yes
23 TasksMax=8192
24
25 # Enforce a strict device policy, similar to the one nspawn configures
26 # when it allocates its own scope unit. Make sure to keep these
27 # policies in sync if you change them!
28 DevicePolicy=strict
29 DeviceAllow=/dev/null rwm
30 DeviceAllow=/dev/zero rwm
31 DeviceAllow=/dev/full rwm
32 DeviceAllow=/dev/random rwm
33 DeviceAllow=/dev/urandom rwm
34 DeviceAllow=/dev/tty rwm
35 DeviceAllow=/dev/net/tun rwm
36 DeviceAllow=/dev/pts/ptmx rw
37 DeviceAllow=char-pts rw
38
39 # nspawn itself needs access to /dev/loop-control and /dev/loop, to
40 # implement the --image= option. Add these here, too.
41 DeviceAllow=/dev/loop-control rw
42 DeviceAllow=block-loop rw
43 DeviceAllow=block-blkext rw
44
45 [Install]
46 WantedBy=machines.target