summaryrefslogtreecommitdiffstats
path: root/src/basic/special.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* units: added factory-reset.targetYegor Alexeyev2021-08-101-0/+1
|
* generator: write out special systemd-fsck-usr.serviceLennart Poettering2021-04-211-0/+1
| | | | | | | | | | | | | | | | | So far all file systems where checked by instances of systemd-fsck@.service, with the exception of the root fs which was covered by systemd-fsck-root.service. The special handling is necessary to deal with ordering issues: we typically want the root fs to be checked before all others, and — weirdly — allow mounting it before the fsck done (for compat with initrd-less boots). This adds similar special handling for /usr: if the hierarchy is placed on a separate file system check it with a special systemd-fsck-usr.service instead of a regular sysemd-fsck@.service instance. Reason is again ordering: we want to allow mounting of /usr without the root fs already being around in the initrd, to cover for cases where the root fs is created on first boot and thus cannot be mounted/checked before /usr.
* fstab-generator: if usr= is specified, mount it to /sysusr/usr/ firstLennart Poettering2021-04-201-0/+1
| | | | | | | | | | | | | | | This changes the fstab-generator to handle mounting of /usr/ a bit differently than before. Instead of immediately mounting the fs to /sysroot/usr/ we'll first mount it to /sysusr/usr/ and then add a separate bind mount that mounts it from /sysusr/usr/ to /sysroot/usr/. This way we can access /usr independently of the root fs, without for waiting to be mounted via the /sysusr/ hierarchy. This is useful for invoking systemd-repart while a root fs doesn't exist yet and for creating it, with partition data read from the /usr/ hierarchy. This introduces a new generic target initrd-usr-fs.target that may be used to generically order services against /sysusr/ to become available.
* core: order timer units after both time-sync.target and time-set.targetLennart Poettering2020-12-171-0/+1
| | | | | | | | | | | | | | | | | | If users do not enable a service like systemd-time-wait-sync.target (because they don't want to delay boot for external events, such as an NTP sync), then timers should still take the the weaker time-set.target feature into account, so that the clock is at least monotonic. Hence, order timer units after both of the targets: time-sync.target *and* time-set.target. That way, the right thing will happen regardless if people have no NTP server (and thus also no systemd-time-wait-sync.service or equivalent) or, only have an NTP server (and no systemd-time-wait-sync.service), or have both. Ordering after time-set.target is basically "free". The logic it is backed by should be instant, without communication with the outside going on. It's useful still so that time servers that implement the timestamp from /var/ logic can run in later boot.
* Merge pull request #16603 from benzea/benzea/special-app-sliceLennart Poettering2020-11-111-0/+5
|\ | | | | Use app.slice by default in user manager (and define special user slices)
| * basic: Define macros for special user slicesBenjamin Berg2020-10-231-0/+5
| |
* | license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-091-1/+1
|/
* core: automatically add udev dependency for units using RootImage=Lennart Poettering2020-04-211-0/+1
| | | | | | | | We use udev to wait for /dev/loopX devices to be fully proped hence we need an implicit ordering dependency on it, for RootImage= to work reliably in early boot, too. Fixes: #14972
* pid1: use initrd.target in the initramfs by defaultZbigniew Jędrzejewski-Szmek2019-11-281-0/+1
| | | | | | | | | | | | | | | This makes the code do what the documentation says. The code had no inkling about initrd.target, so I think this change is fairly risky. As a fallback, default.target will be loaded, so initramfses which relied on current behaviour will still work, as along as they don't have a different initrd.target. In an initramfs created with recent dracut: $ ls -l usr/lib/systemd/system/{default.target,initrd.target} lrwxrwxrwx. usr/lib/systemd/system/default.target -> initrd.target -rw-r--r--. usr/lib/systemd/system/initrd.target So at least for dracut, there should be no difference. Also avoid a pointless allocation.
* core: change top-level drop-in from -.service.d to service.dAnita Zhang2019-11-071-4/+0
| | | | | | | | | | Discussed in #13743, the -.service semantic conflicts with the existing root mount and slice names, making this feature not uniformly extensible to all types. Change the name to be <type>.d instead. Updating to this format also extends the top-level dropin to unit types.
* core: disallow using '-.service' as a service nameAnita Zhang2019-10-071-0/+4
| | | | | -.service.d will become a special top level drop in so don't let it be a usable service name (otherwise the interaction gets complicated).
* Define macro for systemd-fsck-root.serviceZbigniew Jędrzejewski-Szmek2019-01-031-0/+1
| | | | There is one for systemd-fsck@.service, so for consistency...
* Define macro for systemd-volatile-root.serviceZbigniew Jędrzejewski-Szmek2019-01-031-0/+1
|
* tree-wide: remove Lennart's copyright linesLennart Poettering2018-06-141-4/+0
| | | | | | | | | | | These lines are generally out-of-date, incomplete and unnecessary. With SPDX and git repository much more accurate and fine grained information about licensing and authorship is available, hence let's drop the per-file copyright notice. Of course, removing copyright lines of others is problematic, hence this commit only removes my own lines and leaves all others untouched. It might be nicer if sooner or later those could go away too, making git the only and accurate source of authorship information.
* tree-wide: drop 'This file is part of systemd' blurbLennart Poettering2018-06-141-2/+0
| | | | | | | | | | | | | | | | This part of the copyright blurb stems from the GPL use recommendations: https://www.gnu.org/licenses/gpl-howto.en.html The concept appears to originate in times where version control was per file, instead of per tree, and was a way to glue the files together. Ultimately, we nowadays don't live in that world anymore, and this information is entirely useless anyway, as people are very welcome to copy these files into any projects they like, and they shouldn't have to change bits that are part of our copyright header for that. hence, let's just get rid of this old cruft, and shorten our codebase a bit.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* Rename suspend-to-hibernate to suspend-then-hibernateMario Limonciello2018-03-281-1/+1
| | | | | Per some discussion with Gnome folks, they would prefer this name as it's more descriptive of what's happening.
* Introduce suspend-to-hibernate (#8274)Mario Limonciello2018-03-081-0/+1
| | | | | | | | | | | | | | Suspend to Hibernate is a new sleep method that invokes suspend for a predefined period of time before automatically waking up and hibernating the system. It's similar to HybridSleep however there isn't a performance impact on every suspend cycle. It's intended to use with systems that may have a higher power drain in their supported suspend states to prevent battery and data loss over an extended suspend cycle. Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
* Add SPDX license identifiers to source files under the LGPLZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
| | | | | This follows what the kernel is doing, c.f. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5fd54ace4721fc5ce2bb5aef6318fcf17f421460.
* Drop busname unit typeZbigniew Jędrzejewski-Szmek2017-07-231-1/+0
| | | | | | | Since busname units are only useful with kdbus, they weren't actively used. This was dead code, only compile-tested. If busname units are ever added back, it'll be cleaner to start from scratch (possibly reverting parts of this patch).
* core: implicitly order units with PrivateTmp= after ↵Lennart Poettering2016-12-271-0/+1
| | | | | | systemd-tmpfiles-setup.service Preparation for fixing #4401.
* core: make the root mount perpetual tooLennart Poettering2016-11-021-0/+3
| | | | | Now that have a proper concept of "perpetual" units, let's make the root mount one too, since it also cannot go away.
* Create initrd-root-device.target synchronization point (#3239)Daniel Drake2016-05-121-0/+1
| | | | | | | | | Add a synchronization point so that custom initramfs units can run after the root device becomes available, before it is fsck'd and mounted. This is useful for custom initramfs units that may modify the root disk partition table, where the root device is not known in advance (it's dynamically selected by the generators).
* tree-wide: remove Emacs lines from all filesDaniel Mack2016-02-101-2/+0
| | | | | This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
* core: unified cgroup hierarchy supportLennart Poettering2015-09-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set adds full support the new unified cgroup hierarchy logic of modern kernels. A new kernel command line option "systemd.unified_cgroup_hierarchy=1" is added. If specified the unified hierarchy is mounted to /sys/fs/cgroup instead of a tmpfs. No further hierarchies are mounted. The kernel command line option defaults to off. We can turn it on by default as soon as the kernel's APIs regarding this are stabilized (but even then downstream distros might want to turn this off, as this will break any tools that access cgroupfs directly). It is possibly to choose for each boot individually whether the unified or the legacy hierarchy is used. nspawn will by default provide the legacy hierarchy to containers if the host is using it, and the unified otherwise. However it is possible to run containers with the unified hierarchy on a legacy host and vice versa, by setting the $UNIFIED_CGROUP_HIERARCHY environment variable for nspawn to 1 or 0, respectively. The unified hierarchy provides reliable cgroup empty notifications for the first time, via inotify. To make use of this we maintain one manager-wide inotify fd, and each cgroup to it. This patch also removes cg_delete() which is unused now. On kernel 4.2 only the "memory" controller is compatible with the unified hierarchy, hence that's the only controller systemd exposes when booted in unified heirarchy mode. This introduces a new enum for enumerating supported controllers, plus a related enum for the mask bits mapping to it. The core is changed to make use of this everywhere. This moves PID 1 into a new "init.scope" implicit scope unit in the root slice. This is necessary since on the unified hierarchy cgroups may either contain subgroups or processes but not both. PID 1 hence has to move out of the root cgroup (strictly speaking the root cgroup is the only one where processes and subgroups are still allowed, but in order to support containers nicey, we move PID 1 into the new scope in all cases.) This new unit is also used on legacy hierarchy setups. It's actually pretty useful on all systems, as it can then be used to filter journal messages coming from PID 1, and so on. The root slice ("-.slice") is now implicitly created and started (and does not require a unit file on disk anymore), since that's where "init.scope" is located and the slice needs to be started before the scope can. To check whether we are in unified or legacy hierarchy mode we use statfs() on /sys/fs/cgroup. If the .f_type field reports tmpfs we are in legacy mode, if it reports cgroupfs we are in unified mode. This patch set carefuly makes sure that cgls and cgtop continue to work as desired. When invoking nspawn as a service it will implicitly create two subcgroups in the cgroup it is using, one to move the nspawn process into, the other to move the actual container processes into. This is done because of the requirement that cgroups may either contain processes or other subgroups.
* build-sys: split internal basic/ library from shared/Kay Sievers2015-06-111-0/+117
basic/ can be used by everything cannot use anything outside of basic/ libsystemd/ can use basic/ cannot use shared/ shared/ can use libsystemd/