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

49207 Commits

Author SHA1 Message Date
Yu Watanabe
1f8dc96c06 udev: rename TxQueueLength= -> TransmitQueueLength=
As we usually (unfortunately not always though) do not use abbreviations.

Tx may be standard abbreviation, but we already have e.g.
TransmitChecksumOffload=. So, let's use Transmit instead of Tx.

Follow-up for ef4a91a7e8.
2021-02-03 14:43:49 +09:00
Yu Watanabe
d96d8a81ef test: add tests for RouteTable= setting 2021-02-03 14:39:25 +09:00
Yu Watanabe
552b90a2f2 network: use defined route table name in debug logs
And rename route_table_from_string_full() to
manager_get_route_table_from_string().
2021-02-03 14:36:50 +09:00
Yu Watanabe
310eff7274 network: make RouteTable= setting can take multiple name:number pairs in a line
Follow-up for c038ce4606.
2021-02-03 14:32:26 +09:00
Anita Zhang
0a9f93443b oom: rework *MemoryPressureLimit= properties to have 1/10000 precision
Requested in
https://github.com/systemd/systemd/pull/15206#discussion_r505506657,
preserve the full granularity for memory pressure limits (permyriad)
instead of capping out at percent.
2021-02-02 17:52:48 -08:00
Frantisek Sumsal
e3f87b07bc ci: build with -Werror on Fedora
Prompted by: https://github.com/systemd/systemd/pull/18400#issuecomment-771602705
2021-02-02 23:17:15 +00:00
Lennart Poettering
3cdcbdd32f path-util: tighten path_extract_filename()
Let's tighten the logic behind path_extract_filename() a bit: first of
all, refuse all cases of invalid paths with -EINVAL. More importantly
though return a recognizable error when a valid path is specified that
does not contain any filename. Specifically, "/" will now result in
-EADDRNOTAVAIL.

This changes API, but none of the existing callers care about the return
value, hence the change should be fine.
2021-02-02 23:16:38 +00:00
Luca Boccassi
23cfef7bb1
Merge pull request #18435 from keszybz/oomd-readiness-and-other-tweaks
Mark oomd as supported and other tweaks
2021-02-02 23:15:19 +00:00
Daan De Meyer
cb347d263d boot: Add startswith() and endswith() functions with no_case variants
Adapted from string-util
2021-02-02 22:53:31 +00:00
Daan De Meyer
fffd5e8ee3 boot: Drop unnecessary braces 2021-02-02 21:15:24 +00:00
Daan De Meyer
d47b7c5720 boot: Fix void pointer arithmetic warning 2021-02-02 21:15:24 +00:00
Daan De Meyer
c8af7dab21 boot: Replace raw efivar gets with typed variants 2021-02-02 21:15:21 +00:00
Daan De Meyer
987d0a1250 boot: Add efivar_get/set_uint64_le() functions
These are implemented as bit-shifting functions that allow reading
and writing UEFI variables stored as little endian 64-bit unsigned
values.
2021-02-02 21:03:58 +00:00
Daan De Meyer
a7308a266b boot: Rename efivar_get/set_int() to efivar_get/set_uint_string()
Let's clearly indicate that these are used to set/get uints that
are stored as strings.
2021-02-02 21:03:47 +00:00
Daan De Meyer
258f0970f9 boot: Tighten scope of variables used in loops 2021-02-02 21:03:35 +00:00
Daan De Meyer
2a7c16753b boot: Add efivar_get_boolean_u8() 2021-02-02 21:03:33 +00:00
Lennart Poettering
edf370af9e
Merge pull request #18432 from yuwata/libude-list-cleanups
libudev: cleanups for libudev-list
2021-02-02 15:05:46 +01:00
Zbigniew Jędrzejewski-Szmek
0411a11811 meson: use ellipses for ranges
C.f. 1d3a473b4a.
2021-02-02 14:39:48 +01:00
Zbigniew Jędrzejewski-Szmek
ea8b9b2f8a meson: take oomd out of the doghouse
It's on by default in Fedora 34 [1], so we can't say it's just a preview.

[1] https://fedoraproject.org/wiki/Changes/EnableSystemdOomd
2021-02-02 14:38:19 +01:00
Zbigniew Jędrzejewski-Szmek
7e215af765 man: move content from the wiki to systemd.preset(5)
The wiki was slightly stale, and almost all the information there
was already present in the man page. I moved the remaing part (discussion)
into the man page and adjusted all links to point to the man page instead.

daemon(7) has a some examples of packaging scriptlets… I don't think it fits
there very well. Most likely they should be moved to systemd.preset(5) or maybe
even removed, but I'm leaving that for later.
2021-02-02 14:20:23 +01:00
Zbigniew Jędrzejewski-Szmek
5ffa2eaa54 meson: remove one more instance of install_dir:bindir
bindir is the default, c.f. a1fd722b5d.
2021-02-02 14:19:59 +01:00
Deepak Rawat
8885fed4e3 logind: Introduce RebootWithFlags and others
Add new systemd-logind WithFlags version for Reboot and others. These
methods add a unit64 parameter, with which can send additional control flags.
2021-02-02 11:55:16 +00:00
Anita Zhang
94a8e2d6db parse-util: add permyriad parsing 2021-02-02 01:47:08 -08:00
Yu Watanabe
ecf83c2429 libudev: add one more assertion 2021-02-02 03:23:31 +09:00
Yu Watanabe
65c637ad2c libudev: unset uptodate flag before free()ing entries
udev_list_entry_free() also removes the entry from LIST if the flag is
set. This slightly optimizes the cleanup logic.
2021-02-02 02:34:23 +09:00
Yu Watanabe
8e5ce38727 libudev: also drop the entry from LIST even if unique flag is set
Otherwise, the list becomes dirty when an entry is freed.

This also remove the entry from the hashmap only when its name is set.
The name should be always set, so that does not change anything. But
just for safety.
2021-02-02 02:28:33 +09:00
Yu Watanabe
140716a516 libudev: set entry->list after the entry is stored in the list
This should not change anything. As hashmap_remove() is called before
hashmap_ensure_put(). So, even if hashmap_ensure_put() fails, a wrong
entry will not removed from the hashmap by udev_list_entry_free().
But anyway, just for safety.
2021-02-02 02:22:59 +09:00
Yu Watanabe
eaef130d3f libudev: use hashmap_ensure_put() 2021-02-02 02:22:35 +09:00
Yu Watanabe
8b9708d1d3 sd-event: retrieve more events when epoll_wait() returns number equivalent to the buffer size
When epoll_wait() returns number equivalent to the buffer size, there
may exist remaining events which may have higher priority. To make priority
sorting correctly, let's retrieve all events.
2021-02-02 01:14:39 +09:00
Yu Watanabe
ac714078bf test: add test for udev_event_spawn() 2021-02-02 01:14:33 +09:00
Yu Watanabe
2be0218a70 udev: ignore OOM error in on_spawn_io() 2021-02-02 01:10:59 +09:00
Yu Watanabe
28a5065149 udev: use strv_split_newlines() to parse result of spawned command 2021-02-01 23:37:27 +09:00
Yu Watanabe
90d260d81f udev: add debugging logs in spawn_wait() 2021-02-01 23:37:27 +09:00
Evgeny Vereshchagin
77591e9732 oss-fuzz: show meson logs
It should help to make it more clear what causes issues like
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30140
and https://github.com/google/oss-fuzz/pull/5084
2021-02-01 22:51:43 +09:00
Anita Zhang
934d0d023e tools: make update-dbus-docs compatible with Python 3.6
668b3a42fe allowed update-dbus-docs.py to start
running on Cent OS 8 (instead of skipping). But subprocess.check_output()'s
text argument didn't exist until Python 3.7 and C8 is still running
Python 3.6. Use universal_newlines instead for backwards compatibility.
2021-02-01 11:21:10 +00:00
Daan De Meyer
5e1f0e6fca boot: Make all efivar util functions take the guid as an argument
Let's make these functions a little more generic so we can have
them work on more than one GUID. More specifically, this allows
using them with the global guid which will be used a bit more to
extend the secure boot support.
2021-01-31 21:46:05 +00:00
Daan De Meyer
7d2ebb6f85 boot: Turn all guid constants into C99 compound initializers
Avoids having to use the address operator all the time and
avoids having to cast or do other unintuitive stuff.
2021-01-31 21:46:05 +00:00
Daan De Meyer
5021222842 boot: Enable C99
Instead of using -nostdinc, we use -nostdlib. This is necessary
to allow moving to C99 as efibind.h includes stdint.h when C99
is enabled. It isn't necessarily problematic to use some standard
library headers as long as they don't contain functions defined in
libc or another system library (or in other words, header only
headers are fine to use in sd-boot).
2021-01-31 21:46:05 +00:00
Daan De Meyer
ce0f078f4d boot: Move Secure Boot logic to new file 2021-01-31 21:46:05 +00:00
Simonas Kazlauskas
a3c5d7e95b hwdb: Add evdev for Huawei EUL-XW9
The device is very similar to MACH-WX9 in many ways, including this
particular one. Adding these rules gets rid of evdev warnings as buttons
are being pressed on this device.
2021-01-31 17:22:52 +00:00
Yu Watanabe
85cf96e3f5 log: skip reading the kernel command line if the process is invoked by a script
CLI tools may be used in a script. E.g., a script for monitoring a
service may use `systemctl`. Previously, if the kernel command line has
e.g. systemd.log-level=debug, then systemctl in the script produces
debugging logs when the script is invoked by a .service unit, but does
not when the script is running in a terminal. Then,
https://github.com/systemd/systemd/pull/18281#discussion_r561697482,
> I expect users to be (negatively) surprised.

In the previous commit, $SYSTEMD_EXEC_PID= is introduced. Then, we can
now detect whether a command is directly invoked by systemd or through
a script. Let's skip reading the kernel command line when a command is
invoked through a script.
2021-02-01 01:19:57 +09:00
Yu Watanabe
d754890843 import,home: update $SYSTEMD_EXEC_PID= if it is set
The subsequent execv() or execl() always calls tools provided by
systemd. So, it is safe to update the variable.
2021-02-01 01:19:52 +09:00
Yu Watanabe
43f565c677 core: also set $SYSTEMD_EXEC_PID= for generators 2021-02-01 01:13:44 +09:00
Yu Watanabe
cfd1c6e262 env-util: introduce env_update_systemd_exec_pid()
Will be used in later commits.
2021-02-01 01:13:44 +09:00
Yu Watanabe
2824374f95 test: use test_setup_logging() in test-env-util 2021-02-01 01:13:44 +09:00
Yu Watanabe
dc4e2940e8 core: set $SYSTEMD_EXEC_PID= environment variable for executed commands
It may be useful to detect a command is directly executed by systemd
manager, or indirectly as a child of another process.
2021-02-01 01:13:44 +09:00
Yu Watanabe
d2acb93dc5 tree-wide: enable colorized logging for daemons when run in console
It may be useful when debugging daemons.
2021-02-01 01:13:44 +09:00
Yu Watanabe
74189020eb log: make tools also read the kernel command line when run as a service
This effectively reverts 41d1f469cf.

Before this, e.g., `networkctl reload` invoked by `systemctl reload systemd-networkd.service`
does not produce debugging logs even if systemd.log-level=debug is set. This fixes
the issue.
2021-02-01 01:13:44 +09:00
Yu Watanabe
8ccc31d498 network: drop one more link_dirty()
Follow-up for 9092113d93.

link_dirty() will be called later in this function when a DNS or domain
is dropped.
2021-02-01 01:11:44 +09:00
Yu Watanabe
5caac53adb
Merge pull request #18417 from DaanDeMeyer/sd-boot-no-include
sd-boot fixes
2021-01-31 22:26:59 +09:00