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

52970 Commits

Author SHA1 Message Date
Yu Watanabe
05403363ca tree-wide: fix typo 2021-09-05 09:09:13 +02:00
Luca Boccassi
5bf20f3a0d
Merge pull request #20626 from yuwata/network-keep-master
network: introduce KeepMaster= setting
2021-09-04 15:08:56 +01:00
Dan Streetman
c29537f39e meson.build: change operator combining bools from + to and
upstream meson stopped allowing combining boolean with the plus
operator, and now requires using the logical and operator

reference:
43302d3296

Fixes: #20632
2021-09-04 09:09:32 +09:00
Yu Watanabe
e643c3d82d network: add 80-container-vb.network 2021-09-04 08:15:34 +09:00
Yu Watanabe
b06469a66c test-network: add tests for KeepMaster= 2021-09-04 08:15:30 +09:00
Zbigniew Jędrzejewski-Szmek
2c1591b91e
Merge pull request #20629 from keszybz/mkosi-host-distro-by-default
mkosi: build for the host distro by default
2021-09-03 17:46:35 +02:00
Yu Watanabe
57aef9d737 network: introduce KeepMaster= setting
Closes #20624.
2021-09-04 00:23:20 +09:00
Yu Watanabe
1f024462d1 network: assume enslaved when master ifindex is positive 2021-09-04 00:20:36 +09:00
Yu Watanabe
571bf1aa31 network: use master ifindex to check if the interface is enslaved 2021-09-04 00:20:36 +09:00
Yu Watanabe
a94ed9bd62 man: drop unnecessary white space 2021-09-04 00:20:36 +09:00
Lennart Poettering
b03803f0dc format-table: allow to explicitly override JSON field names
In some cases it's useful to explicitly generate the JSON field names to
generate for table columns, instead of auto-mangling them from table
header names that are intended for human consumption.

This adds the infra and a test for it.

It's intended to be used by #20544, for the first column, which in text
mode should have an empty header field, but have an explicit name in
json output mode.
2021-09-03 14:37:26 +01:00
Zbigniew Jędrzejewski-Szmek
d55ad7fe96 mkosi: move distro files to mkosi.default.d/
With this change, "mkosi build" will automatically build systemd for the
current distro without any further configuration. If people want to do a
cross-distro build by default, they can still create mkosi.default, but I
assume that this is relatively rare.

If people have symlinked mkosi.default to one of the files in .mkosi/, they'll
need to adjust the symlink.

(Building without configuration would always fail, since systemd has many many
required dependencies. I think it's nicer to do the most commonly expected
thing by default, i.e. rebuild for the current distro.)

Mkosi is nowadays packaged for most distros, so recommend installing of distro
packages as the primary installation mechanism.
2021-09-03 13:18:38 +02:00
Zbigniew Jędrzejewski-Szmek
6ad92aaf90 gitignore: only ignore *local*.conf" under mkosi.default.d/
The pattern was added in 6242cda99d, with the
idea that users will have local configuration files for mkosi and git should
not bother them about those. But let's make this narrower, and only match
files with "local". This way we reduce the risk that some unrelated file
will be ignored by accident.

.gitignore in the parent directory is used, because mkosi apparently tries
to load all files under mkosi.default.d/, without looking at the extension.
This is probably something to fix in mkosi too.
2021-09-03 13:15:52 +02:00
Jan Janssen
0d5765f7af journalctl: Use constants in some more places 2021-09-03 09:58:07 +02:00
Zbigniew Jędrzejewski-Szmek
068d133881 mkosi: make mkosi.build shellcheck-clean
Also remove the space after redirection operators. (Some redirections
were with, some without, and I think it's nicer without.)
2021-09-03 09:54:43 +02:00
Zbigniew Jędrzejewski-Szmek
fc5f5c2a3c mkosi: drop the code to determine nobody user name
The comments were outdated: at least "nfsnobody" is not used in Fedora since a
few years. So I hope we don't need this anymore. The meson build scripts do
autodetection on their own.
2021-09-03 09:54:42 +02:00
Yu Watanabe
b2cdc2c05e
Merge pull request #20603 from yuwata/udev-node-cleanups
udev: cleanups for creating/removing device node symlinks
2021-09-03 05:33:06 +09:00
Vito Caputo
a4121e965f sd-journal: use FILE streams to buffer write_uint64()
journal_file_verify() uses a set of tmpfs files to create lists
of object positions by type.

The existing code used a bare write() call for every object
position written, incurring a syscall per listed object.

This commit encapsulates the bare file descriptors in FILE *'s
and replaces the bare write with fwrite, buffering the writes so
there's less syscalls.

Cached `journalctl --verify` tests showed a ~8% faster runtime
with this change on a release build, verifying 1.3GiB of
production journals across 16 files.
2021-09-02 11:29:23 +02:00
Yu Watanabe
fad45198b6 xattr-util: drop unused path_getcrtime() 2021-09-01 21:36:36 -07:00
Yu Watanabe
b57947114e fs-util: use futimens_opath() helper function 2021-09-01 21:36:36 -07:00
Yu Watanabe
b71dbc6b56 fs-util: drop unnecessary initialization 2021-09-01 21:36:36 -07:00
Yu Watanabe
7920d0a135 udev-node: drop redundant trial of devlink creation
Previously, the devlink was created based on the priority saved in udev
database. So, we needed to reevaluate devlinks after database is saved.

But now the priority is stored in the symlink under /run/udev/links, and
the loop of devlink creation is controlled with the timestamp of the
directory. So, the double evaluation is not necessary anymore.
2021-09-02 09:06:25 +09:00
Yu Watanabe
0063fa23a1 udev-node: add random delay on conflict in updating device node symlink
To make multiple workers not update the same device node symlink
simultaneously.
2021-09-02 09:06:24 +09:00
Yu Watanabe
8424da2de8 udev-node: shorten code a bit and update log message 2021-09-02 09:06:24 +09:00
Yu Watanabe
1cd4e32569 udev-node: check stack directory change even if devlink is removed
Otherwise, when multiple device additions and removals occur
simultaneously, symlink to unexisting devnode may be created.

Hopefully fixes #19946.
2021-09-02 09:06:24 +09:00
Yu Watanabe
242d39ebc1 udev-node: always atomically create symlink to device node
By the previous commit, it is not necessary to distinguish if the devlink
already exists. Also, I cannot find any significant advantages of the
previous complecated logic, that is, first try to create directly, and then
fallback to atomically creation. Moreover, such logic increases the chance
of conflicts between multiple udev workers.

This makes devlinks always created atomically. Hopefully, this reduces the
conflicts between the workers.
2021-09-02 09:06:24 +09:00
Yu Watanabe
8f27311eb2 udev-node: assume no new claim to a symlink if /run/udev/links is not updated
During creating a symlink to a device node, if another device node which
requests the same symlink is added/removed, `stat_inode_unmodified()`
should always detects that. We do not need to continue the loop
unconditionally.
2021-09-02 09:06:24 +09:00
Yu Watanabe
6df797f75f udev-node: always update timestamp of stack directory
Please see the comments in the code.
2021-09-02 09:06:08 +09:00
Yu Watanabe
377a83f0d8 udev-node: save information about device node and priority in symlink
Previously, we only store device IDs in /run/udev/links, and when
creating/removing device node symlink, we create sd_device object
corresponds to the IDs and read device node and priority from the
object. That requires parsing uevent and udev database files.

This makes link_find_prioritized() get the most prioritzed device node
without parsing the files.
2021-09-02 08:30:51 +09:00
Yu Watanabe
46070dbf26 udev-node: stack directory must exist when adding device node symlink 2021-09-02 08:30:51 +09:00
Yu Watanabe
2f48561e0d udev-node: split out permission handling from udev_node_add()
And then merge udev_node_add() and udev_node_update_old_links().
2021-09-02 08:30:51 +09:00
Yu Watanabe
b881ce16b9 sd-device: introduce device_has_devlink() 2021-09-02 08:30:51 +09:00
Yu Watanabe
c21d094c65
Merge pull request #20614 from poettering/efi-clean-ups
two minor clean-ups for the efi code
2021-09-02 08:30:07 +09:00
Lennart Poettering
32b9736a23 nspawn: fix type to pass to connect()
It expects a generic "struct sockaddr", not a "struct sockaddr_un".
Pass the right member of the union.

Not sure why gcc/llvm never complained about this...
2021-09-02 08:27:46 +09:00
Lennart Poettering
206284f5b0 efi: drop spaces between function name and "("
When pulling in the SHA256 implementation from glibc, only some of the
coding style was adjusted to ours, other was not. Let's make things a
bit more consistent.
2021-09-01 23:23:34 +02:00
Lennart Poettering
c0ad07b190 efi: make EFI_GUID generally constant
The GUIDs we usually deal with should be considered constant. Hence make
them so. Unfortunately the prototypes for various functions doesn't mark
them as const (but still decorates them with "IN", clarifying they are
input-only), hence we need to cast things at various places. We already
cast in similar fashion in many other cases, hence unify things here in
one style.

Making the EFI_GUID constant (and in particular so when specified in C99
compound literal style) allows compilers to merge multiple instances of
them.
2021-09-01 23:23:34 +02:00
Kristian Klausen
54632d2ea4 repart: Support volatile-root for finding the root partition
The automatic logic can't always find the original root partition (ex:
if the rootfs is copied to a ext4 fs backed by zram in the initramfs),
so we want to support "/run/systemd/volatile-root" which is a symlink to
the original root partition.

Fix #20610
2021-09-01 21:51:39 +02:00
Franck Bui
ce380c2f09 test: make sure to include all haveged unit files
Recent versions of haveged relies on haveged-switch-root.service too.
2021-09-01 20:40:55 +01:00
Lennart Poettering
50dbb118c9
Merge pull request #20575 from vcaputo/verify_field_object_hash
sd-journal: verify field object hash
2021-09-01 15:56:05 +02:00
Yu Watanabe
bdb492b2ed udev: do not remove control socket on exit
As we usually do, remove old unix socket before bind.

Note that systemd-udevd-control.socket has `RemoveOnStop=yes`.
So, it is not necessary to be removed when the service exits.

Replaces #20584 and #20588.
2021-09-01 14:44:00 +02:00
Lennart Poettering
42ffc40ce3
Merge pull request #20537 from yuwata/sd-netlink-more-attributes
udev: use link info obtained through netlink
2021-09-01 13:25:54 +02:00
Lennart Poettering
724f207d0d
Merge pull request #20521 from DaanDeMeyer/analyze-condition-units
analyze: Support passing unit files to systemd-analyze condition
2021-09-01 13:25:31 +02:00
Daan De Meyer
8de7929de5 mkosi: Add zsh to Arch packages
Useful for testing zsh completion changes.
2021-09-01 10:01:18 +02:00
Daan De Meyer
e11ca6bb4d mkosi: Install bash-completion in Arch image
Useful for testing bash completion changes.
2021-09-01 10:00:12 +02:00
Daan De Meyer
65fcee152d mkosi: Add man-db to arch packages
Required to test systemd-analyze verify.
2021-09-01 10:00:12 +02:00
Jan Kuparinen
9a59d1f22f po: Translated using Weblate (Finnish)
Currently translated at 48.6% (92 of 189 strings)

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fi/
Translation: systemd/main
2021-09-01 05:17:52 +09:00
Luca Boccassi
cc3001693d
Merge pull request #20525 from maanyagoenka/custom-security
systemd-analyze: add option to enable users to custom define security requirements in the form of a .json file
2021-08-31 21:15:41 +01:00
Lennart Poettering
322b3b38a8 update TODO 2021-08-31 17:11:10 +02:00
Alvin Šipraga
8e664ab6ec network: print Ethernet Link-Layer DHCP client ID with leading 0's
This is a small cosmetic change.

Before:

   Offered DHCP leases: 192.168.0.183 (to 0:9:a7:36:bc:89)

After:

   Offered DHCP leases: 192.168.0.183 (to 00:09:a7:36:bc:89)
2021-09-01 00:04:04 +09:00
Maanya Goenka
4b6221194d test: add integration tests for systemd-analyze 2021-08-31 08:02:08 -07:00