1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00
Commit Graph

63695 Commits

Author SHA1 Message Date
Yu Watanabe
8067fe86ff test: add tests for fd_get_path() 2023-03-30 12:03:33 +09:00
Lennart Poettering
62c72c60b5 units: let's establish the coredump socket before writting core_pattern sysctl
It's a bit nicer if we only write the sysctl core_pattern once the
coredump socket is established, since it's the backend for the handler.

Given the systemd-coredump.socket basically has no dependencies that run
before it this should not really make things slower or so, it just
removes the tiny window where core pattern is in effect that wants to
connect to the backend socket but cannot.

The status quo isn't terrible, and not too different in effect: either
way, until the socket unit is up we won't process coredumps. It's mostly
what kind of behaviour you get then: an error due to /bin/false being
invoked, or an error because systemd-coredump can't connect to its
socket. After this patch we'll exclusively see the former.
2023-03-30 08:53:52 +09:00
Mike Yuan
c884484956
Merge pull request #27053 from DaanDeMeyer/firstboot-followups
Firstboot followups
2023-03-30 04:22:16 +08:00
Lennart Poettering
2e34aed32b
Merge pull request #26971 from poettering/autostart-dead-failed
pid1: introduce new SERVICE_{DEAD|FAILED}_BEFORE_AUTO_RESTART service…
2023-03-29 21:41:31 +02:00
Lennart Poettering
a7b6eee4ac
Merge pull request #26968 from DaanDeMeyer/exec-runtime
core: Introduce unit private exec runtime
2023-03-29 21:40:48 +02:00
Lennart Poettering
3739c2fdfc update TODO 2023-03-29 19:09:10 +02:00
Lennart Poettering
b0717f1b82 test: add test case for fdstore dumping logic, and systemd-notify --fd= 2023-03-29 19:09:10 +02:00
Lennart Poettering
6e4a324574 notify: add support for sending fds with notification messages
This exposes the fd passing we support via sd_pid_notify_with_fds() also
via the command line tool systemd-notify.
2023-03-29 19:09:10 +02:00
Lennart Poettering
e829f28c1b fdset: add new fdset_consume() helper 2023-03-29 19:09:10 +02:00
Lennart Poettering
bdcad22e8e fdset: add new helper to convert an fdset to an array 2023-03-29 19:09:10 +02:00
Lennart Poettering
08a0ebc6be fdset: minor modernizations
Let's use more _cleanup_ expressions. Various other modernizations. No
actual code changes, except for maybe a conversion to use heap memory
when generating an array of fds, instead of stack as before. Given that
fdstores are typically user controlled, that should be a wise idea.
2023-03-29 19:09:10 +02:00
Lennart Poettering
5f43c97cd2 analyze: add new fdstore verb 2023-03-29 19:09:10 +02:00
Lennart Poettering
2ea24611b9 pid1: add DumpFileDescriptorStore() bus call that returns fdstore content info 2023-03-29 18:53:20 +02:00
Lennart Poettering
522f12224c format-table: add new cell type for displaying major/minor devnums 2023-03-29 18:27:05 +02:00
Lennart Poettering
bd33207bb1 format-table: add inode type cell type 2023-03-29 18:27:05 +02:00
Lennart Poettering
b2b84f4b23 fd-util: add helper for converting O_RDONLY/WRONLY/RDWR to strings 2023-03-29 18:27:05 +02:00
Lennart Poettering
d80e2a1ed3 devnum-util: add new devnum_is_zero() helper 2023-03-29 18:27:05 +02:00
Lennart Poettering
d83ce13636 stat-util: add inode_type_to_string() helper for showing mode_t inode type as string 2023-03-29 18:27:04 +02:00
Daan De Meyer
df00c5162f firstboot: Refactor should_configure() 2023-03-29 18:05:04 +02:00
Daan De Meyer
fe75d5bcfa firstboot: Check for errors returned by dir_fd_is_root() 2023-03-29 17:59:50 +02:00
Daan De Meyer
fe58566282 user-util: Rename ETC_PASSWD_LOCK_NAME to ETC_PASSWD_LOCK_FILENAME 2023-03-29 17:52:35 +02:00
Lennart Poettering
8d12e219c5 pid1: add debug log about selected restart interval 2023-03-29 17:22:07 +02:00
Lennart Poettering
a1d315730f pid1: introduce new SERVICE_{DEAD|FAILED}_BEFORE_AUTO_RESTART service substates
When a service deactivates and is then automatically restarted via
Restart= we currently quickly transition through
SERVICE_DEAD/SERVICE_FAILED. Which is weird given it's not the
normal ("permanent") dead/failed state, but a transitory one we
immediately leave from again. We do this so that software that looks for
failures/successes can take notice, even if we restart as a consequence
of the deactivation.

Let's clean this up a bit: let's introduce two new states:
SERVICE_DEAD_BEFORE_AUTO_RESTART and SERVICE_FAILED_BEFORE_AUTO_RESTART
that are used for the transitory states. Both the SERVICE_DEAD and
SERVICE_DEAD_BEFORE_AUTO_RESTART will map to the high-level
UNIT_INACTIVE state though. (and similar for the respective failed
states). This means the high-level state machine won't change by this,
only the low-level one.

This clearly seperates the substates, which makes the state engine
cleaner, and allows clients to follow precisely whether we are in a
transitory dead/failed state, or a permanent one, by looking at the
service substate. Moreover it allows us to remove the 'n_keep_fd_store'
which so far we used to ensure the fdstore was not released during this
transitory dead/failed state but only during the permanent one. Since we
can now distinguish these states properly we can just use that.

This has been bugging me for a while. Let's clean this up.

Note that the unit restart logic is already nicely covered in the
testsiute, hence this adds no new tests for that.

And yes, this could be considered a compat break, but sofar we took the
liberty to make changes to the low-level state machine (i.e. SERVICE_xyz
states, sometimes called "substates") without considering this a bad
breakage – the high-level state machine (i.e.  UNIT_xyz states) should
be considered API that cannot be changed.
2023-03-29 17:22:07 +02:00
Zbigniew Jędrzejewski-Szmek
8732cfb4bf
Merge pull request #26707 from DaanDeMeyer/firstboot-modernize
firstboot: modernize path handling
2023-03-29 17:08:44 +02:00
Daan De Meyer
6fdd30fb7c mkosi: Drop python-docutils
We don't seem to use anything from python-docutils at all, so let's
drop the dependency.
2023-03-29 14:33:06 +02:00
Daan De Meyer
77c3cd2086
Merge pull request #27049 from DaanDeMeyer/update-mkosi
mkosi: Update to latest
2023-03-29 13:48:37 +02:00
Daan De Meyer
94c9855a18 mkosi: Update to latest
- Drop Netdev= as it was removed in mkosi
- Always install python-psutil in the final image (required for networkd tests)
- Always Install python-pytest in the final image (required for ukify tests)
- Use the narrow glob for all centos python packages
- Drop the networkd mkosi config files (the default image can be used instead)
- Use ".conf" as the mkosi config file suffix everywhere
- Copy src/ to /root/src in the final image and set gdb substitute path in
  .gdbinit to make gdb work properly
2023-03-29 13:27:19 +02:00
Luca Boccassi
89c632dfda
Merge pull request #27020 from 1awesomeJ/nit
systemd-cryptenroll: adding integration test cases
2023-03-29 12:24:08 +01:00
Daan De Meyer
3ceb96e018 test: Install systemd-networkd-tests.py when install_tests is enabled 2023-03-29 12:18:42 +02:00
Daan De Meyer
0beb2a95a4 mkosi: Update to latest
- ACLs are not set on generated directories anymore by default, so
we enable them explictly now so that when running unprivileged mkosi,
the user running mkosi can remove all generated files and directories.
- We don't explicitly set QemuHeadless= anymore as the option was removed
and made the default.
- We set the loglevel= kernel cmdline argument explicitly now as mkosi
doesn't set it by default anymore.
2023-03-29 11:13:33 +01:00
Dmitry V. Levin
139203e1d4 udev_rules_parse_file: do not ignore ENOENT when invoked by udevadm verify
Make sure the ENOENT exception reintroduced by commit
9db7081d83 is not applied when the parser
is invoked by udevadm verify.
2023-03-29 18:50:29 +09:00
Daan De Meyer
b352e545ab firstboot: Modernize path handling
Let's open a file descriptor to the root directory and perform all
path operations using that file descriptor. On top of that, let's
make sure we pin the directory containing the file we want to work
on and use atomic copies and writes everywhere we can..
2023-03-29 09:25:38 +02:00
Daan De Meyer
8e3eb949a5 user-util: Add ETC_PASSWD_LOCK_NAME 2023-03-29 09:25:38 +02:00
Daan De Meyer
ee2975a9d9 log: Add LOG_SET_PREFIX() macro
LOG_SET_PREFIX() sets a logging prefix for the current block. The
prefix is prepended to every logging message in the block, followed
by ": ". If a logging prefix is already configured, it is overridden
for the duration of the block, after which it is restored.

A use case for this macro is when we're operating on an image or
directory (using --root or --image). We can use LOG_SET_PREFIX() to
prefix all logging messages with the directory or image that we're
operating on.
2023-03-29 13:00:33 +09:00
Lennart Poettering
09ba6d1a14 TEST-80: synchronize explicitly instead of by time
This removes "sleep" invocations, and makes the notify access testcase a
lot more robust to runtime jitter. We use a pair of fifos in the fs to
sync instead.

Also various other improvoements, including comments.

(Also removes the unnecessary "no-qemu" restriction)
2023-03-29 12:59:53 +09:00
Luca Boccassi
49e8342965 test: do not remove state directory on failure
The test log is in the state directory, and we want to keep it around
when a test fails.

Follow-up for: 256a835f1c
2023-03-29 12:59:02 +09:00
Yu Watanabe
8d9c779cc8
Merge pull request #27046 from bluca/shellcheck
Fix some shellcheck warnings
2023-03-29 12:58:31 +09:00
Yu Watanabe
0290243acf
Merge pull request #27040 from keszybz/empty-path-skip-cleanup
Restore silent skipping of missing rules files by udev
2023-03-29 10:18:06 +09:00
Luca Boccassi
d79881c530 test: fix shellcheck warnings in test-sysusers.sh 2023-03-29 02:08:18 +01:00
Luca Boccassi
a5979f0bd5 man: fix shellcheck warning for html.in
SC2015: Note that A && B || C is not if-then-else. C may run when A is true.
2023-03-29 02:08:18 +01:00
Luca Boccassi
a02c4d469f
Merge pull request #27042 from fbuihuu/fixes-for-testsuite-74-mount
Fixes for testsuite 74 mount
2023-03-29 01:54:30 +01:00
OMOJOLA JOSHUA DAMILOLA
e2a4411a2b added more test cases 2023-03-28 22:28:30 +00:00
Lennart Poettering
75f7e5e547 man: correct/tweak text about unit name syntax
Unit names can be 255 characters long, not 256.

We first say "name prefix" and then continue with "unit prefix".
Confusing. Couldn't figure out which term is better hence settled on
"unit name prefix".
2023-03-28 23:07:11 +01:00
Franck Bui
208d9ad168 test: fix regexp in testsuite-74.mount.sh
Several whitespaces can separate "ext4" and "sd-mount-test" strings.
2023-03-28 20:41:40 +02:00
Daan De Meyer
3a051522ce
Merge pull request #27035 from DaanDeMeyer/ukify-align
ukify: Add workarounds for older stubs
2023-03-28 19:45:04 +02:00
Frantisek Sumsal
e3201a69eb test: don't go through all time zones if slow tests are disabled
Let's skip going through all locally available time zones if we're built
with slow tests disabled, as that's quite slow, but do at least one test
with the UTC zone.
2023-03-28 18:16:38 +01:00
Luca Boccassi
f9b3f24463
Merge pull request #27030 from keszybz/bustctl-show-property-values-in-full
bustctl: show property values in full
2023-03-28 18:14:49 +01:00
Franck Bui
8607a39e08 test: drop extraneous bracket in testsuite-74.mount.sh 2023-03-28 19:00:44 +02:00
Zbigniew Jędrzejewski-Szmek
7d0c47dad0 shared/exec-util: null_or_empty_path() does not return boolean
We shouldn't report that the file is empty if the stating fails. Let's do the
same as in other places, and just ignore the error and let the subsequent
operation fail.
2023-03-28 18:50:31 +02:00
Luca Boccassi
a4d1d1f63d
Merge pull request #26941 from bluca/portable_version
portable: introduce SYSEXT_ fields to identify sysexts, and include more metadata in log messages via LogExtraFields=
2023-03-28 17:49:52 +01:00