summaryrefslogtreecommitdiff
path: root/units
Commit message (Collapse)AuthorAgeFilesLines
* units: stop automount unit when shutting downZbigniew Jędrzejewski-Szmek2021-07-201-0/+1
| | | | | | | | | This is currently our only .automount unit. We wouldn't want to trigger it accidentally during shutdown, so let's stop it too. (cherry picked from commit dc16846c26287fd2081eb3c4a73487c9b186e2b7) (cherry picked from commit b1ce5653fac2766c4b4a070fec2126f211d49efa) (cherry picked from commit 9a8023994ef873dcb2f27ce0a00f7ac9e5248fc2)
* meson: call find_program() once and reuse the variable everywhereZbigniew Jędrzejewski-Szmek2021-05-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Meson 0.58 has gotten quite bad with emitting a message every time a quoted command is used: Program /home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh found: YES (/home/zbyszek/src/systemd-work/tools/meson-make-symlink.sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program sh found: YES (/usr/bin/sh) Program xsltproc found: YES (/usr/bin/xsltproc) Configuring custom-entities.ent using configuration Message: Skipping bootctl.1 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping journal-remote.conf.5 because HAVE_MICROHTTPD is false Message: Skipping journal-upload.conf.5 because HAVE_MICROHTTPD is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Message: Skipping loader.conf.5 because ENABLE_EFI is false Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) Program ln found: YES (/usr/bin/ln) ... Let's suffer one message only for each command. Hopefully we can silence even this when https://github.com/mesonbuild/meson/issues/8642 is resolved. (cherry picked from commit 596f5101f29c10256208132bfa9c502bf898fd8b) (cherry picked from commit 271b7dcbadd9fed70f87f29f30ef0925619037c9)
* systemd-coredump: Add conflict with shutdown.targetAlexander Sverdlin2021-05-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise a coredump started at the inconvinient moment can stop shutdown.target leaving the system in a halfway-down state: Pulling in shutdown.target/start from systemd-poweroff.service/start Added job shutdown.target/start to transaction. ... Keeping job shutdown.target/start because of systemd-poweroff.service/start ... [ OK ] Stopped target Remote File Systems. shutdown.target: starting held back, waiting for: systemd-networkd.socket sysinit.target: stopping held back, waiting for: remount_tmp.service systemd-coredump.socket: Incoming traffic ... systemd-coredump@0-243-0.service: Trying to enqueue job systemd-coredump@0-243-0.service/start/replace Added job systemd-coredump@0-243-0.service/start to transaction. Pulling in systemd-journald.socket/start from systemd-coredump@0-243-0.service/start Added job systemd-journald.socket/start to transaction. Pulling in system.slice/start from systemd-journald.socket/start Added job system.slice/start to transaction. Pulling in -.slice/start from system.slice/start Added job -.slice/start to transaction. Pulling in system-systemd\x2dcoredump.slice/start from systemd-coredump@0-243-0.service/start Added job system-systemd\x2dcoredump.slice/start to transaction. Pulling in system.slice/start from system-systemd\x2dcoredump.slice/start Pulling in shutdown.target/stop from system-systemd\x2dcoredump.slice/start Added job shutdown.target/stop to transaction. ... Keeping job systemd-poweroff.service/stop because of umount.target/stop Keeping job shutdown.target/stop because of systemd-coredump@0-243-0.service/start (cherry picked from commit 4e947bd04944e58df4103eee4cb8180b5008f143) (cherry picked from commit e11d3ec13c1ee7af65893e94d09d8b3b66cd99c9) (cherry picked from commit c8491deca6911eda63b9f06172d2c956762ba1b6)
* units: restore sysfs conditions in sys-fs-fuse-connections.mount and ↵Franck Bui2020-12-082-0/+2
| | | | | | | | | | | | | | | | | sys-kernel-config.mount Commit 42cc2855ba2fe4c6f5d incorrectly removed the condition on sysfs in both sys-fs-fuse-connections.mount and sys-kernel-config.mount. However there are still needed in case modprobe of one of these modules is intentionally skipped (due to lack of privs for example). This patch restores the 2 conditions which should be safe for the common case, since all conditions are only checked after all deps ordered before are complete. Follow-up for 42cc2855ba2fe4c6f5dc863507a1c843611350a0. (cherry picked from commit 07ccf434e77b17b20d773ce8b2637083cd4fdafc)
* units: wait until some fs modules are entirely loaded before mounting their ↵Franck Bui2020-12-082-4/+16
| | | | | | | | | | | | | | | | | | | | | | | corresponding filesystem udev requests to start the fs mount units when their respective module is loaded. For that it monitors uevents of type "ADD" for the relevant fs modules. However the uevent is sent by the kernel too early, ie before the init() of the module is called hence before directories in /sys/fs/ are created. This patch workarounds adds "Requires/After=modprobe@<fs-module>.service" to the mount unit, which means that modprobe(8) will be called once the fs module is announced to be loaded. This sounds pointless, but given that modprobe only returns after the initialization of the module is complete, it should workaround the issue. As a side effect, the module will be automatically loaded if the mount unit is started manually. Fixes #17586. (cherry picked from commit 42cc2855ba2fe4c6f5dc863507a1c843611350a0)
* Revert "units: skip modprobe@.service if the unit appears to be already loaded"Franck Bui2020-12-081-1/+0
| | | | | | | | | | | | | | This reverts commit 9cbf1e58f9629af5c6b56777ee73dc6320306d6d. The presence of /sys/module/%I directory can't be used to assert that the load of a given module is complete and therefore the call to modprobe(8) can be skipped. Indeed this directory is created before the init() function of the module is called. Users of modprobe@.service needs to be sure that once this service returns the module is fully operational. (cherry picked from commit b3e32582f67c68896b6b05893b138a975fa26454)
* units: unconditionally pull in remote-cryptsetup.target in the initramfsJonathan Lebon2020-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | [zjs: Replaces #17149. I took half of the patch in https://github.com/systemd/systemd/pull/17149#issuecomment-698399194, hence I'm keeping Jonathan's authorship. The original reasoning for 6c5496c492a8d74e54d22bf8824160cab1e63c10 was that we enable remote-cryptsetup.target via presets, and since presets are not used for the initrd, we need a different target. But since parts of the unit and target tree are shared between the initramfs and the main system, we can't just create a separate target for the initramfs. All the targets that depend on this one would need to be split also. That condition is true for initrd-fs.target, but not for sysinit.target. So let's instead just uncoditionally pull in remote-cryptsetup.target in the initramfs. It should normally be empty, so there should be no impact on boots that don't have units in the target. Jonathan's patch used initrd-root-fs.target, this version instead uses initrd-root-device.target. initrd-root-device.target is ordered before sysroot.mount, which means that the decrypted devices will be available earlier too.] (cherry picked from commit e921ebb57e0bc823ac167801cb5dd5f119f5d585)
* meson: simplify with_runlevels ternany op usageZbigniew Jędrzejewski-Szmek2020-12-081-2/+2
| | | | (cherry picked from commit d5816b6138be788f3d3ea72359bb28dc239c3235)
* units: update serial-getty@.service to support 57600 baud rateBjørn Mork2020-12-081-1/+1
| | | | | Fixes: #17306 (cherry picked from commit 7fe7547ba3b953c142f41a9931dba7b6ff78fe0b)
* units: pass CAP_SYS_RESOURCE to homedLennart Poettering2020-12-081-1/+1
| | | | | | | | The ext4 fs resize ioctl needs CAP_SYS_RESOURCE, irritatingly. Let's grant it to homed hence. Fixes: #15115 (cherry picked from commit c9ef77ec5ff5e7e283181e9dcfb93acfb0656ae6)
* units: order systemd-user-sessions.service after home.mountLennart Poettering2020-12-081-1/+1
| | | | | | | | | | | | | | | This should make /home as automount work reasonably well. If /home is an automount this has little effect at boot, because if the automount is not triggered it doesn't matter how the associated mount is ordered. It does matter at shutdown however, where home.mount is likely active now. There the ordering means we'll end sessions first, and only then deactivate home.mount. Fixes: #16291 (cherry picked from commit bbac7da2b379dfe951db23278ebe8a728ecce7a5)
* meson: RC_LOCAL_SCRIPT_PATH_START to RC_LOCAL_PATHZbigniew Jędrzejewski-Szmek2020-09-201-4/+4
| | | | | | | | | RC_LOCAL_SCRIPT_PATH_START and RC_LOCAL_SCRIPT_PATH_STOP were was originally added in the conversion to meson based on the autotools name. In 44508946534eee032927c263b79464832656dd6e RC_LOCAL_SCRIPT_PATH_STOP was dropped. We don't need to use such a long name. (cherry picked from commit 452d2dfd52f1cc686395663a6cd4c778306bd309)
* units: add missing usb-gadget.targetKyle Russell2020-09-011-0/+1
| | | | (cherry picked from commit dd050420390c6557354b0e3aaecd52abc4bf906c)
* Bump /tmp size back to 50% of RAMZbigniew Jędrzejewski-Szmek2020-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This should be enough to fix https://bugzilla.redhat.com/show_bug.cgi?id=1856514. But the limit should be significantly higher than 10% anyway. By setting a limit on /tmp at 10% we'll break many reasonable use cases, even though the machine would deal fine with a much larger fraction devoted to /tmp. (In the first version of this patch I made it 25% with the comment that "Even 25% might be too low.". The kernel default is 50%, and we have been using that seemingly without trouble since https://fedoraproject.org/wiki/Features/tmp-on-tmpfs. So let's just make it 50% again.) See 7d85383edbab73274dc81cc888d884bb01070bc2. (Another consideration is that we learned from from the whole initiative with zram in Fedora that a reasonable size for zram is 0.5-1.5 of RAM, and that pretty much all systems benefit from having zram or zswap enabled. Thus it is reasonable to assume that it'll become widely used. Taking the usual compression effectiveness of 0.2 into account, machines have effective memory available of between 1.0 - 0.2*0.5 + 0.5 = 1.4 (for zram sized to 0.5 of RAM) and 1.0 - 0.2*1.5 + 1.5 = 2.2 (for zram 1.5 sized to 1.5 of RAM) times RAM size. This means that the 10% was really like 7-4% of effective memory.) A comment is added to mount-util.h to clarify that tmp.mount is separate.
* Revert "units: drop OnFailure= from .target units"Zbigniew Jędrzejewski-Szmek2020-07-225-0/+10
| | | | | | | | | | | | | This reverts commit c7220ca8025e8dbded36131b23a502d975c45754. The removal was done as a reaction to the messages from systemd: initrd-root-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). initrd.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). initrd-root-device.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). initrd-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). local-fs.target: Requested dependency OnFailure=emergency.target ignored (target units cannot fail). ... But it seems that the messages themselves are wrong, and the units were OK.
* build: skip installation of 2 files if feature is disabledNorbert Lange2020-07-181-1/+1
| | | | | dont install systemd-update-utmp if utmp is disabled. dont install systemd-initctl.service if sysv is disabled.
* units: tweak udev unit descriptionsLennart Poettering2020-06-083-3/+3
|
* units: uppercase the descriptionZbigniew Jędrzejewski-Szmek2020-06-021-1/+1
| | | | https://github.com/systemd/systemd/pull/15982#pullrequestreview-422536495
* udevd: update snippet stringZbigniew Jędrzejewski-Szmek2020-05-301-1/+1
| | | | | Repeating the unit name in the description is not useful, and "manages devices" is too cryptic.
* Merge pull request #15942 from poettering/pass-pktinfoYu Watanabe2020-05-291-1/+1
|\ | | | | disable PassCredentials= on networkd netlink socket, enable NETLINK_PKTINFO instead
| * networkd: clean up NETLINK_PKTINFO vs. SO_PASSCRED confusionLennart Poettering2020-05-271-1/+1
| | | | | | | | | | | | | | | | | | We actually care for NETLINK_PKTINFO, not for SO_PASSCRED, hence when allocating the netlink socket, configure things accordingly. Tracked down by Benjamin Robin, see: https://github.com/systemd/systemd/pull/15571#issuecomment-633213747
* | homed: enable userdb too if homed is requestedLennart Poettering2020-05-281-0/+1
|/ | | | | | | | | | | | | | Strictly speaking you can run homed without userdb. But it doesn't really make much sense: they go hand in hand and implement the same concepts, just for different sets of users. Let's hence disable both automatically by default if homed is requested. (We don't do the reverse: opting into userdbd shouldn't mean that you are OK with homed.) And of course, users can always deviate from our defaults easily, and turn off userbd again right-away if they don't like it, and things will generally work.
* Merge pull request #15226 from benzea/benzea/xdg-autostart-generatorLennart Poettering2020-05-272-0/+18
|\ | | | | xdg-autostart-generator: a generator for XDG autostart files
| * xdg-autostart-generator: Add a generator for XDG autostart filesBenjamin Berg2020-05-272-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This generator can be used by desktop environments to launch autostart applications and services. The feature is an opt-in, triggered by xdg-desktop-autostart.target being activated. Also included is the new binary xdg-autostart-condition. This binary is used as an ExecCondition to test the OnlyShowIn and NotShowIn XDG desktop file keys. These need to be evaluated against the XDG_CURRENT_DESKTOP environment variable which may not be known at generation time. Co-authored-by: Henri Chain <henri.chain@enioka.com>
* | units: remove KillMode=process in our regular gettysLennart Poettering2020-05-264-0/+8
|/ | | | | | | In our regular gettys the actual shell commands live the the session scope anyway (as long as logind is used). Hence, let's avoid KillMode=process, it serves no purpose and is simply unsafe since it disables systemd's own process lifecycle management.
* units: don't set PrivateNetwork= in systemd-homed.serviceLennart Poettering2020-05-261-1/+0
| | | | | | | | | We want to watch USB sticks being plugged in, and that requires AF_NETLINK to work correctly and get the host's events. But if we live in a network namespace AF_NETLINK is disconnected too and we'll not get the host udev events. Fixes: #15287
* Merge pull request #15920 from keszybz/userwork-proc-titleLennart Poettering2020-05-261-1/+1
|\ | | | | Avoid log noise when setting proc titles and some doc updates
| * tree-wide: s/time-out/timeout/gZbigniew Jędrzejewski-Szmek2020-05-261-1/+1
| | | | | | | | See 3f9a0a522f2029e9295ea5e9984259022be88413 for justification.
* | dont install systemd-initctl, runlevel, telinit if no SYSV compatNorbert Lange2020-05-261-6/+8
|/ | | | systemd-initctl executable is still built.
* allow removal of initrd servicesNorbert Lange2020-05-191-10/+10
|
* tree-wide: add size limits for tmpfs mountsTopi Miettinen2020-05-131-1/+1
| | | | | | | | | | | | | | | | | Limit size of various tmpfs mounts to 10% of RAM, except volatile root and /var to 25%. Another exception is made for /dev (also /devs for PrivateDevices) and /sys/fs/cgroup since no (or very few) regular files are expected to be used. In addition, since directories, symbolic links, device specials and xattrs are not counted towards the size= limit, number of inodes is also limited correspondingly: 4MB size translates to 1k of inodes (assuming 4k each), 10% of RAM (using 16GB of RAM as baseline) translates to 400k and 25% to 1M inodes. Because nr_inodes option can't use ratios like size option, there's an unfortunate side effect that with small memory systems the limit may be on the too large side. Also, on an extremely small device with only 256MB of RAM, 10% of RAM for /run may not be enough for re-exec of PID1 because 16MB of free space is required.
* units: change description of systemd-logind.serviceZbigniew Jędrzejewski-Szmek2020-05-051-1/+1
| | | | | | "Login Service" doesn''t explain much, esp. considering that logind is actually is for logins. I think "User Login Management" is better, but not that great either. Suggestions welcome.
* binfmt: also unregister binfmt entries from unitLennart Poettering2020-04-231-0/+1
| | | | | | | | | | | | | | | | | | | | We unregister binfmt_misc twice during shutdown with this change: 1. A previous commit added support for doing that in the final shutdown phase, i.e. when we do the aggressive umount loop. This is the robust thing to do, in case the earlier ("clean") shutdown phase didn't work for some reason. 2. This commit adds support for doing that when systemd-binfmt.service is stopped. This is a good idea so that people can order mounts before the service if they want to register binaries from such mounts, as in that case we'll undo the registration on shutdown again, before unmounting those mounts. And all that, just because of that weird "F" flag the kernel introduced that can pin files... Fixes: #14981
* units: use correct path to refer to plymouthLennart Poettering2020-04-162-2/+2
| | | | | | | | | This doesn't really matter, since in non-/usr-merged systems plymouth needs to be in /bin and on merged ones it doesn't matter, but it is still prettier to insert the right path, and avoid /bin on merged systems, since it's just a compat symlink. Replaces: #15351
* units: make sure systemd-pstore stops at shutdownLennart Poettering2020-04-081-1/+2
| | | | | This doesn't matter too much given that the service doesn't do anything on shutdown, but let's still stop it to make things cleaner.
* units: drop systemd-remount-fs.service dependency from more servicesLennart Poettering2020-04-084-4/+3
| | | | | All services using StateDirectory= don't need the explicit dep anymore, let's hence drop it everywhere.
* units: drop dependency on systemd-remount-fs.service from systemd-pstore.serviceLennart Poettering2020-04-081-2/+0
| | | | | | | | This dependency is now generated automatically given we use StateDirectory=. Moreover the combination of Wants= and After= was too strong anway, as whether remount-fs is pulled in or not should not be up to systemd-pstore.service, and in fact is part of the initial transaction anyway.
* units: pull in systemd-pstore.service from sysinit.targetLennart Poettering2020-04-081-1/+2
| | | | | | | | sysinit.target is the target our early boot services are generally pulled in from, make systemd-pstore.service not an exception of that. Effectively this doesn't mean much, either way our unit is part of the initial transaction.
* units: add ProtectClock=yesTopi Miettinen2020-04-076-0/+8
| | | | | | Add `ProtectClock=yes` to systemd units. Since it implies certain `DeviceAllow=` rules, make sure that the units have `DeviceAllow=` rules so they are still able to access other devices. Exclude timesyncd and timedated.
* units: run systemd-repart only if there's configuration for itLennart Poettering2020-04-021-0/+4
|
* Revert "units: make systemd-repart.service installable"Lennart Poettering2020-04-022-5/+2
| | | | | | | | | | | | | | | | | | | | This reverts commit 7e1ed1f3b29162df25064b33dc55ac8cf432bb0b. systemd-repart is not a user service that should be something people enable/disable, instead it should just work if there's configuration for it. It's like systemd-tmpfiles, systemd-sysusers, systemd-load-modules, systemd-binfmt, systemd-systemd-sysctl which are NOPs if they have no configuration, and thus don't hurt, but cannot be disabled since they are too deep part of the OS. This doesn't mean people couldn't disable the service if they really want to, there's after all "systemctl mask" and build-time disabling, but those are OS developer facing instead of admin facing, that's how it should be. Note that systemd-repart is in particular an initrd service, and so far enable/disable state of those is not managed anyway via "systemctl enable/disable" but more what dracut decides to package up and what not.
* Merge pull request #15109 from keszybz/units-make-installableZbigniew Jędrzejewski-Szmek2020-04-025-7/+18
|\ | | | | Make homed/userdbd/repart services installable (to allow uninstalling)
| * units: make systemd-userdbd.{socket,service} installableZbigniew Jędrzejewski-Szmek2020-03-313-2/+7
| | | | | | | | | | | | | | | | It's lightweight and generally useful, so it should be enabled by default. But users might want to disable it for whatever reason, and things should be fine without it, so let's make it installable so it can be disabled if wanted. Fixes #15175.
| * units: make systemd-homed.service installableZbigniew Jędrzejewski-Szmek2020-03-312-2/+5
| | | | | | | | Fixes #15083. Users might want to disable homed if not used to save resources.
| * units: make systemd-repart.service installableZbigniew Jędrzejewski-Szmek2020-03-312-3/+6
| | | | | | | | | | | | This essentially adds another layer of configurability: build disable, this, presence of configuration. The default is set to enabled, because the service does nothing w/o config.
* | units: do not pull in home.mount from systemd-homed.serviceLennart Poettering2020-03-311-1/+1
|/ | | | | | | | | /home is posibly a remote file system. it makes sense to order homed after it, so that we can properly enumerate users in it, but we probably shouldn't pull it in ourselves, and leave that to users to configure otherwise. Fixes: #15102
* systemd-network-generator.service: network-pre.target is a passive target unitFranck Bui2020-03-271-1/+2
|
* units: Don't mount tracefs in LXCBalint Reczey2020-03-231-0/+1
| | | | | | | Mounting tracefs fails in unprivileged LXC containers and latest LXD (3.23) bind mounts tracefs already. Fixes https://github.com/lxc/lxd/issues/7059
* homed: replace "home directory" with "home area" in a few placesZbigniew Jędrzejewski-Szmek2020-03-111-1/+1
|
* Merge pull request #15022 from keszybz/make-units-remain-after-exitYu Watanabe2020-03-062-0/+2
|\ | | | | Make units remain after exit