Commit Graph

1243 Commits

Author SHA1 Message Date
Lennart Poettering 048b4dc2e1 units: tweak udev unit descriptions 2020-06-08 16:53:37 +02:00
Zbigniew Jędrzejewski-Szmek 41a7c3bf5d units: uppercase the description
https://github.com/systemd/systemd/pull/15982#pullrequestreview-422536495
2020-06-02 14:14:20 +02:00
Zbigniew Jędrzejewski-Szmek d1109e12c0 udevd: update snippet string
Repeating the unit name in the description is not useful, and "manages devices"
is too cryptic.
2020-05-30 17:15:20 +02:00
Yu Watanabe 27cd09442f
Merge pull request #15942 from poettering/pass-pktinfo
disable PassCredentials= on networkd netlink socket, enable NETLINK_PKTINFO instead
2020-05-29 15:23:15 +09:00
Lennart Poettering 871dc8d644 homed: enable userdb too if homed is requested
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.
2020-05-28 23:38:29 +02:00
Lennart Poettering 43007b302e networkd: clean up NETLINK_PKTINFO vs. SO_PASSCRED confusion
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
2020-05-27 22:40:56 +02:00
Lennart Poettering 6bce17455e
Merge pull request #15226 from benzea/benzea/xdg-autostart-generator
xdg-autostart-generator: a generator for XDG autostart files
2020-05-27 18:41:01 +02:00
Benjamin Berg 8feca2472c xdg-autostart-generator: Add a generator for XDG autostart files
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>
2020-05-27 09:02:10 +02:00
Lennart Poettering 021acbc188 units: remove KillMode=process in our regular gettys
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.
2020-05-26 23:52:09 +02:00
Lennart Poettering 48432791ac units: don't set PrivateNetwork= in systemd-homed.service
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
2020-05-26 23:37:44 +02:00
Lennart Poettering 7257f717c1
Merge pull request #15920 from keszybz/userwork-proc-title
Avoid log noise when setting proc titles and some doc updates
2020-05-26 18:29:06 +02:00
Norbert Lange 6589a56972 dont install systemd-initctl, runlevel, telinit if no SYSV compat
systemd-initctl executable is still built.
2020-05-26 15:04:36 +02:00
Zbigniew Jędrzejewski-Szmek 201632e314 tree-wide: s/time-out/timeout/g
See 3f9a0a522f for justification.
2020-05-26 10:28:59 +02:00
Norbert Lange cdf7ad38b6 allow removal of initrd services 2020-05-19 10:19:18 +02:00
Topi Miettinen 7d85383edb tree-wide: add size limits for tmpfs mounts
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.
2020-05-13 00:37:18 +02:00
Zbigniew Jędrzejewski-Szmek cd7e1e1a7f units: change description of systemd-logind.service
"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.
2020-05-05 22:34:17 +02:00
Lennart Poettering 846acb6798 binfmt: also unregister binfmt entries from unit
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
2020-04-23 17:14:45 +02:00
Lennart Poettering e46736fbb6 units: use correct path to refer to plymouth
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
2020-04-16 16:33:01 +02:00
Lennart Poettering b0c1a07654 units: make sure systemd-pstore stops at shutdown
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.
2020-04-08 16:29:58 +02:00
Lennart Poettering e0f968ad96 units: drop systemd-remount-fs.service dependency from more services
All services using StateDirectory= don't need the explicit dep anymore,
let's hence drop it everywhere.
2020-04-08 16:29:41 +02:00
Lennart Poettering 0c978faa16 units: drop dependency on systemd-remount-fs.service from systemd-pstore.service
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.
2020-04-08 16:29:40 +02:00
Lennart Poettering 167241912f units: pull in systemd-pstore.service from sysinit.target
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.
2020-04-08 16:29:24 +02:00
Topi Miettinen cabc1c6d7a units: add ProtectClock=yes
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.
2020-04-07 15:37:14 +02:00
Lennart Poettering fdfe909123 units: run systemd-repart only if there's configuration for it 2020-04-02 17:07:48 +02:00
Lennart Poettering aade0c3b6e Revert "units: make systemd-repart.service installable"
This reverts commit 7e1ed1f3b2.

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.
2020-04-02 17:04:59 +02:00
Zbigniew Jędrzejewski-Szmek 4e561c6200
Merge pull request #15109 from keszybz/units-make-installable
Make homed/userdbd/repart services installable (to allow uninstalling)
2020-04-02 10:21:29 +02:00
Lennart Poettering 286fe8ee21 units: do not pull in home.mount from systemd-homed.service
/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
2020-03-31 15:22:48 +02:00
Zbigniew Jędrzejewski-Szmek ead7af3093 units: make systemd-userdbd.{socket,service} installable
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.
2020-03-31 14:55:16 +02:00
Zbigniew Jędrzejewski-Szmek 5ef9eda17f units: make systemd-homed.service installable
Fixes #15083. Users might want to disable homed if not used to save resources.
2020-03-31 14:55:14 +02:00
Zbigniew Jędrzejewski-Szmek 7e1ed1f3b2 units: make systemd-repart.service installable
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.
2020-03-31 14:51:04 +02:00
Franck Bui e730db6c90 systemd-network-generator.service: network-pre.target is a passive target unit 2020-03-27 18:30:57 +01:00
Balint Reczey cdc6c95737 units: Don't mount tracefs in LXC
Mounting tracefs fails in unprivileged LXC containers and latest LXD
(3.23) bind mounts tracefs already.

Fixes https://github.com/lxc/lxd/issues/7059
2020-03-23 08:34:48 +01:00
Zbigniew Jędrzejewski-Szmek b5947b5b10 homed: replace "home directory" with "home area" in a few places 2020-03-11 13:43:19 +01:00
Yu Watanabe 5197b41fac
Merge pull request #15022 from keszybz/make-units-remain-after-exit
Make units remain after exit
2020-03-06 21:14:36 +09:00
Zbigniew Jędrzejewski-Szmek 9cbf1e58f9 units: skip modprobe@.service if the unit appears to be already loaded
Possible alternative to #14819.

For me, setting RemainAfterExit=yes would be OK, but if people think that it
might cause issues, then this could be a reasonable alternative that still
let's us skip the invocation of the separate binary.
2020-03-05 18:43:50 +00:00
Zbigniew Jędrzejewski-Szmek d48eea583f units: make systemd-network-generator.service stay around
Once done, its done, and shouldn't be run again.
2020-03-05 15:15:08 +01:00
Yu Watanabe c1817e2528
Merge pull request #15023 from keszybz/network-generator-man
Man page for systemd-network-generator
2020-03-05 20:54:32 +09:00
Zbigniew Jędrzejewski-Szmek 4a29c185b7 man: add systemd-network-generator.service(8)
It's a bit bare-bones, but it should be enough to point the reader in the right
direction.
2020-03-05 08:20:06 +01:00
Zbigniew Jędrzejewski-Szmek 9fd32ff7d3 units: restore RemainAfterExit=yes in systemd-vconsole-setup.service
This reverts the second part of 8125e8d38e.
The first part was reverted in 750e550eba.
The problem starts when s-v-s.s is pulled in by something that is then pulled
in by sysinit.target. Every time a unit is started, systemd recursively checks
all dependencies, and since sysinit.target is pull in by almost anything, we'll
start s-v-s.s over and over. In particular, plymouth-start.service currently
has Wants=s-v-s.s and After=s-v-s.s.
2020-03-05 08:13:49 +01:00
Zbigniew Jędrzejewski-Szmek a3558e7952 units: do not ignore return value from systemd --user
This minus has been there since the unit was added in
d42d27ead9. I think the idea was not cause things
to fail if the user instance doesn't work. But ignoring the return value
doesn't seem to be the right way to approach the problem. In particular, if
the program fails to run, we'll get a bogus fail state, see
https://bugzilla.redhat.com/show_bug.cgi?id=1727895#c1:

with the minus:
$ systemctl start user@1002
Job for user@1002.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status user@1002.service" and "journalctl -xe" for details.

without the minus:
$ systemctl start user@1002
Job for user@1002.service failed because the control process exited with error code.
See "systemctl status user@1002.service" and "journalctl -xe" for details.
2020-03-05 04:49:37 +09:00
Kevin P. Fleming 3b355677b8 RequireMountsFor in systemd-nspawn should wait for machine mount
This patch modifies the RequireMountsFor setting in systemd-nspawn@.service to wait for the machine instance directory to be mounted, not just /var/lib/machines.

Closes #14931
2020-03-02 19:37:51 +09:00
Guillaume Douézan-Grard f4665664c4 units: disable ProtectKernelLogs for machined
machined needs access to the host mount namespace to propagate bind
mounts created with the "machinectl bind" command. However, the
"ProtectKernelLogs" directive relies on mount namespaces to make the
kernel ring buffer inaccessible. This commit removes the
"ProtectKernelLogs=yes" directive from machined service file introduced
in 6168ae5.

Closes #14559.
2020-03-02 14:49:14 +09:00
Balint Reczey 287f506c32 pstore: Don't start systemd-pstore.service in containers
Usually it is not useful and can also fail making
boot-and-services autopkgtest fail.
2020-02-27 14:26:34 +01:00
Norbert Lange aaaf42cb44 units: add mount for tracefs
Kernel 4.1 separated the tracing system from the debugfs,
actual documentation already points to a different path
that needs this new mount to exist.

the old sysfs path will still be an automount in the debugfs,
created by the kernel (for now).

Signed-off-by: Norbert Lange <nolange79@gmail.com>
2020-02-26 23:40:44 +01:00
Zbigniew Jędrzejewski-Szmek c7220ca802 units: drop OnFailure= from .target units
See c80a9a33d0, target units can't fail.
I guess we need to figure out some replacement functionality, but at least
let's avoid the warning from systemd for now.
2020-02-05 18:34:30 +01:00
Zbigniew Jędrzejewski-Szmek dc9fd22d3d Merge pull request #14398 from poettering/mount-prep 2020-02-04 16:28:51 +01:00
Lennart Poettering 340cb115b3 units: define RuntimeDirectory= in systemd-journald.service
It doesn't get us much, but makes the differences between the templated
and non-templated versions a bit smaller.
2020-01-31 15:04:24 +01:00
Lennart Poettering 5591cd4e20 units: sort settings in systemd-journald.service again 2020-01-31 15:04:15 +01:00
Lennart Poettering dc5437c78b journald: add ability to activate by varlink socket
If we have exit on idle, then operations such as "journalctl
--namespace=foo --rotate" should work even if the journal daemon is
currently not running.

(Note that we don't do activation by varlink for the main instance of
journald, I am not sure the deadlocks it might introduce are worth it)
2020-01-31 15:03:55 +01:00
Lennart Poettering 65c398c031 journald: add exit on idle 2020-01-31 15:03:44 +01:00