0
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-14 12:43:36 +08:00
Commit Graph

42916 Commits

Author SHA1 Message Date
Lennart Poettering
a5292dfdf7
Merge pull request from poettering/namespace-ro-fix
core: be nicer to read-only images
2020-01-10 17:03:01 +01:00
Lennart Poettering
4504f59fbd
Merge pull request from yuwata/xyzctl-full
use table_set_width(table, 0) if --full is specified
2020-01-10 16:40:31 +01:00
Yu Watanabe
12845a91b5 machinectl: do not truncate addresses when --full is specified 2020-01-10 19:19:15 +09:00
Yu Watanabe
bd17fa8cd8 tree-wide: use table_log_add_error() 2020-01-10 18:28:30 +09:00
Yu Watanabe
964a7745de portablectl: optimize table creation 2020-01-10 18:28:23 +09:00
Yu Watanabe
679c7c7a67 machinectl: optimize table creation 2020-01-10 18:28:17 +09:00
Yu Watanabe
9c46b437fc analyze: optimize table creation by using table_add_many() 2020-01-10 18:28:09 +09:00
Yu Watanabe
d8aedafb57 format-table: add table_log_add_error() 2020-01-10 18:23:20 +09:00
Anita Zhang
0e05be8405 initctl: (void)ify epoll_ctl()
CID 996298
2020-01-10 10:06:09 +01:00
Anita Zhang
e127d90210
Merge pull request from poettering/cgroup-sibling-fix
core: fix re-realization of cgroup siblings
2020-01-09 23:57:39 -08:00
Yu Watanabe
98d886be79
Merge pull request from ddstreet/ll_no
networkd: set addr_gen_mode and check for tentative ipv6ll before dro…
2020-01-10 15:44:44 +09:00
Yu Watanabe
e2268fa437 bash-completion: do not ellipsize machine name 2020-01-10 12:29:02 +09:00
Yu Watanabe
a65e34ccb0 machinectl: do not ellipsize table when --full is specified 2020-01-10 12:24:51 +09:00
Yu Watanabe
2a6c483b8c bash-completion: busctrl: support --full command line option 2020-01-10 12:22:08 +09:00
Yu Watanabe
b683b82fe7 busctl: introduce --full command line option 2020-01-10 12:19:47 +09:00
Yu Watanabe
6c64cf8859 bash-completion: networkctl: do not show ellipsized link name 2020-01-10 12:13:12 +09:00
Yu Watanabe
a42d949080 networkctl: set table width 0 when --full is specified 2020-01-10 12:12:00 +09:00
Yu Watanabe
a362c069a9 systemd-mount: add --full command line option 2020-01-10 12:07:28 +09:00
Lennart Poettering
bcf00b6c0a format-table: allow forcing arbitrary width tables
Useful for implementing systemctl's --full.

See 
2020-01-10 11:53:28 +09:00
Anita Zhang
79bb680cbf
Merge pull request from poettering/socket-state-fix
core: propagate service state to socket in more load states
2020-01-09 17:10:48 -08:00
Dan Streetman
0c020321c8 test-network: simplify wait_online() by calling wait_operstate()
The wait_operstate() function now rechecks the condition for a timeout,
so the wait_online() function can simply call it to check for the
setup_state.
2020-01-09 15:19:19 -05:00
Dan Streetman
a4632dc7d1 test-network: convert wait_operstate() to recheck condition for timeout seconds
Failing after a single check leads to extra sleeps scattered through
test cases, and can also lead to false failures.  Instead perform a
recheck for a number of seconds until the state matches, and fail only
if the timeout is exceeded.

This allows removing all the manual sleeps in the testcases.
2020-01-09 15:19:19 -05:00
Dan Streetman
19cf3143cf test-network: rename check_operstate() to wait_operstate()
Rename only, no functional change; this makes following patches easier
to read.
2020-01-09 15:19:19 -05:00
Dan Streetman
4c64965257 network: drop foreign config after addr_gen_mode has been set
Interfaces may come up at any time, even during our initialization of
them, for various reasons; e.g. the kernel will raise VLAN when its
parent is raised; or we will raise an interface if configured with
BindCarrier and its associated interfaces come up.

When LinkLocalAddressing has been disabled for ipv6, we disable
addr_gen_mode in the kernel, so it will not automatically create a
ipv6ll address when the interface is raised.  However, we currently
drop all foreign addresses before disabling addr_gen_mode.

If the link has been up for a long time, then its kernel-created ipv6ll
address will be correctly dropped.  If the link is down, and stays
down until we raise it after finishing configuration, the addr_gen_mode
setting will be disabled when the interface is raised and the kernel
will not create any ipv6ll address.

However, if the interface is raised after dropping foreign config,
but before we have disabled addr_gen_mode, the kernel will create a
ipv6ll tentative address that will eventually finish DAD and become a
working ipv6ll address, even though we have been configured to disable
ipv6ll.

Moving our call to drop foreign addresses to after we have successfully
set addr_gen_mode closes this window; after we disable addr_gen_mode,
we can safely remove foreign ipv6ll addresses (including tentative ones)
and be sure that the kernel will not create any more.

Fixes: .
2020-01-09 15:19:19 -05:00
Dan Streetman
0917a27178 network: if ipv6ll is disabled, enumerate tentative ipv6 addrs before dropping foreign addrs
The kernel will create an ipv6ll tentative address immediately when an
interface is raised if addr_gen_mode is not disabled; and, the kernel does
not notify netlink listeners about any tentative addresses.  So it's
possible for an interface to contain tentative ipv6 link-local address(es)
that networkd doesn't know about when all foreign addresses are dropped.

In this case, networkd is later notified about the new ipv6ll address(es)
after they finish DAD and are no longer tentative; but since that's after
networkd has already dropped foreign addresses, they are incorrectly left
on the interface.
2020-01-09 15:19:19 -05:00
Dan Streetman
9524014ee6 network: add link->setting_genmode flag
Similar to the link->setting_mtu flag, this delays continued configuration
until after the genmode has been successfully set; this is important
because we do not want networkd to raise the interface before the genmode
has been set, as if we're disabling the genmode, raising the interface
before we have successfully disabled the genmode will result in the kernel
creating a ipv6ll address, even though we don't want that.
2020-01-09 15:19:19 -05:00
Dan Streetman
3a390124b7 network: rename linux_configure_after_setting_mtu() to linux_configure_continue()
This is a simple rename to make the function name more generic;
the next commit expands its usage to more than only the mtu handler.
2020-01-09 15:19:08 -05:00
HATAYAMA Daisuke
b63c88b627 man: describe "symlink" and "systemctl link" explicitly in UNIT FILE LOAD PATH
There are sometimes users who put unit files in a location that is inaccessible
when systemd starts although they are not found and thus not started because
the corresponding mount units have not activated yet.

There is already a warning for such issue in man 8 systemctl:

     link PATH...
         ...<snip>...
         The file system where
         the linked unit files are located must be accessible
         when systemd is started (e.g. anything underneath /home
         or /var is not allowed, unless those directories are
         located on the root file system).

However, it looks that it's difficult to find the warning because introductory
users typically doesn't know systemctl link.

Although there is a description in UNIT FILE LOAD PATH pointing to systemctl
link, symlink is now not explicitly mentioned there and thus users doesn't
easily get aware of they should read it.

To deal with this, let's describe "symlink" and "systemctl link" more
explicitly in UNIT FILE LOAD PATH.
2020-01-09 18:52:13 +01:00
Lennart Poettering
65f6b6bdcb core: fix re-realization of cgroup siblings
This is a fix-up for eef85c4a3f which
broke this.

Tracked down by @w-simon

Fixes: 
2020-01-09 17:31:41 +01:00
Lennart Poettering
8ac7339648
Merge pull request from yuwata/mount-use-format-table
systemd-mount: use format-table.[ch]
2020-01-09 15:47:24 +01:00
Yu Watanabe
0ca1926ec3 bash-completion: networkctl: support --full and --lines 2020-01-09 15:43:18 +01:00
Lennart Poettering
404308486a core: be more restrictive on the dependency types we allow to be created transiently
We should allow the ones that the [Unit] section of regular unit files
may accet, but no other, in particular not the internal deps we
synthesize as reverse of explicitly configured ones, such was WantedBy=.

Fixes: 
2020-01-09 15:42:34 +01:00
Yu Watanabe
cf57766d79 timedatectl: use format-table.[ch] 2020-01-09 15:40:50 +01:00
Yu Watanabe
a5279634c0 systemd-mount: add --no-legend command line option 2020-01-09 20:16:03 +09:00
Yu Watanabe
6ae6ea55d8 systemd-mount: use format-table.[ch] 2020-01-09 20:16:03 +09:00
Yu Watanabe
f93d876c80 format-table: introduce TABLE_PATH 2020-01-09 20:16:03 +09:00
Lennart Poettering
4c2ef32767 core: propagate service state to socket in more load states
It makes sense to filter state changes for some load states that
shouldn't happen, but the common cases should be accepted, because they
might happen during runtime when "systemctl daemon-reload" is issued and
unit files changed state in between. Otherwise we lose events.

Fixes: 
2020-01-09 11:53:26 +01:00
Thomas Schmitt
19212f2781 udev: don't import parent ID_FS_ data on partitions
When probing partitions, we inherit important information from the parent
disk device such as ID_MODEL, and usage of such properties is seen to
be acceptable and well established.

However, we need to exclude filesystem information from the properties
that get inherited. Information about the device content should not be
passed on in this way.

For example, Linux distro install media commonly uses an ISO filesystem
plus a partition table. The ISO filesystem is detected on the main disk
device, but we should not pass down those details to the partitions,
some or all of which may be pointing at storage areas completely distinct
from the ISO filesystem.

This is particularly problematic when adding new partitions on media
set up in this way (since the new partitions are then reported to contain
the parent device's ISO filesystem), or when dealing with more unusual
hybrid ISO layouts. The inaccuracy of information here inversely affects
users of blkid and udev's persistent storage symlinks.

Exclude ID_FS_* properties from the inheritance chain to avoid these
problems.

Fixes: 
2020-01-09 11:20:55 +01:00
Lennart Poettering
b0a94268f8 core: when we cannot open an image file for write, try read-only
Closes: 
2020-01-09 11:18:06 +01:00
Lennart Poettering
c8c535d589 namespace: tweak checks whether we can mount image read-only
So far we set up a loopback file read-only iff ProtectSystem= and
ProtectHome= both where set to values that mark these dirs read-only.
Let's extend that and also be happy if /home and the root dir are marked
read-only by some other means.

Fixes: 
2020-01-09 11:18:02 +01:00
Lennart Poettering
9a2ec8f7a6 install: use path_strv_contains() where appropriate 2020-01-09 11:17:59 +01:00
Lennart Poettering
3593fa60f2 path-util: express PATH_IN_SET() through path_strv_contains() 2020-01-09 11:17:47 +01:00
Lennart Poettering
3841fee822 path-util: introduce path_strv_contains() helper
it's like strv_contains() but uses path_equal() rather than streq() to
compare strings.
2020-01-09 11:17:21 +01:00
Yu Watanabe
125c7814fa
Merge pull request from keszybz/refactorings
Refactorings inspired by recent pull requests
2020-01-09 12:50:11 +09:00
Zbigniew Jędrzejewski-Szmek
b44d87e200 sd-event: use _cleanup_ in one more place 2020-01-08 17:15:54 +01:00
Zbigniew Jędrzejewski-Szmek
1eac79486e sd-event: use RAII for struct epoll_event
Inspired by .
2020-01-08 17:15:46 +01:00
Zbigniew Jędrzejewski-Szmek
0475919b56 network: use automatic stack allocation and structured init 2020-01-08 17:15:19 +01:00
Zbigniew Jędrzejewski-Szmek
6666c4faee network: do not require ethtool_get_permanent_macaddr() to get an fd 2020-01-08 17:14:56 +01:00
Lennart Poettering
6a6078a585 test: minor typo fix
As pointed out on: https://github.com/systemd/systemd/pull/14465#discussion_r364152064
2020-01-08 14:50:30 +00:00
Lennart Poettering
0aa9bffe10
Merge pull request from yuwata/network-permanent-mac-address
network, udev: support permanent mac address
2020-01-08 15:36:27 +01:00