Lennart Poettering [Mon, 16 Apr 2018 19:40:26 +0000 (21:40 +0200)]
meson: install nspawn tmpfiles snippet only when machined is turned on
Lennart Poettering [Mon, 16 Apr 2018 19:37:12 +0000 (21:37 +0200)]
polkit: normalize exit values of polkit_agent_open_if_enabled()
It's strange eating up the errors here, hence don't. Let's leave this
to the caller.
Lennart Poettering [Tue, 17 Apr 2018 15:40:10 +0000 (17:40 +0200)]
man: minor machinectl updates
Lennart Poettering [Thu, 5 Apr 2018 10:38:25 +0000 (12:38 +0200)]
machined: some modernizations
A couple of minor modernizations:
1. Don't unnecessarily export functions we don't call outside of
machined.c
2. Use cleanup logic for the manager object.
3. Propagate errors properly from manager_new(). So far if
sd_event_new() returns EMFILE/ENFILE for some reason we would have
logged that as log_oom(), which isn#t right, really.
4. Handle SIGTERM/SIGINT cleanly. It's easy, and prettier then letting
the kernel just abort us. It also makes it possible to valgrind
machined properly.
Yu Watanabe [Tue, 17 Apr 2018 17:49:10 +0000 (02:49 +0900)]
unit,meson: drop .in suffix if no substitution is required (#8740)
Lennart Poettering [Tue, 17 Apr 2018 17:34:27 +0000 (19:34 +0200)]
Merge pull request #8716 from keszybz/two-nitpicks
Two nitpicks
Anssi Hannula [Tue, 17 Apr 2018 15:12:00 +0000 (18:12 +0300)]
networkd: fix dhcp4 link without routes not being considered ready (#8728)
The dhcp4 code sets link->dhcp4_configured when dhcp4_route_handler()
has processed the last message.
However, in case UseRoutes=no has been set in the [DHCP] section, or
in case the DHCP server simply sends no routes, link_set_dhcp_routes()
will not send any netlink messages and dhcp4_route_handler() will
therefore never be called.
This causes the link to never reach LINK_STATE_CONFIGURED, and e.g.
systemd-networkd-wait-online will not consider the link as ready.
Fix that by setting link->dhcp4_configured = true and calling
link_check_ready() in dhcp4_address_handler() in case
link_set_dhcp_routes() sent no netlink messages (dhcp4_messages is
zero).
Zbigniew Jędrzejewski-Szmek [Fri, 13 Apr 2018 10:40:11 +0000 (12:40 +0200)]
basic/copy: fix awkward sentence
Zbigniew Jędrzejewski-Szmek [Fri, 13 Apr 2018 10:38:11 +0000 (12:38 +0200)]
basic/unit-name: remove duplicate check
The check that was right below already covers this case.
Susant Sahani [Tue, 17 Apr 2018 14:55:04 +0000 (20:25 +0530)]
networkd: fix crash if fails to get network file (#8714)
In some situation if networkd fails to get the network file
then networkd crashes becasse the link->network is not initalized;
```
veth99: Failed to get network dhcp-client-ipv4-only: No such file or directory
Segmentation fault
gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/sus/tt/systemd/build/systemd-networkd
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
warning: Loadable section ".note.gnu.property" outside of ELF segments
Program received signal SIGSEGV, Segmentation fault.
link_load (link=0x55555582ccd0) at ../src/network/networkd-link.c:2973
2973 r = sd_dhcp_client_new(&link->dhcp_client, link->network->dhcp_anonymize);
(gdb) bt
(gdb) p link->network
$1 = (Network *) 0x0
(gdb) list
2968 if (r < 0) {
2969 log_link_debug_errno(link, r, "Failed to parse DHCPv4 address %s: %m", dhcp4_address);
2970 goto dhcp4_address_fail;
2971 }
2972
2973 r = sd_dhcp_client_new(&link->dhcp_client, link->network->dhcp_anonymize);
2974 if (r < 0)
2975 return log_link_error_errno(link, r, "Failed to create DHCPv4 client: %m");
2976
2977 r = sd_dhcp_client_set_request_address(link->dhcp_client, &address.in);
(gdb) r
```
Hans de Goede [Tue, 17 Apr 2018 14:51:33 +0000 (16:51 +0200)]
hwdb: Add a 2nd accelerometer orientation quirk for the Lenovo Ideapad Miix 320 (#8734)
Different batches of the Lenovo Ideapad Miix 320 use a different sensor
it seems. Add a quirk for the model which uses the SMO8840 (ST) sensor.
Jan Synacek [Tue, 17 Apr 2018 14:42:44 +0000 (16:42 +0200)]
logind: enable limiting of user session scopes using pam context objects (#8397)
Lennart Poettering [Tue, 17 Apr 2018 13:54:10 +0000 (15:54 +0200)]
Merge pull request #8575 from keszybz/non-absolute-paths
Do not require absolute paths in ExecStart and friends
Yu Watanabe [Tue, 17 Apr 2018 10:40:45 +0000 (19:40 +0900)]
network,resolve: remove unused variables (#8738)
Follow-up for
d7afd945b5aad5b262a3de97614f486d63d94612.
Zbigniew Jędrzejewski-Szmek [Tue, 17 Apr 2018 09:55:12 +0000 (11:55 +0200)]
Merge pull request #8696 from pabigot/issue/8683
Use /run/clock/synchronized to notify when clock has been synchronized
Zbigniew Jędrzejewski-Szmek [Wed, 11 Apr 2018 14:50:48 +0000 (16:50 +0200)]
test-execute: make find invocation a bit more efficent, increase timeout
We go through the whole file system, so this test can take arbitrary time. But
this test is still quite useful, so let's at least try to make it more efficent
by not descending at all into the directories we would filter out later on
anyway.
Also increase the timeout, in case the previous step doesn't help enough.
Zbigniew Jędrzejewski-Szmek [Mon, 26 Mar 2018 07:51:12 +0000 (09:51 +0200)]
systemd-path: allow the default search path to be queried
Zbigniew Jędrzejewski-Szmek [Sun, 25 Mar 2018 19:10:50 +0000 (21:10 +0200)]
test: drop the use of /bin/sh in various test services
This is not meant to be comprehensive, just the few cases where the /bin/sh -c wrapper
is obviously superfluous.
Zbigniew Jędrzejewski-Szmek [Sun, 25 Mar 2018 18:50:15 +0000 (20:50 +0200)]
systemd: do not require absolute paths in ExecStart
Absolute paths make everything simple and quick, but sometimes this requirement
can be annoying. A good example is calling 'test', which will be located in
/usr/bin/ or /bin depending on the distro. The need the provide the full path
makes it harder a portable unit file in such cases.
This patch uses a fixed search path (DEFAULT_PATH which was already used as the
default value of $PATH), and if a non-absolute file name is found, it is
immediately resolved to a full path using this search path when the unit is
loaded. After that, everything behaves as if an absolute path was specified. In
particular, the executable must exist when the unit is loaded.
Zbigniew Jędrzejewski-Szmek [Thu, 12 Apr 2018 13:58:45 +0000 (15:58 +0200)]
verify: use manager_load_startable_unit_or_warn() to load units for verification
This doesn't change the outcome:
(before)
/home/zbyszek/src/systemd/test/test-execute/exec-basic.service:6: Executable path specifies a directory: /usr/bin/test/
exec-basic.service: Failed to create exec-basic.service/start: Unit exec-basic.service is not loaded properly: Exec format error.
(after)
/home/zbyszek/src/systemd/test/test-execute/exec-basic.service:6: Executable path specifies a directory: /usr/bin/test/
Failed to load file /home/zbyszek/src/systemd/test/test-execute/exec-basic.service: Exec format error
(before)
masked.service: Failed to create masked.service/start: Unit masked.service is masked.
(after)
File /home/zbyszek/src/systemd/test/test-execute/masked.service is masked.
but the failure is immediate and the error messages are more direct.
Zbigniew Jędrzejewski-Szmek [Thu, 12 Apr 2018 13:51:39 +0000 (15:51 +0200)]
tests: use manager_load_startable_unit_or_warn() to load units
Doing manager_load_unit() followed by UNIT_VTABLE(unit)->start(unit) would
result in an assertion failure in ->start() if the unit failed to load
properly. Something like this is okey-ish is tests, since the test units are
not expected to fail to load, but the reason for failure is clearer if we
fail immediately.
Zbigniew Jędrzejewski-Szmek [Thu, 12 Apr 2018 13:13:14 +0000 (15:13 +0200)]
core/manager: split out function to verify that unit is loaded and not masked
No functional change.
Zbigniew Jędrzejewski-Szmek [Mon, 16 Apr 2018 08:59:41 +0000 (10:59 +0200)]
fuzz-unit-file: skip BOM (#8723)
Yet another false positive from ListenNetlink,
https://oss-fuzz.com/v2/testcase-detail/
4908210742886400/7694.
dmig [Sun, 15 Apr 2018 08:43:58 +0000 (15:43 +0700)]
Support for Dell Inspiron 5378/5379 WLAN key (#8715)
Peter A. Bigot [Mon, 9 Apr 2018 18:39:16 +0000 (13:39 -0500)]
time-wait-sync: use watchfile to coordinate with timesyncd
Systems that have an accurate real-time clock may have an initial
unsynchronized time that is close enough to the synchronized time that
the final adjustment doesn't trigger a waking "clock set" event. Have
timesyncd touch a file in its runtime directory as a secondary signal
for synchronization. Continue to support the timerfd-based trigger as a
sufficient condition when the watchfile is not present.
Closes issue #8683
Peter A. Bigot [Tue, 10 Apr 2018 16:05:25 +0000 (11:05 -0500)]
units: leave systemd-time-wait-sync disabled by default
Also mark its presence conditional on ENABLE_TIMESYNCD.
guixxx [Sat, 14 Apr 2018 13:15:19 +0000 (10:15 -0300)]
fix url for binfmt documentation (#8720)
this file went unnoticed in PR #6223
Giuseppe Scrivano [Sat, 14 Apr 2018 09:06:11 +0000 (11:06 +0200)]
src/core/dbus-cgroup.c: fix typo contoller -> controller (#8717)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Zbigniew Jędrzejewski-Szmek [Fri, 13 Apr 2018 12:45:51 +0000 (14:45 +0200)]
Merge pull request #8271 from poettering/unit-prefix-search
Search unit .d/ drop-in files also in all "dash prefixes" of a unit
Zbigniew Jędrzejewski-Szmek [Fri, 13 Apr 2018 10:10:17 +0000 (12:10 +0200)]
Merge pull request #8707 from poettering/copy-tweaks
tweaks to fd copying code
Lennart Poettering [Fri, 23 Feb 2018 19:42:57 +0000 (20:42 +0100)]
man: document the new dash truncation drop-in directories
Lennart Poettering [Wed, 21 Mar 2018 18:55:54 +0000 (19:55 +0100)]
test: add test for prefix unit loading
Lennart Poettering [Fri, 23 Feb 2018 11:32:23 +0000 (12:32 +0100)]
dropin: when looking for dropins for a unit, also look within "-" prefix unit dirs
This extends the logic by which we look for drop-ins for unit files when
loading them. Previously for a unit "foo-quux-bar.service" we'd look in
a directory "foo-quux-bar.service.d" accompanying it for extension
dropins. With this change we'll additionally look in:
"foo-quux-.service.d" and "foo-.service.d", i.e. we'll truncate the unit
name after every dash.
This is an alternative to templating for many services, as it permits
configuring defaults for sets of units that all use the same prefix in
the unit name. This is particularly useful in slice, mount and
automount units which reflect a hierarchy of concepts, as it permits
setting defaults for specific subsets of the tree. For example, in order
to provide every user with a memory of 1G it's now possible to do:
# mkdir -p /etc/systemd/system/user-.slice.d
# cat > /etc/systemd/system/user-.slice.d/50-memory.conf << EOF
[Slice]
MemoryMax=1G
EOF
# systemctl daemon-reload
This makes use of the fact that every user gets his own slice unit when
logging in, named "user-$UID.slice".
This doesn't precisely provide what is requested in #2556, but it does
provide equivalent functionality.
Fixes: #2556
See: #3504 #7599
Lennart Poettering [Fri, 23 Feb 2018 11:31:30 +0000 (12:31 +0100)]
systemctl: fix indentation in output of "systemcl status" if there are multiple drop-in dirs
We were a few whitespace off. Let's fix that.
Lennart Poettering [Fri, 23 Feb 2018 11:30:14 +0000 (12:30 +0100)]
core: minor coding style changes
Lennart Poettering [Wed, 21 Mar 2018 18:08:46 +0000 (19:08 +0100)]
dropin: don't fully suppress logging about ENAMETOOLONG. Just downgrade to LOG_DEBUG
Lennart Poettering [Fri, 23 Feb 2018 11:20:14 +0000 (12:20 +0100)]
load-dropin: rename variable
We are converting the unit name into its template, hence name the
variable that way, instead of the misleading 'prefix'.
Lennart Poettering [Thu, 22 Feb 2018 17:24:57 +0000 (18:24 +0100)]
unit-name: add new unit_name_build_from_type() helper
The new helper is much like unit_name_build() but expects a UnitType
value instead of a suffix.
Lennart Poettering [Fri, 23 Mar 2018 17:27:31 +0000 (18:27 +0100)]
copy: rearrange flags field definition
Let's use the usual 1U << 0,1,2,3,4 spelling for definiting flags enums.
Lennart Poettering [Fri, 23 Mar 2018 17:26:58 +0000 (18:26 +0100)]
copy: reduce number of checks
We check max_bytes twice here, let's simplify that, and reduce one level
of indentation.
Lennart Poettering [Fri, 23 Mar 2018 17:24:07 +0000 (18:24 +0100)]
copy: drop _unlikely_() that isn't obviously the case
If a tool only invokes copy_bytes() a single time the _unlikely_() will always be
wrong, and is hence not useful. Let's drop it and let the compiler
figure our what to do, instead of misleading it.
Also, some coding style imprvoements.
Lennart Poettering [Fri, 23 Mar 2018 16:44:15 +0000 (17:44 +0100)]
copy: hide in copy_bytes() the strange way splice() handles O_NONBLOCK
splice() ignores O_NONBLOCK on pipes but not on other fds. Let's handle
that properly, and query O_ONBLOCK manually in that case, ensuring
systematic behaviour in either case.
Lennart Poettering [Fri, 23 Mar 2018 15:41:42 +0000 (16:41 +0100)]
copy: extend copy_bytes() a bit
Optionally, when we copy between fds with simple read/write, let's
return any remaining data we already read into the buffer if write
fails. This is useful to allow callers to use the read data otherwise,
perhaps implementing a different fallback for copying.
Lennart Poettering [Fri, 23 Mar 2018 15:36:56 +0000 (16:36 +0100)]
copy: tweak reflink logic in copy_bytes() a bit
Let's use btrfs_clone_range() if partial copies are desired. And use
btrfs_reflink() only for full-file reflinks.
Lennart Poettering [Fri, 9 Mar 2018 21:44:47 +0000 (22:44 +0100)]
copy: add brief comment to copy_bytes() explaining its return values
Zbigniew Jędrzejewski-Szmek [Thu, 12 Apr 2018 20:21:15 +0000 (22:21 +0200)]
Merge pull request #8710 from poettering/triviailities-yeah-yeah
some trivial additions and fixes
Leonard [Thu, 12 Apr 2018 19:31:19 +0000 (21:31 +0200)]
ISO-C compatibility: Remove empty initializer (#8713)
ISO-C doesn't allow empty initializers, so replace it by explicitly
initializing to zero.
Also add braces because x is a union and we initialize a subobject, so
a compiler might warn about suggesting braces. Shut that up.
Zbigniew Jędrzejewski-Szmek [Thu, 12 Apr 2018 14:16:19 +0000 (16:16 +0200)]
test-execute/exec-specifier.service: fix quoting
The lines would cause the whole service to fail to be loaded.
Lennart Poettering [Wed, 11 Apr 2018 19:36:52 +0000 (21:36 +0200)]
macro: don't rely on C's downgrade-to-bool feature for numeric comparisons
Lennart Poettering [Mon, 9 Apr 2018 17:45:04 +0000 (19:45 +0200)]
install: minor enum beautifications
Lennart Poettering [Fri, 6 Apr 2018 16:57:48 +0000 (18:57 +0200)]
update TODO
Lennart Poettering [Fri, 6 Apr 2018 16:57:36 +0000 (18:57 +0200)]
importd: ensure we don't mishandle a NULL string
Lennart Poettering [Thu, 5 Apr 2018 16:00:39 +0000 (18:00 +0200)]
path-util: document a few other special cases for last_path_component()
Lennart Poettering [Tue, 27 Mar 2018 13:01:02 +0000 (15:01 +0200)]
process-util: add TAKE_PID(), similar to TAKE_PTR/TAKE_FD, but for child process PIDs
Lennart Poettering [Tue, 27 Mar 2018 12:56:29 +0000 (14:56 +0200)]
util: introduce typesafe_qsort(), a typesafe version of qsort()/qsort_safe()
It does two things:
1. It derives the element size from the array argument type
2. It derives the right type for the function from the array argument
type
Using this macro call should make the invocations of qsort() quite a bit
safer.
Lennart Poettering [Wed, 11 Apr 2018 08:26:27 +0000 (10:26 +0200)]
Merge pull request #8700 from keszybz/hibernation
Various improvements related to hibernation
Zbigniew Jędrzejewski-Szmek [Wed, 11 Apr 2018 07:27:32 +0000 (09:27 +0200)]
shared/sleep-config: rename misnamed function
Zbigniew Jędrzejewski-Szmek [Wed, 11 Apr 2018 06:51:06 +0000 (08:51 +0200)]
shared/sleep-config: return a custom message when not enough swap for hibernation
$ sudo swapoff -av
swapoff /dev/vda4
$ sudo systemctl hibernate
Failed to hibernate system via logind: Not enough swap space for hibernation
Fixes #6729.
Zbigniew Jędrzejewski-Szmek [Tue, 10 Apr 2018 11:15:00 +0000 (13:15 +0200)]
logind: refuse operations if the target unit is masked or unavailable
If hibernate.target is masked, and systemctl hibernate is invoked, havoc ensues.
logind starts the hibernation operation, but then doesn't go through with it;
gnome-shell segfaults. Let's be nice to the user and refuse doing anything in
that case.
$ sudo systemctl mask hibernate.target
$ busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager CanHibernate
s "no"
$ sudo systemctl hibernate
Failed to hibernate system via logind: Access denied
Failed to start hibernate.target: Unit hibernate.target is masked.
https://bugzilla.redhat.com/show_bug.cgi?id=1468003#c4
Zbigniew Jędrzejewski-Szmek [Tue, 10 Apr 2018 10:35:36 +0000 (12:35 +0200)]
Move utility function to query unit state from systemctl to shared/
Zbigniew Jędrzejewski-Szmek [Tue, 10 Apr 2018 09:39:14 +0000 (11:39 +0200)]
shared/sleep-fix: fix check if s-then-h is possible
can_sleep() returns 0 if the operation is impossible, but
the code assumed that negative is returned in that case,
in effect reporting s2h was possible even if hibernation or
suspend were not possible.
Zbigniew Jędrzejewski-Szmek [Tue, 10 Apr 2018 09:23:46 +0000 (11:23 +0200)]
shared/sleep-config: get rid of explicit allocation size calculation
Evgeny Vereshchagin [Tue, 10 Apr 2018 19:10:52 +0000 (22:10 +0300)]
hwdb: drop a space (#8701)
This should make `parse_hwdb.py` and the CI happy again.
Lennart Poettering [Tue, 10 Apr 2018 12:53:31 +0000 (14:53 +0200)]
Merge pull request #8676 from keszybz/drop-license-boilerplate
Drop license boilerplate
Zbigniew Jędrzejewski-Szmek [Tue, 10 Apr 2018 07:53:17 +0000 (09:53 +0200)]
Merge pull request #8406 from dell/hibernate-disk-offset
Add support for setting a disk offset when hibernating
emelenas [Mon, 9 Apr 2018 22:15:25 +0000 (00:15 +0200)]
Add override axis for Toshiba Satellite R830 (#8694)
Incorrect range and resolution for the touchpad at a Toshiba Satellite R830 reported by kernel. After running
$ sudo touchpad-edge-detector 85x50 /dev/input/event4
the new axis overrides are as follows
#Toshiba Satellite R830
evdev:name:SynPS/2 Synaptics TouchPad:dmi:svnTOSHIBA:pnSATELLITER830
EVDEV_ABS_00=1238:5785:53
EVDEV_ABS_01=1045:4826:76
EVDEV_ABS_35=1238:5785:53
EVDEV_ABS_36=1045:4826:76
Those overrides have been tested to work.
Stephen Hemminger [Mon, 9 Apr 2018 20:25:08 +0000 (13:25 -0700)]
hwdb: add support for VMBUS guids (#8677)
This addresses missing feature on #8677
Devices in Hyper-V/Azure exist on vmbus and are identified by
UUID value. This patch adds a hardware table so that udevadm
can report properties. I chose names are based on the values
reported in Window Device Manager (for consistency).
The table includes several devices that are not used by Linux
but are present and ignored.
For example:
$ udevadm info -q property /sys/bus/vmbus/devices/
58f75a6d-d949-4320-99e1-
a2a2576d581c
DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/
58f75a6d-d949-4320-99e1-
a2a2576d581c
DRIVER=hid_hyperv
ID_MODEL_FROM_DATABASE=Microsoft Hyper-V Mouse
MODALIAS=vmbus:
9eb6a8cf4a5bc04cb98b8ba1a1f3f95a
SUBSYSTEM=vmbus
USEC_INITIALIZED=
11076966
Or with updated kernel the driverctl script.
$ driverctl -b vmbus -v list-devices
1eccfd72-4b41-45ef-b73a-
4a6e44c12924 hv_balloon (Microsoft Hyper-V Dynamic Memory)
242ff919-07db-4180-9c2e-
b86cb68c8c55 hv_util (Microsoft Hyper-V Data Exchange)
2450ee40-33bf-4fbd-892e-
9fb06e9214cf hv_util (Microsoft Hyper-V Backup/Restore)
2dd1ce17-079e-403c-b352-
a1921ee207ee hv_util (Microsoft Hyper-V Time Sync)
4487b255-b88c-403f-bb51-
d1f69cf17f87 (none) (Microsoft Hyper-V Virtual Machine Activation)
53557f8e-057d-425b-9265-
01c0fd7e273e hv_netvsc (Microsoft Hyper-V Network Adapter)
5620e0c7-8062-4dce-aeb7-
520c7ef76171 hyperv_fb (Microsoft Hyper-V Video)
58f75a6d-d949-4320-99e1-
a2a2576d581c hid_hyperv (Microsoft Hyper-V Mouse)
849a776e-8120-4e4a-9a36-
7e3d95ac75b3 hv_netvsc (Microsoft Hyper-V Network Adapter)
99221fa0-24ad-11e2-be98-
001aa01bbf6e (none) (Microsoft Hyper-V Remote Desktop Control)
b2f44faf-2a29-42ba-91b2-
f13fd30a2d4b hv_storvsc (Microsoft Hyper-V SCSI Controller)
b6650ff7-33bc-4840-8048-
e0676786f393 hv_util (Microsoft Hyper-V Guest Shutdown)
d34b2567-b9b6-42b9-8778-
0a4ec0b955bf hyperv_keyboard (Microsoft Hyper-V Keyboard)
f5bee29c-1741-4aad-a4c2-
8fdedb46dcc2 (none) (Microsoft Hyper-V Remote Desktop Virtualization)
fd149e91-82e0-4a7d-afa6-
2a4166cbd7c0 hv_util (Microsoft Hyper-V Heartbeat)
Mario Limonciello [Thu, 29 Mar 2018 13:56:23 +0000 (08:56 -0500)]
sleep: Move the error level debugging for write_mode and write_state
This makes it more consistent with other code used in the file.
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Mario Limonciello [Thu, 8 Mar 2018 08:41:50 +0000 (02:41 -0600)]
sleep: Add support for setting a disk offset when hibernating
The Linux kernel is adding support for configuring the offset
into a disk. This allows swapfiles to be more usable as users
will no longer need to set the offset on their kernel command
line.
Use this API in systemd when hibernating as well.
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Lennart Poettering [Mon, 9 Apr 2018 09:32:51 +0000 (11:32 +0200)]
Merge pull request #8681 from keszybz/assorted-style-fixes
Assorted style fixes
Zbigniew Jędrzejewski-Szmek [Sun, 8 Apr 2018 06:12:18 +0000 (08:12 +0200)]
systemctl: pass BUS_MAP_STRDUP when needed (#8682)
This fixes an assert in "systemctl list-dependencies".
Follow-up for
a7e4861c7471bfe563078d11acbcecbf2d755462.
Zbigniew Jędrzejewski-Szmek [Sat, 7 Apr 2018 17:19:49 +0000 (19:19 +0200)]
time-sync-wait: trivial style fixes
Zbigniew Jędrzejewski-Szmek [Sat, 7 Apr 2018 17:14:37 +0000 (19:14 +0200)]
sd-event: use _cleanup_ to manage temporary references
Zbigniew Jędrzejewski-Szmek [Sat, 7 Apr 2018 16:43:47 +0000 (18:43 +0200)]
analyze: give a hint what is it means that boot is still active
$ build/systemd-analyze time
Bootup is not yet finished (org.freedesktop.systemd1.Manager.FinishTimestampMonotonic=0).
Please try again later.
Hint: Use 'systemctl list-jobs' to see active jobs
Zbigniew Jędrzejewski-Szmek [Wed, 4 Apr 2018 12:36:56 +0000 (14:36 +0200)]
core: minor comment update
Zbigniew Jędrzejewski-Szmek [Wed, 4 Apr 2018 07:05:56 +0000 (09:05 +0200)]
dissect: drop unnecessary parenthesis
Guillem Jover [Sat, 7 Apr 2018 18:02:20 +0000 (20:02 +0200)]
analyze: Do no require a full d-bus bus for the plot command (#8539)
The plot command requires a full d-bus bus to fetch the host
information, which seems rather optional, and having a running dbus
daemon is not always desirable. So instead, we try to acquire a full
bus, and if that fails we acquire the systemd bus, in which case we
omit the host information from the output.
We refactor acquire_bus() into two new functions which in addition
makes the call sites clearer.
Martin Wilck [Sat, 7 Apr 2018 15:33:48 +0000 (17:33 +0200)]
systemd-udevd: limit children-max by available memory (#8668)
Udev workers consume typically 50-100MiB virtual memory.
On systems with lots of CPUs and relatively low memory, that may
easily cause workers to be OOM-killed.
This patch limits the number of workers to 8 per GiB memory.
But don't let the limit drop below the smallest value we had
without this patch (8 + 1 * 2 = 10); on small systems, udev's
memory footprint is likely lower.
Brian J. Murrell [Sat, 7 Apr 2018 15:12:26 +0000 (11:12 -0400)]
Clarify checker/helper in systemd-fsck@.service manpage (#8674)
Clarify the helper/checker terminology in the systemd-fsck@.service manpage to
make the description more clear about what is responsible for deciding if a filesystem
needs checking.
Zbigniew Jędrzejewski-Szmek [Fri, 6 Apr 2018 17:02:13 +0000 (19:02 +0200)]
src/network: add missing SPDX identifiers
Zbigniew Jędrzejewski-Szmek [Fri, 6 Apr 2018 16:58:55 +0000 (18:58 +0200)]
tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.
I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
Zbigniew Jędrzejewski-Szmek [Fri, 6 Apr 2018 09:36:17 +0000 (11:36 +0200)]
fuzz-unit-file: allow a space between variable name and "=" (#8670)
The parser allows that, so the check when to skip needs this too.
https://oss-fuzz.com/v2/issue/
5106486364602368/7422
Zbigniew Jędrzejewski-Szmek [Fri, 6 Apr 2018 08:14:25 +0000 (10:14 +0200)]
Merge pull request #8663 from poettering/dissect-tighten
Small fixes for image dissection code.
Yu Watanabe [Fri, 6 Apr 2018 06:45:13 +0000 (15:45 +0900)]
core/device: remove unnecessary check (#8661)
Follow-up for
0dfb0a0abd98f8726a39f26e4d737f47ec0fd53b.
Philip Sequeira [Thu, 5 Apr 2018 14:04:27 +0000 (14:04 +0000)]
nspawn: wait for network namespace creation before interface setup (#8633)
Otherwise, network interfaces can be "moved" into the container's
namespace while it's still the same as the host namespace, in which case
e.g. host0 for a veth ends up on the host side instead of inside the
container.
Regression introduced in
0441378080489e4ab6704cd0a2d78cb1ceaca899.
Fixes #8599.
Zbigniew Jędrzejewski-Szmek [Thu, 5 Apr 2018 11:20:38 +0000 (13:20 +0200)]
Merge pull request #8662 from poettering/rfkill-enxio
handle ENODEV and ENXIO gracefully in rfkill
Lennart Poettering [Thu, 5 Apr 2018 11:15:43 +0000 (13:15 +0200)]
dissect: when pulling metadata from an image, don't bother with /home or ESP
When we try to read meta-data from an image, don't bother with mounting
/home or the ESP, as that's not where the metadata is. This not only
speeds things up a bit, but also has the benefit that setups where an
unencrypted root is mixed with an encrypted /home (which I have on one
of my own systems) won't result in errors that the crypto key is needed.
Lennart Poettering [Thu, 5 Apr 2018 11:07:31 +0000 (13:07 +0200)]
update TODO
David Tardon [Thu, 5 Apr 2018 11:06:59 +0000 (13:06 +0200)]
journald: bump rate limits (#8660)
Apparently, it is quite common to hit a problem, where systemd-journald
would drop messages because service is logging too fast.
Lennart Poettering [Thu, 5 Apr 2018 11:03:37 +0000 (13:03 +0200)]
dissect: tighten block device checks a bit
This extends on #8609, and makes two changes:
1. We'll now explicitly check that the child devices of a block device
we are interested in (i.e. the partitions) are block devices themselves.
On newer kernels the mmc rpmb stuff is actually exposed as char rather
than block device as before, and they probably should have been that in
the first place. By adding this check we'll hence filter out these weird
devices through a second rule too, that hopefully makes things a bit
more future-proof, should more devices like this be added eventually,
or other subsystems do a similar thing.
2. When counting partitions we'll now also check the devnum of the
device being non-null, which we already do when matching up the devices
in the second iteration. This should make things more robust, and
prevent other kinds of miscounting, which after all was the main
issue #8609 fixed.
Lennart Poettering [Thu, 5 Apr 2018 10:43:08 +0000 (12:43 +0200)]
rfkill: treat ENXIO/ENODEV the same way as ENOENT
If an rfkill device disappears between the time we get notified about
the existance and we fully opened it we might get ENXIO or ENODEV (i.e.
the two kinds of "device not found" errors, which are typically
generated when for example a device node has no actual backing device
behind it). let's handle that the same way as ENOENT, and downgrade the
log message to LOG_DEBUG.
Fixes: #8586
Lennart Poettering [Thu, 5 Apr 2018 10:42:47 +0000 (12:42 +0200)]
rfkill: use our usual style for writing destructors
Let's accept NULL values gracefully, and let's return NULL.
Lennart Poettering [Thu, 5 Apr 2018 09:54:02 +0000 (11:54 +0200)]
Merge pull request #8617 from keszybz/tmpfiles-relax
Do not exit with error when systemd-tmpfiles --boot fails
Lennart Poettering [Thu, 5 Apr 2018 08:19:12 +0000 (10:19 +0200)]
Merge pull request #8656 from yuwata/random-fixes
use TAKE_PTR() and TAKE_FD() macros, and small fixes
Zbigniew Jędrzejewski-Szmek [Thu, 29 Mar 2018 14:37:21 +0000 (16:37 +0200)]
tmpfiles: ignore "operational" errors during setup
We still get the errors logged, but we don't fail the service. This
is better for users because rerunning tmpfiles-setup.service a second
time is dangerous (c.f.
cd9f5b68ce08375eb1d68a4ddaa7a24a5092d7ba).
Note that this only touches sd-tmpfiles-setup.service and
sd-tmpfiles-setup-dev.service. sd-tmpfiles-clean.service is as before.
https://bugzilla.redhat.com/show_bug.cgi?id=1539341
Zbigniew Jędrzejewski-Szmek [Thu, 29 Mar 2018 14:19:33 +0000 (16:19 +0200)]
tmpfiles: add a new return code for "operational failure" when processing
Things can fail, and we have no control over it:
- file system issues (immutable bits, file system errors, MAC refusals, etc)
- kernel refusing certain arguments when writing to /proc/sys or /sys
Let's add a new code for the case where we parsed configuration but failed
to execute it because of external errors.
Yu Watanabe [Thu, 5 Apr 2018 05:24:59 +0000 (14:24 +0900)]
core/device: trivial simplification
Yu Watanabe [Thu, 5 Apr 2018 05:26:26 +0000 (14:26 +0900)]
tree-wide: use TAKE_PTR() and TAKE_FD() macros
Yu Watanabe [Wed, 4 Apr 2018 15:33:22 +0000 (00:33 +0900)]
network: fix typo in log message
Yu Watanabe [Tue, 3 Apr 2018 07:19:25 +0000 (16:19 +0900)]
meson: sort source files