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