1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

62925 Commits

Author SHA1 Message Date
Lennart Poettering
92e1a20998 logind: hook up memory pressure + SIGRTMIN+18 2023-03-01 09:43:23 +01:00
Lennart Poettering
11d78c31e4 homed: hook up memory pressure/SIGRTMIN+18 handling 2023-03-01 09:43:23 +01:00
Lennart Poettering
79d905af0a udevd: enable memory pressure/SIGRTMIN+18 logic 2023-03-01 09:43:23 +01:00
Lennart Poettering
4bdb8bd9ec machined: add support for memory pressure + SIGRTMIN+18 2023-03-01 09:43:23 +01:00
Lennart Poettering
375c34d8cd journald: hook up journald with the memory pressure and SIGRTMIN+18 logic 2023-03-01 09:43:23 +01:00
Lennart Poettering
bb3517181b resolved: flush caches on memory pressure and support SIGRTMIN+18 2023-03-01 09:43:23 +01:00
Lennart Poettering
9b2c161481 shared: add a common SIGRTMIN-18 handler 2023-03-01 09:43:23 +01:00
Luca Boccassi
45db7b53e7
Merge pull request #26548 from poettering/user-record-ambient
add ambient/bounding set fields to user records, and set CAP_WAKE_ALARM by default for local regular user sessions
2023-02-28 23:40:57 +00:00
Lennart Poettering
a1012609f3 update NEWS 2023-02-28 21:42:29 +01:00
Lennart Poettering
d7fce219ae test: test setting ambient caps via pam_systemd.so 2023-02-28 21:42:29 +01:00
Lennart Poettering
bf1b9ae487 pam_systemd: process the two new capabilities user records fields in pam_systemd
And also: by default, for the systemd-user service and for local
sessions (i.e. those assigned to a seat): let's imply CAP_WAKE_SYSTEM
for them by default. Yes, let's pass one specific capability by default to local
unprivileged users.

The capability services exactly once purpose: to allow system wake-up
from suspend via alarm clocks, hence is relatively limited in focus. By
adding this tools such as GNOME's Alarm Clock app can simply allocate a
CLOCK_REALTIME_ALARM (or ask systemd --user to do this) timer and it
will wake up the system as necessary.

Note that systemd --user will not pass the ambient caps on by default,
so even with this change, individual services need to use
AmbientCapabilities= to pass this on to the individual programs.

Fixes: #17564 #21382
2023-02-28 21:42:29 +01:00
Lennart Poettering
fada2c75a4 homectl: make the new caps field configurable via homectl 2023-02-28 21:42:29 +01:00
Lennart Poettering
8e1bc689de user-record: extend user records with an ambient and bounding caps set field
In particular the ambieht caps field is useful: we can use it later to
pass caps such as CAP_WAKE_ALARM to regular users on login.
2023-02-28 21:42:29 +01:00
Lennart Poettering
b65a4aec05 mkosi: add some really basic tools to default mkosi image
"passwd" and "pscap" are extremely useful to debug basic OS behaviour,
and tiny. So let's add them to our default development images, just to
save us some headaches.
2023-02-28 21:42:29 +01:00
Luca Boccassi
9ea9865361
Merge pull request #26608 from medhefgo/boot-arm
boot: Some ARM fixes
2023-02-28 18:48:45 +00:00
Antonio Alvarez Feijoo
835b781fc1 man: fix typo in systemd.generator 2023-02-28 15:37:29 +00:00
Jan Janssen
ce7180b680 boot: Provide div0 handlers for ARM
This is a cleaner approach to 59833064742310bfccf028b0278811ba5cff8dcf.
2023-02-28 14:37:05 +01:00
Jan Janssen
d14eb24925 boot: Fix data model detection for ARM
For whatever reason, ARM does not define __ILP32__.
2023-02-28 14:37:05 +01:00
Lennart Poettering
90ec8ebe33 psi-util: fix error handling
We checked ERRNO_IS_NOT_SUPPORTED on a possible positive non-error code,
which isn't right.

Fix that. Also add caching, since we are about to call this more often.
2023-02-28 12:16:59 +00:00
Lennart Poettering
9897f5ddea sd-event: handle kernels that set CONFIG_PSI_DEFAULT_DISABLED more gracefully
If CONFIG_PSI_DEFAULT_DISABLED is set in the kernel, then the PSI files
will be there, and you can open them, but read()/write() will fail.
Which is terrible, since that happens so late. But anyway, handle this
gracefully.
2023-02-28 12:15:13 +00:00
Luca Boccassi
68a5526734
Merge pull request #26605 from poettering/noxenix
journal error message fixes
2023-02-28 12:14:16 +00:00
Lennart Poettering
0631aabdf5 journald: remove triplicate logging about failure to write log lines
Let's log exactly at one place about failed writing of log lines to
journal file: in shall_try_append_again().

Then, if we decide to suppress a retry-after-vacuum because we already
vacuumed anyway then say this explicitly as "supressed rotation",
because that's what we do here.

This removes triplicate logging about the same error, and logs exactly
once, plus optional one "suppressed rotation" message. (plus more debug
output). The triplicate logging was bad in particular because it had no
understanding of the actual error codes and just showed generic UNIX
error strings ("Not a XENIX named type file"). By relying on
shall_try_append_again() to do all logging we now get very clean error
strings for all conditions.

Fixes: #26496
2023-02-28 09:32:42 +01:00
Lennart Poettering
32b0678c86 journald: always pass error code to logging function, even if we don't use it with %m
We always want to pass the error code along with the log call, so that
it can add it to structured logging, even if the format string does not
contain %m.
2023-02-28 09:32:42 +01:00
Lennart Poettering
8253cb35fa journald: upgrade log message about missing mmap() support to LOG_ERR
in this case we really cannot proceed and fail. Let's log about this
loudly, since we simply fail the operation to write anything.
2023-02-28 09:32:42 +01:00
Lennart Poettering
ab84a03fda journald: downgrade various log messages from LOG_WARNING to LOG_INFO
None of these conditions are real issues, but they can simply happen
because we just swtched from /run to /var as backend for logging and
there are old files from different boots with different systemd versions
and so on.

Let's not make more noise than necessary: still log, but not consider it
a warning, but just some normal thing.

We are handling these issues safely after all: by rotating and starting
anew, i.e. there's no reason to be concerned.
2023-02-28 09:32:42 +01:00
Lennart Poettering
07a06f5d0c journald: start log message uppercase, like every other one around 2023-02-28 09:32:42 +01:00
Lennart Poettering
d6df3bfbb8 journald: make sure shall_try_append_again() logs about all return codes passed in, not just some 2023-02-28 09:32:42 +01:00
David Tardon
7c78a19322 systemctl: print better message if default target is masked
If the default target is masked, `systemctl get-default` prints

  Failed to get default target: Operation not possible due to RF-kill

That's a bit too cryptic, so let's make it clear what's actually
happening.

Fixes #26589.
2023-02-28 06:45:15 +09:00
Luca Boccassi
fe56f21ae3 tests: temporarily disable time-util failing tests
These are failing since https://github.com/systemd/systemd/pull/26409
disable for now
2023-02-27 21:37:58 +00:00
Lennart Poettering
41aca66ba4 Revert "dissect-image: don't probe swap partitions needlessly"
This reverts commit df4524cb3796529b435af309f5e6a2d92bcdaaa0.

This commit is just wrong. The thing is that we *don't* know
automatically that the partition contains a swap image, because it could
be encrypted.

Hence revert.

Fixes: #26595
2023-02-27 19:11:17 +01:00
Lennart Poettering
a69a520bd4 update TODO 2023-02-27 19:07:34 +01:00
David Tardon
95cf8cae77 test: add coverage test for udevadm 2023-02-27 07:22:20 +09:00
Yu Watanabe
e6faa55878
Merge pull request #26578 from thkukuk/main
sd-login: add sd_uid_get_login_time interface #26574
2023-02-26 07:54:11 +09:00
Dmitry V. Levin
dc652e7dc3 rules: remove redundant duplicate comparisons
$ grep -F -n -o 'ENV{DISKSEQ}=="?*", ' rules.d/60-persistent-storage.rules
139:ENV{DISKSEQ}=="?*",
139:ENV{DISKSEQ}=="?*",
140:ENV{DISKSEQ}=="?*",
140:ENV{DISKSEQ}=="?*",

Reported-by: Alexey Gladkov <legion@kernel.org>
Fixes: 17d97d4c90f8 ("udev: create disk/by-diskseq symlink only when the device has diskseq")
Fixes: 583dc6d933d8 ("udev: also create partition /dev/disk/by-diskseq/ symlinks")
2023-02-26 07:51:26 +09:00
Thorsten Kukuk
634c64a517 sd-login: document that result is in microseconds 2023-02-25 16:14:11 +01:00
Thorsten Kukuk
d622fefc00 sd-login: add sd_uid_get_login_time interface #26574 2023-02-25 16:14:11 +01:00
Lennart Poettering
d70e4bc9f1 tpm2-util: use compound initialization when allocating tpm2 objects 2023-02-24 21:51:19 +00:00
Jan Janssen
eb81a60c73 tree-wide: Use correct SPDX license identifier 2023-02-24 18:53:17 +00:00
Lennart Poettering
aff131775b man: add two missing commands to synopsys 2023-02-24 17:11:57 +01:00
Lennart Poettering
8b098d94ae update TODO 2023-02-24 17:09:04 +01:00
Lennart Poettering
0a75dca1cc
Merge pull request #26579 from poettering/manager-env-clean-up
service manager env var clean-up fixes
2023-02-24 14:11:57 +01:00
Lennart Poettering
9b47b18a1a mempool: fix tile alignment check
We should check alignment *after* determining the pointer points into
our pool, not before. Otherwise might might end up checking alignment of
the pointer relative to our base, even though it is taken relative to
some other base.

Follow-up for: a2b052b29f8bc141e94a4af95d1653a38a57eaeb
See: https://github.com/systemd/systemd/pull/26393#issuecomment-1442295012
2023-02-24 14:11:31 +01:00
Lennart Poettering
ccacde77f3 libsystemd: sd_journal_get_seqnum() must be tagged with 254 symver, not 253
This is a follow-up for b1712fabd1702640b04b0acdbba2d78294313a4d which
was prepped for 253, but merged into early 254 development cycle. It
thus had the symbol it adds at the wrong symver. Fix thta.
2023-02-24 13:49:45 +01:00
Luca Boccassi
e1e6d5f353
Merge pull request #26409 from yuwata/parse-timestamp
fix parse_timestamp()
2023-02-24 11:45:03 +00:00
Luca Boccassi
0e550cbc63
Merge pull request #26217 from bluca/dump_mem
Add D-Bus method and analyze command to dump malloc_info()
2023-02-24 10:31:21 +00:00
Lennart Poettering
e7a2594219 man: document REMOTE_ADDR/REMOTE_PORT along with the other env vars 2023-02-24 10:23:53 +01:00
Lennart Poettering
c792a2e5db manager: be more careful with env var clean-up
Let's add some more env vars we nowadays set for activated services to
the list of env vars we strip from the environment block we pass on.
2023-02-24 10:23:53 +01:00
Yu Watanabe
9cddd36707
Merge pull request #26574 from YHNdnzj/sd-login-new-interface
sd-login: add two interfaces for retriving session info
2023-02-24 09:20:52 +09:00
Yu Watanabe
8b51c41fd0 test: add tests for format_timestamp() and parse_timestamp() with various timezone 2023-02-24 08:55:28 +09:00
Yu Watanabe
7a9afae604 time-util: make parse_timestamp() use the RFC-822/ISO 8601 standard timezone spec
If the timezone is specified with a number e.g. +0900 or so, then
let's parse the time as a UTC, and adjust it with the specified time
shift.

Otherwise, if an area has timezone change, e.g.
---
Africa/Casablanca  Sun Jun 17 01:59:59 2018 UT = Sun Jun 17 01:59:59 2018 +00 isdst=0 gmtoff=0
Africa/Casablanca  Sun Jun 17 02:00:00 2018 UT = Sun Jun 17 03:00:00 2018 +01 isdst=1 gmtoff=3600
Africa/Casablanca  Sun Oct 28 01:59:59 2018 UT = Sun Oct 28 02:59:59 2018 +01 isdst=1 gmtoff=3600
Africa/Casablanca  Sun Oct 28 02:00:00 2018 UT = Sun Oct 28 03:00:00 2018 +01 isdst=0 gmtoff=3600
---
then we could not determine isdst from the timezone (+01 in the above)
and mktime() will provide wrong results.

Fixes #26370.
2023-02-24 08:55:27 +09:00