Commit Graph
58786 Commits
Author SHA1 Message Date
Evgeny Vereshchagin e99e4e4fec Merge pull request #24025 from DaanDeMeyer/mkosi-sanitizers
mkosi: Changes to allow booting with sanitizers in mkosi
2022-07-18 19:24:51 +03:00
Daan De Meyer 7ca9563ca1 mkosi: Remove usage of deprecated option names/sections 2022-07-18 16:54:58 +02:00
Daan De Meyer 69d638e67e mkosi: Changes to allow booting with sanitizers in mkosi
- Extra memory because ASAN needs it
- The environment variables to make the sanitizers more useful
- LD_PRELOAD because the ASAN DSO needs to be the first in the list
- The sanitizer library packages
- Disable syscall filters because they interfere with ASAN
- Disable systemd-hwdb-update because it's super slow when systemd-hwdb
  is built with sanitizers
- Take the value for meson's b_sanitize option from the SANITIZERS
  environment variable
2022-07-18 16:54:56 +02:00
Ansgar Burchardt 34aee208b5 man/system-or-user-ns.xml: explicitly refer to PrivateUsers= option
It is not clear what "unprivileged user namespaces are available" means.
It could mean either that they are only usable, that is, enabled in the kernel,
or they have been enabled for the specific service. Referring to the
`PrivateUsers=` options makes it clear that the latter is meant.
2022-07-18 13:54:51 +01:00
Luca Boccassi 9b9ddaf09d Merge pull request #24001 from yuwata/network-lifetime-fix
network: fixes for lifetime handling
2022-07-18 10:02:02 +01:00
Daan De Meyer 111ff5d511 mkosi: Update Ubuntu config to 22.04 2022-07-18 10:20:48 +02:00
Daan De Meyer 2401c9ace6 mkosi: Fix build script indentation 2022-07-18 10:20:48 +02:00
Daan De Meyer c0daae3ad8 mkosi: Enable meson developer mode 2022-07-18 10:20:48 +02:00
Daan De Meyer 2d2ac49787 mkosi: Don't try to install systemd-boot in non-efi images
When using mkosi's direct linux boot support, there's no EFI
system partition so don't try to install systemd-boot in that case.
2022-07-18 10:20:48 +02:00
Daan De Meyer a6e6b6954c mkosi: Install xxd in images
Came in handy while working on
https://github.com/systemd/systemd/pull/24024 so let's install it
in the image by default.
2022-07-18 10:20:43 +02:00
Yu Watanabe 5509518193 Merge pull request #24047 from dtardon/list-users-linger
Add linger status to `loginctl list-users`
2022-07-18 15:05:25 +09:00
Richard Huang 5f2b4f9cb9 Update sleep.conf HibernateDelaySec default to match implementation 2022-07-18 15:04:03 +09:00
Mitchell Freiderich 0216462f08 hwdb: Add Acer Aspire A317-33 (#24050)
Enables the power button on the Acer Aspire 3 A317-33
2022-07-18 15:03:44 +09:00
David Tardon cbc2593eea systemctl: include upheld units in dependencies
Fixes: #22706
2022-07-17 20:50:19 +01:00
David Tardon 283db37a20 test: merge grep | awk calls 2022-07-17 20:26:09 +02:00
David Tardon 6083f7a604 test: add a simple test for list-users 2022-07-17 20:26:09 +02:00
David Tardon c5912adc85 loginctl: add linger status to list-users output
Fixes: #3907
2022-07-16 15:10:26 +02:00
Vito Caputo 729d2df806 man: fix grammatical error in --cursor-file description
Just a minor cleanup to fix unparseable wording
2022-07-16 11:35:46 +09:00
Frantisek Sumsal e99b9285cb core: drop a stray %m specifier from a warning message
since in this specific case (r == 0) `errno` is irrelevant and most likely
set to zero, leading up to a confusing message:

```
[  120.595085] H systemd[1]: session-5.scope: No PIDs left to attach to the scope's control group, refusing: Success
[  120.595144] H systemd[1]: session-5.scope: Failed with result 'resources'.
```
2022-07-16 07:00:40 +09:00
Yu Watanabe 59159aee20 Merge pull request #24018 from keszybz/generator-cleanups
Make generators easier to test, fix various corner issues
2022-07-16 05:11:49 +09:00
Yu Watanabe c798e1dfee Merge pull request #24035 from yuwata/sd-event-cleanup
sd-event: tiny cleanups
2022-07-16 05:11:00 +09:00
Daan De Meyer 5edf875b92 coredump: Try to write journald coredump metadata to the journal
Currently, if journald coredumps, the coredump is written to
/var/lib/systemd/coredump but the coredump metadata is not written
to  the journal meaning we can't find out about the coredump's
existence via the journal. This means that coredumpctl can't be
used to work with journald coredumps, as well as any other tools
that rely on journald to know about coredumps.

To solve the issue, let's have systemd-coredump try to write
systemd-journald coredump metadata to the journal. We have to be
careful though, since if journald coredumps, there's no active
reader on the receive end of the journal socket, so we have to make
sure we don't deadlock trying to write to the socket. To avoid the
deadlock, we put the socket in nonblocking mode before trying to
write to it.
2022-07-15 19:27:00 +01:00
Lennart Poettering 3acb6edef3 sysusers: allow defining additional sysusers lines via credentials 2022-07-16 00:47:22 +09:00
lastkrick 69a7d10832 man: fix typo in systemd.network documentation in IPv6RoutePrefix section (#24030) 2022-07-16 00:45:56 +09:00
Yu Watanabe c8e9d15cbf sd-event: introduce PROTECT_EVENT() macro 2022-07-16 00:42:39 +09:00
Yu Watanabe 76d04c3a34 sd-event: drop redundant code
The function `source_io_unregister()` will be anyway called in
`source_disconnect()`.
2022-07-16 00:38:37 +09:00
Zbigniew Jędrzejewski-Szmek ff52ff2565 fstab-generator: do not skip /sysroot prefix if the mount point is missing
When chase_symlinks() is called on something on a doesn't exist, it immediately
returns an error. But we were relying on it to prepend "/sysroot/". If it
fails, we need to do that ourselves.

For example, with /sysroot/etc/fstab containing a line for /foo, if /sysroot/foo
doesn't exist, we'd generate a mount point for /foo.
2022-07-15 15:48:05 +02:00
Zbigniew Jędrzejewski-Szmek 640dc2f3ad fsck,sulogin: fix cargo-culted comment 2022-07-15 15:48:05 +02:00
Zbigniew Jędrzejewski-Szmek da69e8e430 fstab-generator: rename 'post' variable
Originally (6b1dc2bd3c) we had 'pre' and 'post'
to refer to remote-fs-pre.target and remote-fs.target or local-fs-pre.target
and local-fs.target. But 'pre' is long gone, and 'post' by itself doesn't
make much sense. Rename it for clarity.
2022-07-15 15:48:05 +02:00
Zbigniew Jędrzejewski-Szmek 4981427cd4 fstab-generator: tweak comments 2022-07-15 15:48:05 +02:00
Zbigniew Jędrzejewski-Szmek 99e3d47679 fstab-generator: allow overriding path to /sysroot/etc/fstab too
This adds $SYSTEMD_SYSROOT_FSTAB analoguous to $SYSTEMD_FSTAB.
2022-07-15 15:48:05 +02:00
Zbigniew Jędrzejewski-Szmek 7772c177b8 fstab-generator: properly report the source of data
Mount information can come from /etc/fstab, /sysroot/etc/fstab, and
/proc/cmdline. Even when we had the path to the right source handy, we would
often write something inaccurate. In particular, in the initrd, we would
generally write "/etc/fstab" instead of "/sysroot/etc/fstab" for no good
reason.
2022-07-15 15:48:05 +02:00
Zbigniew Jędrzejewski-Szmek efc5fd3d72 fstab-generator: use path_equal() to detect alternate spellings of /usr
In the initrd we would treat e.g. "/usr/" as different from "/usr", which
doesn't seem right.
2022-07-15 15:48:05 +02:00
Zbigniew Jędrzejewski-Szmek 911017f052 generators: only redirect logging when invoked by systemd
We would always print output to the kmsg or journal, but that is only needed
and useful when invoked by systemd. So let's skip redirection unless we are
invoked by systemd. Otherwise, let's log normally. This makes test invocations
easier, and also helps when the generator is invoked by mistake. If redirection
is necessary, the generator can be invoked with SYSTEMD_LOG_TARGET=… even
during tests.
2022-07-15 15:48:05 +02:00
Zbigniew Jędrzejewski-Szmek 494f4ee9c7 basic/log: split out invoked_by_systemd() utility function 2022-07-15 15:47:23 +02:00
Łukasz Stelmach 963b6b906e core: drop ambient capabilities in user manager
Ambient capabilities should not be passed implicitly to user
services. Dropping them does not affect the permitted and effective sets
which are important for the manager itself to operate.
2022-07-15 15:35:22 +02:00
Lennart Poettering d8e4960bf1 import: fix format strings 2022-07-15 15:24:29 +02:00
Lennart Poettering 9fbb7df7bc Merge pull request #24011 from poettering/condition-cred
pid1: add new condition type "ConditionCredential=" for checking for credentials passed into the system
2022-07-15 15:03:49 +02:00
Lennart Poettering 50492ce815 cgroups-agent: connect stdin/stdout/stderr to /dev/null
Inspired by https://github.com/systemd/systemd/pull/24024 this is
another user mode helper, where this might be an issue. hence let's
rather be safe than sorry, and also connect stdin/stdout/stderr
explicitly with /dev/null.
2022-07-15 14:51:41 +02:00
Lennart Poettering 81b739d258 Merge pull request #24010 from poettering/tmpfiles-base64-data
tmpfiles: optionally allow configuring file contents for f/w lines to be encoded in base64
2022-07-15 14:50:56 +02:00
Zbigniew Jędrzejewski-Szmek 17021368fc generators: accept one or three args, do not write to /tmp
Since the general generator logic was established in the rewrite in
07719a21b6, generators would always write to /tmp
by default. I think this not a good default at all, because generators write a
bunch of files and would create a mess in /tmp. And for debugging, one
generally needs to remove all the files in the output directory, because
generators will complain in the output paths are already present. Thus the
approach of disabling console logging and writing many files to /tmp when
invoked with no arguments is not nice, so let's disallow operation with no
args.

But when debugging, one generally does not care about the separate output dirs
(most generators use only one). Thus the general pattern I use is something
like:
  rm -rf /tmp/x && mkdir /tmp/x && build/some-generator /tmp/{x,x,x}
This commit allows only one directory to be specified and simplifies this to:
  rm -rf /tmp/x && mkdir /tmp/x && build/some-generator /tmp/x
2022-07-15 13:10:39 +02:00
Zbigniew Jędrzejewski-Szmek b711a9ee18 bless-boot-generator: use DEFINE_MAIN_GENERATOR_FUNCTION()
DEFINE_MAIN_GENERATOR_FUNCTION() always sets dest*, so there should be no
change in behaviour.
2022-07-15 13:10:34 +02:00
Zbigniew Jędrzejewski-Szmek b8110a3eb8 hibernate-resume-generator: use DEFINE_MAIN_GENERATOR_FUNCTION()
DEFINE_MAIN_GENERATOR_FUNCTION() always sets dest*, so there should be no
change in behaviour.
2022-07-15 13:09:38 +02:00
Lennart Poettering 3a632fc1eb tmpfiles: minor shortening of code 2022-07-15 11:55:45 +02:00
Lennart Poettering 708daf42d8 tmpfiles: optionally, decode string to write to files with base64
This is useful to use "f" or "w" to write arbitrary binary files to
disk, or files with newlines and similar (for example to provision SSH
host keys and similar).
2022-07-15 11:55:03 +02:00
Lennart Poettering b89cfe8a60 update TODO 2022-07-15 11:46:20 +02:00
Daan De Meyer 1f9d2a8199 coredump: Connect stdout/stderr to /dev/null before doing anything
When invoked as the coredump handler by the kernel, systemd-coredump's
stdout and stderr streams are closed. This is dangerous as this means
the fd's can get reallocated, leading to hard to debug errors such as
log messages ending up being appended to a compressed coredump file.

To avoid such issues in the future, let's bind stdout/stderr to
/dev/null so the file descriptors can't get used for anything else.
2022-07-15 11:06:18 +02:00
Lennart Poettering 462511c8c6 man: fix copy/paste typo 2022-07-15 10:53:45 +02:00
Lennart Poettering 351f7d5143 fuzz: add ConditionCredential= to fuzz files, and sort their sections 2022-07-15 10:53:45 +02:00
Lennart Poettering 2c7b8f3dd5 update TODO 2022-07-15 10:53:45 +02:00