Commit graph

51937 commits

Author SHA1 Message Date
Luca Boccassi 587f2a5e56 coredump: check cgroups memory limit if storing on tmpfs
When /var/lib/systemd/coredump/ is backed by a tmpfs, all disk usage
will be accounted under the systemd-coredump process cgroup memory
limit.
If MemoryMax is set, this might cause systemd-coredump to be terminated
by the kernel oom handler when writing large uncompressed core files,
even if the compressed core would fit within the limits.

Detect if a tmpfs is used, and if so check MemoryMax from the process
and slice cgroups, and do not write uncompressed core files that are
greater than half the available memory. If the limit is breached,
stop writing and compress the written chunk immediately, then delete
the uncompressed chunk to free more memory, and resume compressing
directly from STDIN.

Example debug log when this situation happens:

systemd-coredump[737455]: Setting max_size to limit writes to 51344896 bytes.
systemd-coredump[737455]: ZSTD compression finished (51344896 -> 3260 bytes, 0.0%)
systemd-coredump[737455]: ZSTD compression finished (1022786048 -> 47245 bytes, 0.0%)
systemd-coredump[737455]: Process 737445 (a.out) of user 1000 dumped core.
2021-06-08 14:05:56 +01:00
Luca Boccassi 5b6f8e13ad compress: return uncompressed size to the caller
Useful when compressing anonymous FDs that cannot be rewund
2021-06-08 14:05:56 +01:00
Luca Boccassi 93ff34e44a core: add MemoryAvailable unit property
Try to infer the unused memory that a unit can claim before the
memory.max limit is reached, including any limit set on any parent
slice above the unit itself.
2021-06-08 14:05:56 +01:00
Emilio Herrera d477a094e8 po: Translated using Weblate (Spanish)
Currently translated at 62.9% (119 of 189 strings)

Co-authored-by: Emilio Herrera <ehespinosa57@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/es/
Translation: systemd/main
2021-06-08 11:28:46 +01:00
Zbigniew Jędrzejewski-Szmek f75420a43a man: explain ConditionNeedsUpdate a bit more
We were effectively doing all post-upgrade scripts twice in Fedora. We got this
wrong, so it's likely other people will get it wrong too. So let's explain
what is actually needed to make this work, but also when it's not useful.
2021-06-08 10:47:11 +02:00
Yu Watanabe 16e09d51a7 meson: do not share compiler flags except for emitting warnings
Follow-up for 6526736397.

Prompted by https://github.com/systemd/systemd/issues/19191#issuecomment-856312107.
2021-06-08 10:44:34 +02:00
alexlzhu 9f40351f77
man: update docs on systemd-system.conf logging (LogTime=) (#19846)
Updating documentation for systemd to reflect that logging is done in the console.
2021-06-08 15:54:07 +09:00
Yu Watanabe 50b9fa01ed
Merge pull request #19639 from yuwata/network-next
network: bunch of fixes and new features
2021-06-08 10:29:54 +09:00
Yu Watanabe a7f07cbe34 network: wait for all set-link requests are processed 2021-06-08 06:39:48 +09:00
Yu Watanabe 29836c166d network: drop trivial aliases of link_set_state() 2021-06-08 06:39:48 +09:00
Yu Watanabe 1187fc3375 network: use link_request_to_set_master() or friends 2021-06-08 06:39:48 +09:00
Yu Watanabe 112a0972a2 network: introduce link_request_to_activate()
The request will be processed after all setlink requests are processed.
The function will be used in later commits.
2021-06-08 06:39:48 +09:00
Yu Watanabe 0e397560cc network: it is not necessary to call RTM_GETLINK when carrier is gained 2021-06-08 06:39:48 +09:00
Yu Watanabe 440d40dcc0 network: set bridge or bond properties after master ifindex is set 2021-06-08 06:39:48 +09:00
Yu Watanabe 1362bd6c64 network: sync link information after set-link request is processed
Some properties do not notify their changes. See do_setlink() in
net/core/rtnetlink.c of kernel.
2021-06-08 06:39:48 +09:00
Yu Watanabe 5a1860f761 network: use link_call_getlink() where applicable 2021-06-08 06:39:48 +09:00
Yu Watanabe 79c6e11456 network: introduce link_call_getlink() 2021-06-08 06:39:48 +09:00
Yu Watanabe 0d411b7f8f network: split link_update() into small pieces 2021-06-08 06:39:26 +09:00
Yu Watanabe 852a391605 network: shorten code a bit, and reduce indentation 2021-06-08 06:35:49 +09:00
Yu Watanabe b156a95d4a network: update operational state or friends on reconfigure 2021-06-08 06:35:49 +09:00
Yu Watanabe 4b9a8c2b51 network: make link enter failed state when link_initialized() is failed 2021-06-08 06:35:49 +09:00
Yu Watanabe 0c9ee5d5e8 network: move functions
This changes no behavior. Preparation for later commits.
2021-06-08 06:35:49 +09:00
Yu Watanabe 813572853e network: introduce link_get_master() and use it where applicable 2021-06-08 06:35:49 +09:00
Yu Watanabe 8252fb4439 network: introduce link_request_to_set_bridge_vlan()
This will be used in later commits.
2021-06-08 06:35:45 +09:00
Yu Watanabe bfd7fb09cf sd-netlink: add IFLA_BRIDGE_FLAGS and IFLA_BRIDGE_VLAN_INFO attributes 2021-06-08 06:34:41 +09:00
Yu Watanabe 5106ad00e6 network: expose bridge_vlan_append_info() 2021-06-08 06:34:38 +09:00
Yu Watanabe 5546870e7b network: introduce network_adjust_bridge_vlan() 2021-06-08 06:33:27 +09:00
Yu Watanabe 1a0e5ca2f3 network: rebreak arguments 2021-06-08 06:33:27 +09:00
Yu Watanabe 9670e45a6e network: rename networkd-brvlan.[ch] -> networkd-bridge-vlan.[ch] 2021-06-08 06:33:27 +09:00
Yu Watanabe 5062b8593a network: introduce link_request_to_set_bond()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe 7d5b232f40 network: introduce link_request_to_set_bridge()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe 71a754f70f network: introduce link_request_to_create_stacked_netdev()
This will be used in later commits.
2021-06-08 06:33:27 +09:00
Yu Watanabe d24bf1b514 network: introduce link_request_to_set_master()
The function will be used later.
2021-06-08 06:33:27 +09:00
Yu Watanabe 8e00e24cc9 network: use request queue to set IPv6LL address generation mode 2021-06-08 06:33:27 +09:00
Yu Watanabe cc4c8fb136 network: use request queue to set interface group 2021-06-08 06:33:27 +09:00
Yu Watanabe a8e5e27c9f network: use request queue to set MAC address 2021-06-08 06:33:27 +09:00
Yu Watanabe 93fabc10fa network: use request queue to set link flags 2021-06-08 06:33:27 +09:00
Yu Watanabe 0fa8ee6c77 network: use request queue to set MTU 2021-06-08 06:33:27 +09:00
Yu Watanabe fa28381202 network: merge link_configure() and link_configure_continue() again
It is not necessary to stop whole configuration process until MTU and
IPv6LL address generation mode are set. But it is enough just setting
IPv6 MTU again after MTU is set, and dropping IPv6LL address after
setting the address generation mode.
2021-06-08 06:33:27 +09:00
Yu Watanabe 793117b3fd network: drop meaningless condition about setting MTU
The condition does not fix infinite loop of interface reset, as the
interface is reset after netlink reply is received, thus setting_mtu is
false.

See also #18738.
2021-06-08 06:33:27 +09:00
Yu Watanabe b9bf3f22a8 network: introduces link_drop_ipv6ll_addresses()
It is not necessary to parse whole message and store the address in
Link::addresses_foreign, as the address will be removed soon later.
2021-06-08 06:33:27 +09:00
Yu Watanabe f0269653e9 network: make link enter failed state on failure in link_update() and link_reset_carrier()
Previously, several failures in link_carrier_gained() make link enter
failed state, and other errors are ignored. Now, all failures in
link_carrier_gained(), moreover, link_update() are critical.
2021-06-08 06:33:27 +09:00
Yu Watanabe 8566df791e network: rename link_acquire_conf() -> link_acquire_dynamic_conf()
To clarify it starts dynamic configuration engines e.g. DHCP clients.
2021-06-08 06:33:27 +09:00
Yu Watanabe 9710895378 network: request to configure static settings earlier
Now, all static configs should be ordered after the link gains its carrier.
So, it is not necessary to wait for that before queuing requests.
2021-06-08 06:33:27 +09:00
Yu Watanabe 40b12fa20d network: introduce request_hash_ops to dedup requests
If KeepConfiguration= or ConfigureWithoutCarrier= is set, then the same
requests may be queued.
2021-06-08 06:33:27 +09:00
Yu Watanabe 5f33159190 network: expose hash and compare functions 2021-06-08 06:33:27 +09:00
Yu Watanabe fdeba3f5cc network: use request queue to configure IPv6 proxy NDP addresses 2021-06-08 06:33:27 +09:00
Yu Watanabe d8350b60e0 network: move logic for setting proxy_ndp sysctl to networkd-sysctl.c 2021-06-08 06:33:27 +09:00
Yu Watanabe 14d9ab9d32 network: introduce network_adjust_ipv6_proxy_ndp() 2021-06-08 06:33:27 +09:00
Yu Watanabe 354bc760cd network: address label: use request queue to configure address labels 2021-06-08 06:33:27 +09:00