Adrian Vovk
e50bfc89ce
manager: Freeze/Thaw: Don't fail units w/o cgroup
...
Previously, it was impossible to freeze or thaw a slice if it is an
ancestor to a unit that had no running cgroup (i.e. a service with
RemainAfterExit=yes). Instead of failing with EBUSY (which would
confusingly get reported as "Unit has pending job") we just silently
no-op.
I noticed this because we now have user-runtime-dir@.service, which
would make it impossible to freeze/thaw user.slice or user-<UID>.slice
2024-03-30 02:58:53 +08:00
Luca Boccassi
a7f2019055
Merge pull request #32010 from bluca/reexec_rate_limit
...
core: serialize reload rate limit and apply ReloadLimit to reexec too
2024-03-29 17:16:36 +00:00
Daan De Meyer
e5cd051724
mkosi: Switch to linux-virtual on Ubuntu
...
This now finally has support for credentials and erofs so let's switch
to this much smaller kernel package that doesn't pull in linux-firmware.
2024-03-29 15:58:13 +01:00
Yu Watanabe
03b6879f4d
udevadm-test: prettify test results
2024-03-29 12:44:11 +00:00
Luca Boccassi
8312b17a29
core: apply ReloadLimit to reexec too
...
Same reason as the reload, reexec is disruptive and it requires the
same privileges, so if somebody wants to limit reloads, they'll also
want to limit reexecs, so use the same setting.
2024-03-29 12:03:32 +00:00
Luca Boccassi
9b1db2dbc4
core: serialize reload rate limit
...
Otherwise the rate limit is lost on reexec, and the privileges to call it
are the same as reloads
2024-03-29 12:03:32 +00:00
Daan De Meyer
f2c946f872
Merge pull request #32013 from yuwata/align-table
...
core: align table
2024-03-29 08:30:59 +01:00
Yu Watanabe
0966933b3d
unit-def: append trailing comma for the last entry
2024-03-29 13:53:01 +09:00
Yu Watanabe
17f6b64038
core: align table
2024-03-29 13:51:15 +09:00
Yu Watanabe
fee6510667
Merge pull request #31998 from yuwata/udev-event-mode
...
udev: make udevadm test and test-builtin not destructive
2024-03-29 11:31:58 +09:00
Luca Boccassi
55c1a411c6
portable: the 'flags' parameter is now used in DetachImageWithExtensions() and ReattachImageWithExtensions()
2024-03-29 09:35:45 +09:00
Yu Watanabe
089bef6631
udev: make udevadm test and test-builtin not destructive
...
Previously, 'udevadm test' performs not only processing udev rules,
but made several destructive change on the system; updating udev
database, device node permission, devlinks, network interface
properties, and so on.
Similary, 'udevadm test-builtin' may perform something destructive,
especially by 'keyboard', 'kmod', and 'net_setup_link' builtins.
Let's make these commands and test executables not change device
configurations.
2024-03-29 09:33:07 +09:00
Yu Watanabe
adfc608578
Merge pull request #31986 from YHNdnzj/suspend-mem-mode
...
sleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep
2024-03-29 09:30:54 +09:00
Ronan Pigott
64761f38cc
network: save the real rdnss address
...
... instead of the router that informed us
Fixes: 86a66e9b95 ("network: also save NTP servers and friends obtained by other protocols")
2024-03-29 09:30:42 +09:00
Frantisek Sumsal
607be850b9
test: make coverage runs happy with capsule@.service
...
capsule@.service uses DynamicUser=yes, so let's use the same tweak we
use for other such units.
2024-03-28 23:29:46 +00:00
Daan De Meyer
838235be87
login: Fix fallback error handling
2024-03-28 21:24:54 +01:00
Yu Watanabe
e4c7dc9418
test: disable IPv6AcceptRA= for test network interfaces with static address
...
This hopefully improves test performance.
2024-03-28 12:37:45 +00:00
Luca Boccassi
166cb4c3ee
Merge pull request #31994 from yuwata/network-dhcp-server-follow-ups
...
network: several fixlets for PersistLeases=
2024-03-28 12:35:13 +00:00
Yu Watanabe
ff944339f3
ndisc-option: allow to set valid time of options
...
When an option is delegated from an upstream server, its lifetime
may be limited by a time. Such functionality will be used later by
sd-radv.
This also remove 'offset' argument from the option setter
ndisc_option_set_xyz(), and make it update existing option.
See comments in ndisc_option_add_link_layer_address() for more details.
2024-03-28 12:34:09 +00:00
Yu Watanabe
af41f9f8ad
journalctl-filter: use add_match_boot_id() instead of add_match_this_boot()
...
The function add_match_this_boot() calls sd_journal_add_conjunction(),
hence, we cannot specify multiple devices in the extra match arguments,
e.g., "journalctl /dev/sda /dev/sdb" shows no entry.
2024-03-28 12:28:17 +00:00
Mike Yuan
a2124b35e9
sleep: add SleepMemMode= setting for configuring /sys/power/mem_sleep
...
The setting is used when /sys/power/state is set to 'mem'
(common for suspend) or /sys/power/disk is set to 'suspend'
(hybrid-sleep). We default to kernel choice here, i.e.
respect what's set through 'mem_sleep_default=' kernel
cmdline option.
2024-03-28 17:19:35 +08:00
Mike Yuan
b786128322
sleep: make write_mode take a path
...
Similar to the previous commit, preparation
for adding support for /sys/power/mem_sleep.
2024-03-28 17:16:25 +08:00
Mike Yuan
b0e3b85a7c
sleep-config: make sleep_mode_supported take a path
...
Preparation for later commits.
2024-03-28 17:16:25 +08:00
Mike Yuan
f8c700791e
string-util: modernize string_contains_word_strv a bit
...
Also correct the comment on flags.
2024-03-28 17:16:25 +08:00
Mike Yuan
a6fe020ab8
sleep-config: fix potential memory leak
...
Follow-up for 77bd39385e
2024-03-28 17:16:24 +08:00
Mike Yuan
0a3fd5ce43
man/systemd-sleep: reorder options
2024-03-28 17:16:24 +08:00
Mike Yuan
792dd6f46c
sleep-config: make sleep_operation_is_hibernation uppercase
2024-03-28 17:16:21 +08:00
Yu Watanabe
a7541703b9
udev-event: split out update_clone()
...
No functional change, preparation for later commits.
2024-03-28 14:49:34 +09:00
Adrian Vovk
1eba24dac4
homed: Release(): fix assertion failure
...
This fixes a race condition crash in homed that would happen in the
following sequence of events:
1. Client 1 takes a ref on the home area
2. Client 1 calls some method via dbus
3. Client 2 calls Release()
In homed, the Release() would check if a ref is still held (in this
case: yes it is) and returns an error. Except that is done through a
code-path that asserts that no operations are ongoing. In this case,
it's valid to have an ongoing operation, and so the assertion fails
causing homed to crash.
2024-03-28 13:35:37 +09:00
Luca Boccassi
ed35851693
run: fix generated unit name clash after soft-reboot
...
When sd-run connects to D-Bus rather than the private socket, it will
generate the transient unit name using the bus ID assigned by the D-Bus
broker/daemon. The issue is that this ID is only unique per D-Bus run,
if the broker/daemon restarts it starts again from 1, and it's a simple
incremental counter for each client.
So if a transient unit run-u6.service starts and fails, and it is not
collected (default on failure), and the system soft-reboots, any new
transient unit might conflict as the counter will restart:
Failed to start transient service unit: Unit run-u6.service was already loaded or has a fragment file.
Get the soft-reboot counter, and if it's greater than zero, append it
to the autogenerated unit name to avoid clashes.
2024-03-28 11:19:46 +09:00
Yu Watanabe
2a4fb037cb
Merge pull request #31989 from mrc0mmand/test-loop-dev-check
...
test: check for /dev/loop-control when checking lodev availability
2024-03-28 11:19:32 +09:00
Yu Watanabe
74158eec0e
Merge pull request #31963 from yuwata/journalctl-authenticate-cleanups
...
journalctl-authenticate: several cleanups
2024-03-28 11:19:21 +09:00
Yu Watanabe
bc91875ae5
test-network: add test cases for PersistLeases=no
2024-03-28 11:16:17 +09:00
Yu Watanabe
38b4ecf789
network: make [DHCPServer] in networkd.conf work
...
Follow-up for a3ed665a29 .
Fixes https://github.com/systemd/systemd/pull/31977#discussion_r1542196572 .
2024-03-28 11:15:53 +09:00
Yu Watanabe
1fadd9a357
network: fix typo
...
Follow-up for a3ed665a29 .
2024-03-28 10:38:04 +09:00
Yu Watanabe
5e4aad5e96
Merge pull request #31985 from DaanDeMeyer/mkosi
...
mkosi: Copy built packages to output directory
2024-03-28 10:21:34 +09:00
Yu Watanabe
a128119a1d
timedate: fix typo
...
Follow-up for 3a51e31be9 .
2024-03-28 09:55:11 +09:00
Yu Watanabe
66a0fdcaa5
journalctl-authenticate: return earlier if we are not on a TTY
...
No functional change, just refactoring.
2024-03-28 09:40:34 +09:00
Yu Watanabe
ef277c961f
journalctl-authenticate: use open_tmpfile_linkable() and link_tmpfile()
...
This also
- use path_join(),
- rename variables to more descriptive names.
2024-03-28 09:38:10 +09:00
Yu Watanabe
2dac05e62b
journalctl-authenticate: drop unnecessary safe_close()
...
Follow-up for 7560fffcd2 .
Addresses https://github.com/systemd/systemd/pull/31879#discussion_r1539063239 .
2024-03-28 09:36:29 +09:00
Yu Watanabe
4c56862170
journalctl-authenticate: use is_dir() and refuse symlink for /var/log/journal
...
I am not sure it is explicitly documented that /var/log/journal should
be a directory, rather than a symlink to a directory, but the current
code of journald seems not to support symlinked directory well. Let's
refuse that at least here and now.
2024-03-28 09:36:29 +09:00
Luca Boccassi
e6bd341e7d
analyze: fix plot with soft-reboot
...
Clamp times and start counting from when soft-reboot is started
to avoid creating a huge graph, like it's done for the user
instance.
2024-03-27 22:25:45 +00:00
Frantisek Sumsal
c75ee69e59
test: cleanup the test script a bit
2024-03-27 20:15:02 +01:00
Frantisek Sumsal
0348b500ef
test: check for /dev/loop-control when checking lodev availability
...
losetup in util-linux 2.40 started reporting lost loop devices [0] and
it has an unfortunate side-effect where it reports lost devices even in
containers, which then makes the loop device check "falsely" pass [1].
Let's just check for /dev/loop-control explicitly to "work around" this.
[0] https://github.com/util-linux/util-linux/commit/a6ca0456cc6d704a786f6b66d8bb2d89ff18eba7
[1] https://github.com/util-linux/util-linux/issues/2824
2024-03-27 19:35:30 +01:00
Michal Koutný
3a51e31be9
timedated: Respond on org.freedesktop.timedate1.SetNTP only when really finished
...
The method returns prematurely (before jobs it triggers terminate). This
is externally visible because other methods may fail if jobs did not
finish.
Postpone the DBus method response until we collect all signals for
finished jobs.
systemd-timedated keeps track of in-flight DBus requests and answers
them all in unspecified order when jobs finish. The capacity of requests
in systemd-timedated is limited.
Fixes : #17739
2024-03-27 17:28:24 +00:00
Daan De Meyer
5524d2838c
mkosi: Copy built packages to output directory
...
This allows the built packages to be inspected if needed, or installed
on the host system for anyone who's daring enough to do so.
2024-03-27 16:14:17 +01:00
Daan De Meyer
e11fe427f8
mkosi: Update to latest
2024-03-27 16:14:15 +01:00
Yu Watanabe
a3ed665a29
network/dhcp-server: introduce PersistLeases= setting
...
Requested at https://github.com/systemd/systemd/pull/31772#issuecomment-2000053357 .
2024-03-27 13:21:15 +00:00
Antonio Alvarez Feijoo
f824cd660a
journalctl-show/util: add missing header
...
```
[1237/2836] Compiling C object journalctl.p/src_journal_journalctl-show.c.o
FAILED: journalctl.p/src_journal_journalctl-show.c.o
cc -Ijournalctl.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fno-strict-aliasing -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -MD -MQ journalctl.p/src_journal_journalctl-show.c.o -MF journalctl.p/src_journal_journalctl-show.c.o.d -o journalctl.p/src_journal_journalctl-show.c.o -c ../src/journal/journalctl-show.c
../src/journal/journalctl-show.c: In function ‘setup_event’:
../src/journal/journalctl-show.c:330:38: error: ‘STDOUT_FILENO’ undeclared (first use in this function)
330 | r = sd_event_add_io(e, NULL, STDOUT_FILENO, EPOLLHUP|EPOLLERR, NULL, INT_TO_PTR(-ECANCELED));
| ^~~~~~~~~~~~~
../src/journal/journalctl-show.c:330:38: note: each undeclared identifier is reported only once for each function it appears in
[1238/2836] Compiling C object journalctl.p/src_journal_journalctl-util.c.o
FAILED: journalctl.p/src_journal_journalctl-util.c.o
cc -Ijournalctl.p -I. -I.. -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-resolve -Isrc/shared -I../src/shared -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fno-strict-aliasing -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -MD -MQ journalctl.p/src_journal_journalctl-util.c.o -MF journalctl.p/src_journal_journalctl-util.c.o.d -o journalctl.p/src_journal_journalctl-util.c.o -c ../src/journal/journalctl-util.c
../src/journal/journalctl-util.c: In function ‘acquire_journal’:
../src/journal/journalctl-util.c:36:60: error: ‘STDIN_FILENO’ undeclared (first use in this function)
36 | r = sd_journal_open_files_fd(&j, (int[]) { STDIN_FILENO }, 1, arg_journal_additional_open_flags);
| ^~~~~~~~~~~~
../src/journal/journalctl-util.c:36:60: note: each undeclared identifier is reported only once for each function it appears in
```
Fixes ade2db83fe
2024-03-27 13:14:46 +00:00
Yu Watanabe
95d3570b47
sd-ndisc-router: introduce sd_ndisc_router_set_sender_address()
...
Currently this is not used, but will be used later to modify the sender
address.
2024-03-27 13:13:12 +00:00