summaryrefslogtreecommitdiff
path: root/units/systemd-nspawn@.service.in
Commit message (Collapse)AuthorAgeFilesLines
* units: drop full paths for utilities in $PATHZbigniew Jędrzejewski-Szmek2020-01-201-1/+1
| | | | | | | This makes things a bit simpler and the build a bit faster, because we don't have to rewrite files to do the trivial substitution. @rootbindir@ is always in our internal $PATH that we use for non-absolute paths, so there should be no functional change.
* units: Split modprobing out into a separate service unitIain Lane2020-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Devices referred to by `DeviceAllow=` sandboxing are resolved into their corresponding major numbers when the unit is loaded by looking at `/proc/devices`. If a reference is made to a device which is not yet available, the `DeviceAllow` is ignored and the unit's processes cannot access that device. In both logind and nspawn, we have `DeviceAllow=` lines, and `modprobe` in `ExecStartPre=` to load some kernel modules. Those kernel modules cause device nodes to become available when they are loaded: the device nodes may not exist when the unit itself is loaded. This means that the unit's processes will not be able to access the device since the `DeviceAllow=` will have been resolved earlier and denied it. One way to fix this would be to re-evaluate the available devices and re-apply the policy to the cgroup, but this cannot work atomically on cgroupsv1. So we fall back to a second approach: instead of running `modprobe` via `ExecStartPre`, we move this out to a separate unit and order it before the units which want the module. Closes #14322. Fixes: #13943.
* meson: allow WatchdogSec= in services to be configuredZbigniew Jędrzejewski-Szmek2019-10-251-1/+1
| | | | | | | | | | | | | | | | As discussed on systemd-devel [1], in Fedora we get lots of abrt reports about the watchdog firing [2], but 100% of them seem to be caused by resource starvation in the machine, and never actual deadlocks in the services being monitored. Killing the services not only does not improve anything, but it makes the resource starvation worse, because the service needs cycles to restart, and coredump processing is also fairly expensive. This adds a configuration option to allow the value to be changed. If the setting is not set, there is no change. My plan is to set it to some ridiculusly high value, maybe 1h, to catch cases where a service is actually hanging. [1] https://lists.freedesktop.org/archives/systemd-devel/2019-October/043618.html [2] https://bugzilla.redhat.com/show_bug.cgi?id=1300212
* nspawn: explicitly load units beforehand so that DeviceAllow= syntax worksLennart Poettering2019-07-231-0/+2
| | | | | | Yuck, but I don't see any prettier solution. Fixes: #13130
* nspawn: turn on watchdog logic for nspawn tooLennart Poettering2017-12-071-0/+1
| | | | It's a long-running daemon, and it's easy to enable, hence do it.
* Add SPDX license headers to unit filesZbigniew Jędrzejewski-Szmek2017-11-191-0/+2
|
* units: include DM devices in DeviceAllow fpor systemd-nspawn@.serviceLennart Poettering2017-08-291-5/+10
| | | | | | We need it to make LUKS devices work. Fixes: #6525
* systemd-nspawn@.service: start after /var/lib/machines is mounted (#6079)Josef Gajdusek2017-06-061-0/+1
| | | | This fixes a race condition during boot, where an nspawn container would start before /var/lib/machines got mounted resulting in a failure.
* units: order systemd-nspawn@.service after systemd-resolved.serviceLennart Poettering2017-02-171-1/+1
| | | | | | | This way, the nspawn internal check whether resolved is running will succeed if it is enabled. Fixes: #4649
* Introduce '## ' as internal comment prefix in .in files and filter out a ↵Zbigniew Jędrzejewski-Szmek2017-02-091-3/+3
| | | | | | | | comment (#5289) Sometimes we have comments which don't make sense outside of the systemd codebase, so let's filter them out from the user-visible files. Fixes #5286.
* nspawn: set DevicesPolicy closed and clean up duplicated devicesAlessandro Puccetti2016-07-221-10/+1
|
* Merge pull request #3764 from poettering/assorted-stuff-2Martin Pitt2016-07-221-1/+1
|\ | | | | Assorted fixes
| * units: fix TasksMax=16384 for systemd-nspawn@.serviceLennart Poettering2016-07-201-1/+1
| | | | | | | | | | | | When a container scope is allocated via machined it gets 16K set already since cf7d1a30e44bf380027a2e73f9bf13f423a33cc1. Make sure when a container is run as system service it gets the same values.
* | nspawn: enable major=0/minor=0 devices inside the container (#3773)Alessandro Puccetti2016-07-211-0/+2
|/ | | | | | https://github.com/systemd/systemd/pull/3685 introduced /run/systemd/inaccessible/{chr,blk} to map inacessible devices, this patch allows systemd running inside a nspawn container to create /run/systemd/inaccessible/{chr,blk}.
* units: turn on user namespace by default in systemd-nspawn@.serviceLennart Poettering2016-04-251-1/+1
| | | | | Now that user namespacing is supported in a pretty automatic way, actually turn it on by default if the systemd-nspawn@.service template is used.
* Don't escape the name of the container in instances ofElias Probst2016-02-261-2/+2
| | | | | | | | When using `%I` for instances of `systemd-nspawn@.service`, the result will be `systemd-nspawn` trying to launch a container named e.g. `fedora/23` instead of `fedora-23`. Using `%i` instead prevents escaping `-` in a container name and uses the unmodified container name from the machine store.
* nspawn: set TasksMax= for containers to 8192 by defaultLennart Poettering2015-11-161-0/+1
|
* units: also whitelist "blkext" block devices for nspawn serviceLennart Poettering2015-10-221-0/+1
| | | | | | | /dev/loop*p* block devices are of the "blkext" subsystem, not of loop, hence whitelist this too. Fixes #1446
* nspawn: fix --image= when nspawn is run as serviceLennart Poettering2015-10-031-0/+5
| | | | | | | nspawn needs access to /dev/loop to implement --image=, hence grant that in the service file. Fixes #1446.
* units: make sure that .nspawn files override the default settings in ↵Lennart Poettering2015-09-061-1/+1
| | | | systemd-nspawn@.service
* units: make sure systemd-nspawn@.slice instances are actually located in ↵Lennart Poettering2015-05-191-0/+1
| | | | | | machine.slice https://plus.google.com/112206451048767236518/posts/SYAueyXHeEX
* units: order nspawn containers after network.targetLennart Poettering2015-05-111-0/+1
| | | | | | | | This way we know that any bridges and other user-created network devices are in place, and can be properly added to the container. In the long run this should be dropped, and replaced by direct calls inside nspawn that cause the devices to be created when necessary.
* nspawn: make sure we install the device policy if nspawn is run as unit as ↵Lennart Poettering2015-04-281-0/+14
| | | | on the command line
* units: turn on --network-veth by default for systemd-nspawn@.serviceLennart Poettering2015-02-131-1/+1
| | | | | Given the recent improvements in networkd, it's probably the better default now.
* units: rework systemd-nspawn@.service unitLennart Poettering2014-12-291-3/+5
| | | | | | | | | | | - Unescape instance name so that we can take almost anything as instance name. - Introduce "machines.target" which consists of all enabled nspawns and can be used to start/stop them altogether - Look for container directory using -M instead of harcoding the path in /var/lib/container
* nspawn: Add try-{host,guest} journal link modesMartin Pitt2014-11-211-1/+1
| | | | | | | | | | | | | | | | | --link-journal={host,guest} fail if the host does not have persistent journalling enabled and /var/log/journal/ does not exist. Even worse, as there is no stdout/err any more, there is no error message to point that out. Introduce two new modes "try-host" and "try-guest" which don't fail in this case, and instead just silently skip the guest journal setup. Change -j to mean "try-guest" instead of "guest", and fix the wrong --help output for it (it said "host" before). Change systemd-nspawn@.service.in to use "try-guest" so that this unit works with both persistent and non-persistent journals on the host without failing. https://bugs.debian.org/770275
* core: introduce new Delegate=yes/no property controlling creation of cgroup ↵Lennart Poettering2014-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | subhierarchies For priviliged units this resource control property ensures that the processes have all controllers systemd manages enabled. For unpriviliged services (those with User= set) this ensures that access rights to the service cgroup is granted to the user in question, to create further subgroups. Note that this only applies to the name=systemd hierarchy though, as access to other controllers is not safe for unpriviliged processes. Delegate=yes should be set for container scopes where a systemd instance inside the container shall manage the hierarchies below its own cgroup and have access to all controllers. Delegate=yes should also be set for user@.service, so that systemd --user can run, controlling its own cgroup tree. This commit changes machined, systemd-nspawn@.service and user@.service to set this boolean, in order to ensure that container management will just work, and the user systemd instance can run fine.
* nspawn: when running in a service unit, use systemd for restartsLennart Poettering2014-07-031-0/+2
| | | | | THis way we can remove cgroup priviliges after setup, but get them back for the next restart, as we need it.
* units: use KillMode=mixed for systemd-nspawn@.serviceJonathan Liu2014-05-301-0/+1
| | | | | This causes the container to shut down cleanly when the service is stopped.
* units: make use of nspawn's --keep-unit switch in systemd-nspawn@.serviceLennart Poettering2014-02-111-1/+1
|
* man,units: fix installation of systemd-nspawn@.service and add exampleZbigniew Jędrzejewski-Szmek2013-11-091-1/+1
|
* nspawn: update unit fileLennart Poettering2013-09-171-1/+0
| | | | | ControlGroup= is obsolete, so let's drop it from the default nspawn unit file.
* units: add an easy-to-use unit template file systemd-nspawn@.service for ↵Lennart Poettering2013-04-301-0/+18
running containers as system services