2013-04-30 04:11:37 +04:00
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
2016-02-26 22:35:09 +03:00
Description = Container %i
2013-04-30 04:11:37 +04:00
Documentation = man:systemd-nspawn(1)
2014-12-29 14:38:26 +03:00
PartOf = machines.target
Before = machines.target
2015-05-11 23:08:28 +03:00
After = network.target
2013-04-30 04:11:37 +04:00
[Service]
2016-04-22 15:12:27 +03:00
ExecStart = @bindir@/systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth -U --settings=override --machine=%i
2014-05-28 19:17:25 +04:00
KillMode = mixed
2013-04-30 04:11:37 +04:00
Type = notify
2014-07-03 14:50:11 +04:00
RestartForceExitStatus = 133
SuccessExitStatus = 133
2015-05-19 20:47:52 +03:00
Slice = machine.slice
2014-11-05 19:57:23 +03:00
Delegate = yes
2015-11-13 21:38:40 +03:00
TasksMax = 8192
2013-04-30 04:11:37 +04:00
2015-04-28 21:46:03 +03:00
# Enforce a strict device policy, similar to the one nspawn configures
# when it allocates its own scope unit. Make sure to keep these
# policies in sync if you change them!
DevicePolicy = strict
DeviceAllow = /dev/null rwm
DeviceAllow = /dev/zero rwm
DeviceAllow = /dev/full rwm
DeviceAllow = /dev/random rwm
DeviceAllow = /dev/urandom rwm
DeviceAllow = /dev/tty rwm
DeviceAllow = /dev/net/tun rwm
DeviceAllow = /dev/pts/ptmx rw
DeviceAllow = char-pts rw
2016-07-21 18:39:38 +03:00
DeviceAllow = /run/systemd/inaccessible/chr rwm
DeviceAllow = /run/systemd/inaccessible/blk rwm
2015-04-28 21:46:03 +03:00
2015-10-03 12:23:52 +03:00
# nspawn itself needs access to /dev/loop-control and /dev/loop, to
# implement the --image= option. Add these here, too.
DeviceAllow = /dev/loop-control rw
DeviceAllow = block-loop rw
2015-10-22 01:39:57 +03:00
DeviceAllow = block-blkext rw
2015-10-03 12:23:52 +03:00
2013-04-30 04:11:37 +04:00
[Install]
2014-12-29 14:38:26 +03:00
WantedBy = machines.target