1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00
Commit Graph

62245 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
de5d8b40ed sleep: fix memleak
Those hashmaps are created anew in each iteration of the loop. The
leak wasn't really a problem, because the loop is bounded and the
hashmaps were not huge, but it's nicer to be correct.
2023-01-23 22:06:05 +01:00
Zbigniew Jędrzejewski-Szmek
099810a65b sleep: reduce double logging and improve messages and comments a bit
read_battery_capacity_percentage() was already logging, but with a slightly
different wording.

More could be done, I just touched the most noticable places. Especially
in debug messages, it is much more useful to be direct about what couldn't
be accessed or parsed, instead of providing "descriptive names" which are
not useful to the user at all, who then needs to read the code to figure out
what was the actual property name.
2023-01-23 22:06:05 +01:00
Zbigniew Jędrzejewski-Szmek
31f62bdd79 test-sleep: add a very simple test that prints battery suspend estimates 2023-01-23 22:06:05 +01:00
Zbigniew Jędrzejewski-Szmek
7ebbe4a5ce sleep: do not abort if we try to query capacity of missing battery
Fixes #25584.

From the issue:
Assertion 'capacity >= 0' failed at src/shared/sleep-config.c:58, function PTR_TO_CAPACITY(). Aborting.

(gdb) bt

The problem is that PTR_TO_CAPACITY(hashmap_get(last_capacity, battery_name))
will abort if it's called with a name not present in the hashmap. We want to
skip the device silently in this case instead.
2023-01-23 22:05:36 +01:00
Zbigniew Jędrzejewski-Szmek
d4fc020996
Merge pull request #26153 from DaanDeMeyer/repart-remove-userns
mkfs-util: Remove user namespace owner => root mapping
2023-01-23 21:46:55 +01:00
Luca Boccassi
020b2e41ea core: ensure init.scope is realized after drop-ins have been loaded
If we add a drop-in for init.scope (e.g.: to set some memory limit),
it will be loaded long after the cgroup has already been realized.
Do it again when creating the special unit.
2023-01-23 21:40:54 +01:00
Lennart Poettering
4453ebe4db build: add some coloring to --version output
Make it easier to discern enabled and disabled build options.
2023-01-23 21:38:51 +01:00
Luca Boccassi
53fd537472
Merge pull request #26157 from medhefgo/meson
meson: Small improvements
2023-01-23 19:41:51 +00:00
Luca Boccassi
deeebc95af
Merge pull request #25805 from yuwata/locale-xkb-save-vconsole
locale: also save X11 keyboard settings to /etc/vconsole.conf
2023-01-23 19:40:12 +00:00
Frantisek Sumsal
d932022ddf test: bump the container spawn timeout to 60s
As 30s might be not enough on busy systems (and we already bumped the
reboot timeout from 30s to 60s for this reason).
2023-01-23 19:13:49 +01:00
Frantisek Sumsal
e0cbb73911 test: bump the client-side timeout in sd-bus as well
Since c78d18215b D-Bus services now have 60s to start, but the client
side (sd-bus) still waits only for 25s before giving up:

```
[  226.196380] testsuite-71.sh[556]: + assert_in 'Static hostname: H' ''
[  226.332965] testsuite-71.sh[576]: + set +ex
[  226.332965] testsuite-71.sh[576]: FAIL: 'Static hostname: H' not found in:
[  228.910782] sh[577]: + systemctl poweroff --no-block
[  232.255584] hostnamectl[565]: Failed to query system properties: Connection timed out
[  236.827514] systemd[1]: end.service: Consumed 2.131s CPU time.
[  237.476969] dbus-daemon[566]: [system] Successfully activated service 'org.freedesktop.hostname1'
[  237.516308] systemd[1]: system-modprobe.slice: Consumed 1.533s CPU time.
[  237.794635] systemd[1]: testsuite-71.service: Main process exited, code=exited, status=1/FAILURE
[  237.818469] systemd[1]: testsuite-71.service: Failed with result 'exit-code'.
[  237.931415] systemd[1]: Failed to start testsuite-71.service.
[  238.000833] systemd[1]: testsuite-71.service: Consumed 5.651s CPU time.
[  238.181030] systemd[1]: Reached target testsuite.target.
```

Let's override the timeout in sd-bus as well to mitigate this.

Follow-up to c78d18215b.
2023-01-23 18:44:55 +01:00
Mike Yuan
e6afd73ba2
machinectl: remove unnecessary initialization 2023-01-24 00:32:33 +08:00
Mike Yuan
d2493703c1
machinectl: also enable machines.target when enabling machines
It's mostly desired to enable machines.target
along with the machine since only when both are
enabled it would really work.
2023-01-24 00:13:23 +08:00
Daan De Meyer
cd53cc149e repart: Add note about UIDs/GIDs of copied files and directories 2023-01-23 16:43:58 +01:00
Daan De Meyer
ff1b55ffdf Revert "repart: Ensure files end up owned by root in generated filesystems"
This reverts commit e59678b2cf.

We also modify the repart integration tests to make them pass with the
changes in this commit. In short, we have to make sure every file is
owned by the user executing repart. We use tee instead of cat since it
makes that easier. This also has the benefit of improving debugability
as seeing the config file contents on stdout makes it easier to know
which test is failing.
2023-01-23 16:33:03 +01:00
Lennart Poettering
782418a166
Merge pull request #25168 from valentindavid/valentindavid/umount-move-recursive-list
shutdown: move busy mounts to not block parent mounts
2023-01-23 15:24:13 +01:00
Jan Janssen
a6cabc90c8 meson: Use python module for detection 2023-01-23 14:54:28 +01:00
Daan De Meyer
49fb6e97d2 Revert "repart: Make sure all files in the image are owned by root"
This reverts commit d2ac7698cb.
2023-01-23 14:41:33 +01:00
Jan Janssen
cd4300f30f meson: Move bootctl sources defintion to its own file
The root meson.build file is already large enough.
2023-01-23 14:41:26 +01:00
Zbigniew Jędrzejewski-Szmek
e830d6dd2d
Merge pull request #25145 from yuwata/udevadm-trigger
udev: make 'udevadm trigger --settle' work even if device is renamed
2023-01-23 13:49:20 +01:00
Michael Biebl
a4bc35740a test: fix TEST-73-LOCALE on Debian
Fix incorrection assumption about the Debian patch being buggy and
actually making TEST-73-LOCALE fail on Debian.

```
 # localectl set-locale LANG=C.UTF-8
 # cat /etc/default/locale
 LANG=C.UTF-8
```
2023-01-23 11:41:14 +00:00
Yu Watanabe
8589823f9d locale: also save XKB settings to vconsole.conf
Closes #24228.
Replaces #25412.
2023-01-23 11:30:03 +00:00
Yu Watanabe
50ec824570 locale: make errors in writing files not critical
Suggested at https://github.com/systemd/systemd/pull/25805#discussion_r1054871210

> we now write multiple files and we cannot possibly guarantee that
> either both updates worked or neither. unix fs apis simply have
> no concept that would allow us to implement that. hence I think
> we should update what we can, log about what we cannot, but return
> success as long as our in-memory state was updated.
2023-01-23 11:30:03 +00:00
Yu Watanabe
4f34fd5d40 locale: merge vconsole_convert_to_x11_and_emit() with method_set_vc_keyboard()
Similary, this also merges x11_convert_to_vconsole_and_emit() with
method_set_x11_keyboard().

No functional changes, preparation for later commits.
2023-01-23 11:30:03 +00:00
Yu Watanabe
b41ec10ae4 locale: split out XKB settings to X11Context
No functional changes, just refactoring and preparation for later
commits.
2023-01-23 11:30:03 +00:00
Yu Watanabe
c2ddaed483 locale: rename context_free_vconsole() -> context_clear_vconsole()
Similary, this also renames context_free_x11() -> context_clear_x11(),
to make it clear that these functions do not free Context.

Also, this makes context_clear() support to be called more than once.
2023-01-23 11:29:11 +00:00
Yu Watanabe
6f4514e84a locale: do not use alloca() for strings which can be potentially arbitrary 2023-01-23 11:29:11 +00:00
Yu Watanabe
76400a623f locale: several coding style fixlets
- add missing assertions,
- rename arguments for storing results,
- always initialize results on success,
- use _cleanup_ attribute at more places, etc.
2023-01-23 11:29:11 +00:00
Luca Boccassi
901339702c
Merge pull request #26147 from keszybz/silence-gcc-13-warning
Silence gcc-13 warning
2023-01-23 00:44:41 +00:00
Luca Boccassi
e24652ac2e
Merge pull request #26146 from keszybz/two-man-page-tweaks
Two man page tweaks
2023-01-22 20:14:33 +00:00
Steve Ramage
fdbbb5ffc0 Resolves #26142 - Fix list of supported personalities 2023-01-22 18:57:12 +01:00
DaPigGuy
60eac27a0d hwdb: Prevent activation of airplane mode on HP ENVY x360 2023-01-22 18:46:27 +01:00
Zbigniew Jędrzejewski-Szmek
8f5d716a71 shared/install: rework an assert to appease gcc-13
With the previous form, gcc is confused and thinks that .type might be unset.

Fixes #26118.
2023-01-22 18:25:56 +01:00
Zbigniew Jędrzejewski-Szmek
4a4af850b3 shared/install: rework InstallChange to always have .path set
We would set .path in all cases except INSTALL_CHANGE_AUXILIARY_FAILED, where
we would just just .source. This special case is just not worth it, because
we can't easily assert that .path is set. Let's remove this special case to
help the compiler know that .path is actually set.

Avoids a warning with gcc-13.0.1-0.1.fc38.x86_64.
2023-01-22 18:25:56 +01:00
Zbigniew Jędrzejewski-Szmek
066991f9fe man/sd_notify: fix indentation in sample programs
Whether we use a newline at the beginning of <programlisting> or not doesn't
seem to have any effect. So let's use the newline in multi-line examples; it is
easier to get the indentation right this way.
2023-01-22 17:55:34 +01:00
Zbigniew Jędrzejewski-Szmek
a9ba6f8a88 man: minor corrections
Two issues that were missed in 8b9f092112.
2023-01-22 17:55:34 +01:00
David Tardon
7100653885 sd-path: export env. generators paths 2023-01-21 11:27:40 +00:00
Lennart Poettering
2155bd9441
Merge pull request #26139 from yuwata/test-load-fragment-fix-memleak
test-load-fragment: fix memleak
2023-01-21 10:50:07 +01:00
Yu Watanabe
1dcfbc514c systemctl,test: -EBADF instead of -EBADFD
Follow-up for da20baaecc.
2023-01-21 10:47:54 +01:00
Lennart Poettering
23fcf34a51
Merge pull request #26137 from poettering/timesyncd-touch-file-tweaks
timesync: some tweaks to saved timestamp file handling
2023-01-21 10:46:54 +01:00
Lennart Poettering
8b70155815 logs-show: add a splash of colour to verbose output 2023-01-21 10:46:35 +01:00
Lennart Poettering
b1cc0822c3 logs-show: minor modernizations 2023-01-21 10:46:20 +01:00
Lennart Poettering
404803e6ca sd-journal: validate monotonic timestamp before returning it 2023-01-21 10:46:02 +01:00
Lennart Poettering
7153213e40 string-util: add common implementation of function that converts sized character buffers to NUL terminated C strings 2023-01-21 10:45:25 +01:00
Yu Watanabe
93d0cf7a37 test-load-fragment: shorten code a bit 2023-01-21 15:11:43 +09:00
Yu Watanabe
c9b733265f test-load-fragment: fix memleak
Fixes a leak reported at https://github.com/systemd/systemd/pull/26115#issuecomment-1398026085.
2023-01-21 15:11:29 +09:00
13r0ck
9e2e3342ca hwdb: Add touchpad toggle mapping for System76 Pangolin 12 2023-01-21 00:40:09 +00:00
Lennart Poettering
8cc3cdac23 logs-show: move strlen() handling into update_json_data() so that we can use SD_ID128_TO_STRING() 2023-01-21 00:39:09 +00:00
Lennart Poettering
1acb4f6157 timesyncd: make sure to update mtime of clock file on each boot
Let's make sure the timestamp file's mtime is guaranteed to change for
each boot, so that it is a useful indicator of time. Or in other words
this gurantees that systemd-timesyncd.service acts as a new kind of
milestone: that time definitely progressed on this boot even the machine
died abnormally imediately after.
2023-01-20 22:33:05 +01:00
Lennart Poettering
84447fe79d timesyncd: modernize load_clock_timestamp() a bit
Let's log more.
2023-01-20 22:33:05 +01:00