]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoman: add more explanation about options for "udevadm test" 11519/head
Yu Watanabe [Tue, 22 Jan 2019 06:05:55 +0000 (15:05 +0900)] 
man: add more explanation about options for "udevadm test"

Closes #2476.

5 years agoudevadm info: make --export-prefix imply --export
Yu Watanabe [Tue, 22 Jan 2019 06:00:33 +0000 (15:00 +0900)] 
udevadm info: make --export-prefix imply --export

Setting --export without --export-prefix is meaningless.

5 years agowait-online: do not fail if we receive invalid messages
Yu Watanabe [Fri, 18 Jan 2019 22:59:17 +0000 (07:59 +0900)] 
wait-online: do not fail if we receive invalid messages

Fixes #11486.

5 years agonetwork: unset Network::manager when loading .network file fails
Yu Watanabe [Fri, 18 Jan 2019 03:55:15 +0000 (12:55 +0900)] 
network: unset Network::manager when loading .network file fails

Otherwise, LIST_REMOVE() in network_free() fails.

This fixes the following assertion:
```
systemd-networkd[2595]: Bus bus-api-network: changing state UNSET → OPENING
systemd-networkd[2595]: Bus bus-api-network: changing state OPENING → AUTHENTICATING
systemd-networkd[2595]: timestamp of '/etc/systemd/network' changed
systemd-networkd[2595]: /etc/systemd/network/10-hoge.network:1: Invalid section header '[Network]Address=192.168.0.1'
systemd-networkd[2595]: /etc/systemd/network/10-hoge.network:1: Failed to parse file: Bad message
systemd-networkd[2595]: Assertion '*_head == _item' failed at ../../home/watanabe/git/systemd/src/network/networkd-network.c:378, function network_free(). Aborting.
valgrind[2595]: ==2595==
valgrind[2595]: ==2595== Process terminating with default action of signal 6 (SIGABRT): dumping core
valgrind[2595]: ==2595==    at 0x4BCA53F: raise (in /usr/lib64/libc-2.28.so)
valgrind[2595]: ==2595==    by 0x4BB4894: abort (in /usr/lib64/libc-2.28.so)
valgrind[2595]: ==2595==    by 0x4955F09: log_assert_failed_realm (log.c:795)
valgrind[2595]: ==2595==    by 0x417101: network_free (networkd-network.c:378)
valgrind[2595]: ==2595==    by 0x415E99: network_freep (networkd-network.h:282)
valgrind[2595]: ==2595==    by 0x416AB2: network_load_one (networkd-network.c:101)
valgrind[2595]: ==2595==    by 0x416C39: network_load (networkd-network.c:293)
valgrind[2595]: ==2595==    by 0x414031: manager_load_config (networkd-manager.c:1502)
valgrind[2595]: ==2595==    by 0x40B258: run (networkd.c:82)
valgrind[2595]: ==2595==    by 0x40B74A: main (networkd.c:117)
valgrind[2595]: ==2595==
valgrind[2595]: ==2595== HEAP SUMMARY:
valgrind[2595]: ==2595==     in use at exit: 32,621 bytes in 201 blocks
valgrind[2595]: ==2595==   total heap usage: 746 allocs, 545 frees, 241,027 bytes allocated
valgrind[2595]: ==2595==
valgrind[2595]: ==2595== LEAK SUMMARY:
valgrind[2595]: ==2595==    definitely lost: 0 bytes in 0 blocks
valgrind[2595]: ==2595==    indirectly lost: 0 bytes in 0 blocks
valgrind[2595]: ==2595==      possibly lost: 0 bytes in 0 blocks
valgrind[2595]: ==2595==    still reachable: 32,621 bytes in 201 blocks
valgrind[2595]: ==2595==         suppressed: 0 bytes in 0 blocks
valgrind[2595]: ==2595== Reachable blocks (those to which a pointer was found) are not shown.
valgrind[2595]: ==2595== To see them, rerun with: --leak-check=full --show-leak-kinds=all
valgrind[2595]: ==2595==
valgrind[2595]: ==2595== For counts of detected and suppressed errors, rerun with: -v
valgrind[2595]: ==2595== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
systemd-coredump[2600]: Process 2595 (memcheck-amd64-) of user 192 dumped core.
```

5 years agoman: mention that 'udevadm control --exit' restarts systemd-udevd.service
Yu Watanabe [Wed, 16 Jan 2019 22:25:14 +0000 (07:25 +0900)] 
man: mention that 'udevadm control --exit' restarts systemd-udevd.service

Closes #1802.

5 years agotest-process-util: do not assume PID 1 has UID=0
Mike Gilbert [Sun, 20 Jan 2019 16:32:45 +0000 (11:32 -0500)] 
test-process-util: do not assume PID 1 has UID=0

Gentoo's Portage package manager uses a PID namespace for process
isolation and cleanup. In this namespace, PID 1 has UID=250 (portage).

Bug: https://bugs.gentoo.org/674458

5 years agoEnable some more debug logging for transaction building
Jonathon Kowalski [Thu, 17 Jan 2019 18:28:20 +0000 (18:28 +0000)] 
Enable some more debug logging for transaction building

5 years agoDocument weaknesses with MDWE and suggest hardening
Topi Miettinen [Fri, 18 Jan 2019 21:32:28 +0000 (23:32 +0200)] 
Document weaknesses with MDWE and suggest hardening

Closes #11473

5 years agotest: mark plymouth as optional dependency
Frantisek Sumsal [Fri, 18 Jan 2019 19:49:29 +0000 (20:49 +0100)] 
test: mark plymouth as optional dependency

rescue.service pulls in /bin/plymouth, which doesn't exist on some
distributions (e.g. Arch Linux). Let's mark it as optional, as it's not
even required by the referencing unit and causes unwanted fails in the
integration testsuite.

5 years agoNEWS: add section about backslashes in EnvironmentFile
Louis Taylor [Fri, 18 Jan 2019 19:40:52 +0000 (19:40 +0000)] 
NEWS: add section about backslashes in EnvironmentFile

As a follow-up from #11427.

5 years agomeson: bump timeout for test-udev to 180s
Frantisek Sumsal [Fri, 18 Jan 2019 21:32:42 +0000 (22:32 +0100)] 
meson: bump timeout for test-udev to 180s

On some (mainly virtual) machines the last test takes more than 30
seconds, which causes unnecessary fails, as the test itself is working
properly.

5 years agoRevert "hwdb: Fix secondary backslash on MSI GS65 laptop"
Zbigniew Jędrzejewski-Szmek [Mon, 21 Jan 2019 07:21:27 +0000 (08:21 +0100)] 
Revert "hwdb: Fix secondary backslash on MSI GS65 laptop"

This reverts commit e05c8b44622afe4256f3bb361cfb2c7db32fff8e.

The key in question is labeled as "|\" in the US version, and e.g. "<>" in
European version. In the US version there are two keys with the same label
and they are both mapped to the same keycode. Let's revert the patch, to unbreak
the non-US users.

US users should apply some local work-around, possibly simply keeping the
contents of the patch as a file in hwdb.d/.

5 years agomkosi: add qrencode to arch package list
Louis Taylor [Fri, 18 Jan 2019 21:41:15 +0000 (21:41 +0000)] 
mkosi: add qrencode to arch package list

Before adding this, I got errors about the library being missing such
as:

        journalctl: error while loading shared libraries: libqrencode.so.4: cannot open shared object file: No such file or directory

Fixes #7367.

5 years agoMerge pull request #11424 from yuwata/fix-11420
Lennart Poettering [Fri, 18 Jan 2019 16:58:20 +0000 (17:58 +0100)] 
Merge pull request #11424 from yuwata/fix-11420

timedate: refuse setting time when unit is in 'activating' or friends

5 years agoMerge pull request #11349 from yuwata/udevadm-control-ping
Zbigniew Jędrzejewski-Szmek [Fri, 18 Jan 2019 16:41:00 +0000 (17:41 +0100)] 
Merge pull request #11349 from yuwata/udevadm-control-ping

Add 'udevadm control --ping'

5 years agobash-completion: udevadm: support recently added options 11349/head
Yu Watanabe [Sat, 12 Jan 2019 23:14:17 +0000 (08:14 +0900)] 
bash-completion: udevadm: support recently added options

5 years agoudevd: rename control command SYNC -> PING in log message
Yu Watanabe [Sat, 12 Jan 2019 23:12:24 +0000 (08:12 +0900)] 
udevd: rename control command SYNC -> PING in log message

5 years agoudevadm: add --wait-daemon option to 'trigger' command
Yu Watanabe [Sat, 12 Jan 2019 23:10:12 +0000 (08:10 +0900)] 
udevadm: add --wait-daemon option to 'trigger' command

5 years agoudevadm: add --ping option to 'control' command
Yu Watanabe [Sat, 12 Jan 2019 22:44:38 +0000 (07:44 +0900)] 
udevadm: add --ping option to 'control' command

This exposes `udev_ctrl_send_ping()`.

5 years agoNEWS: retroactively describe .include deprecation
Zbigniew Jędrzejewski-Szmek [Fri, 18 Jan 2019 12:45:10 +0000 (13:45 +0100)] 
NEWS: retroactively describe .include deprecation

Closes #11479.

5 years agosd-event: introduce event_free_signal_data()
Yu Watanabe [Fri, 18 Jan 2019 06:16:22 +0000 (15:16 +0900)] 
sd-event: introduce event_free_signal_data()

We already have event_free_inotify_data() and event_free_inode_data().

5 years agoMerge pull request #11450 from keszybz/drop-nolegacy
Lennart Poettering [Fri, 18 Jan 2019 12:51:15 +0000 (13:51 +0100)] 
Merge pull request #11450 from keszybz/drop-nolegacy

Drop unused NOLEGACY define

5 years agoChange job mode of manager triggered restarts to JOB_REPLACE
Jonathon Kowalski [Thu, 17 Jan 2019 17:08:00 +0000 (17:08 +0000)] 
Change job mode of manager triggered restarts to JOB_REPLACE

Fixes: #11305
Fixes: #3260
Related: #11456

So, here's what happens in the described scenario in #11305. A unit goes
down, and that triggeres stop jobs for the other two units as they were
bound to it. Now, the timer for manager triggered restarts kicks in and
schedules a restart job with the JOB_FAIL job mode. This means there is
a stop job installed on those units, and now due to them being bound to
us they also get a restart job enqueued. This however is a conflicts, as
neither stop can merge into restart, nor restart into stop. However,
restart should be able to replace stop in any case. If the stop
procedure is ongoing, it can cancel the stop job, install itself, and
then after reaching dead finish and convert itself to a start job.
However, if we increase the timer, then it can always take those units
from inactive -> auto-restart.

We change the job mode to JOB_REPLACE so the restart job cancels the
stop job and installs itself.

Also, the original bug could be worked around by bumping RestartSec= to
avoid the conflicting.

This doesn't seem to be something that is going to break uses. That is
because for those who already had it working, there must have never been
conflicting jobs, as that would result in a desctructive transaction by
virtue of the job mode used.

After this change, the test case is able to work nicely without issues.

5 years agoMerge pull request #11427 from kragniz/10659-env-file-quotes
Lennart Poettering [Fri, 18 Jan 2019 12:50:15 +0000 (13:50 +0100)] 
Merge pull request #11427 from kragniz/10659-env-file-quotes

util-lib: follow shell syntax for escape in quotes

5 years agoAdd multiple initrd file support to kernel-install
Mike Auty [Thu, 17 Jan 2019 18:06:09 +0000 (18:06 +0000)] 
Add multiple initrd file support to kernel-install

Instead of having just a single INITRD field, add support for all
additional parameters being INITRD fields in order.

Signed-off-by: Mike Auty <mike.auty@gmail.com>
5 years agoadd hwdb rule for Bangho touchpad (#11475)
dcanuhe [Fri, 18 Jan 2019 12:49:30 +0000 (09:49 -0300)] 
add hwdb rule for Bangho touchpad (#11475)

add hwdb rule for Bangho touchpad

5 years agoMerge pull request #11465 from poettering/daemon-bus-flush
Lennart Poettering [Fri, 18 Jan 2019 12:48:52 +0000 (13:48 +0100)] 
Merge pull request #11465 from poettering/daemon-bus-flush

flush+close bus connections explicitly when our daemons go down

5 years agoMerge pull request #11449 from keszybz/udev-link-naming-again
Lennart Poettering [Thu, 17 Jan 2019 19:06:55 +0000 (20:06 +0100)] 
Merge pull request #11449 from keszybz/udev-link-naming-again

Make udev link re-renaming conditional

5 years agotree-wide: fix some trailing whitespace
Lennart Poettering [Thu, 17 Jan 2019 18:47:19 +0000 (19:47 +0100)] 
tree-wide: fix some trailing whitespace

@bl33pbl0p, please fix your editor

(Apparently you never configured the source tree? If you did, then the
git pre-commit hook would have been enabled which doesn't allow
commiting non-whitespace clean stuff...)

5 years agoMerge pull request #11378 from keszybz/export-dbus-address-conditionally
Lennart Poettering [Thu, 17 Jan 2019 17:36:01 +0000 (18:36 +0100)] 
Merge pull request #11378 from keszybz/export-dbus-address-conditionally

Export dbus address conditionally

5 years agoMerge pull request #11375 from daxtens/issue5882
Lennart Poettering [Thu, 17 Jan 2019 17:08:01 +0000 (18:08 +0100)] 
Merge pull request #11375 from daxtens/issue5882

network: Fix IPv6 PreferredSource routes

5 years agotools/choose-default-locale.sh: set shebang to /bin/sh
Jörg Thalheim [Mon, 14 Jan 2019 15:14:32 +0000 (15:14 +0000)] 
tools/choose-default-locale.sh: set shebang to /bin/sh

The script does not use any bash features.
On NixOS we have /bin/sh and /usr/bin/env for posix compatibility
but not /bin/bash as it is stored in our nix store.
With this change one can run the `meson configure` without patching
which greatly helps, when working on upstream contributions.

5 years agotree-wide: use '"' instead of '\"' 11427/head
Louis Taylor [Tue, 15 Jan 2019 18:51:31 +0000 (18:51 +0000)] 
tree-wide: use '"' instead of '\"'

The escape used previously was redundant and made things more confusing.

5 years agocore: shorten code by using new helper 11465/head
Lennart Poettering [Thu, 17 Jan 2019 15:10:58 +0000 (16:10 +0100)] 
core: shorten code by using new helper

5 years agotree-wide: whenever we allocate a new bus object, close it before dropping final ref
Lennart Poettering [Thu, 17 Jan 2019 15:07:22 +0000 (16:07 +0100)] 
tree-wide: whenever we allocate a new bus object, close it before dropping final ref

This doesn't really change much, but feels more correct to do, as it
ensures that all messages currently queued in the bus connections are
definitely unreffed and thus destryoing of the connection object will
follow immediately.

Strictly speaking this change is entirely unnecessary, since nothing
else could have acquired a ref to the connection and queued a message
in, however, now that we have the new sd_bus_close_unref() helper it
makes a lot of sense to use it here, to ensure that whatever happens
nothing that might have been queued fucks with us.

5 years agoinitctl: shorten and update code a bit
Lennart Poettering [Thu, 17 Jan 2019 14:54:37 +0000 (15:54 +0100)] 
initctl: shorten and update code a bit

5 years agotree-wide: make sure to flush/close all bus connections when our daemons exit
Lennart Poettering [Thu, 17 Jan 2019 14:53:15 +0000 (15:53 +0100)] 
tree-wide: make sure to flush/close all bus connections when our daemons exit

Let's make sure everything is written out ebfore we exit, so that no
messages keep our bus connections referenced.

Fixes: #11462
5 years agosd-bus: add sd_bus_close_unref() helper
Lennart Poettering [Thu, 17 Jan 2019 14:51:08 +0000 (15:51 +0100)] 
sd-bus: add sd_bus_close_unref() helper

It's similar to sd_bus_flush_close_unref() but doesn't do the flushing.
This is useful since this will still discnnect the connection properly
but not synchronously wait for the peer to take our messages.

Primary usecase is within _cleanup_() expressions where synchronously
waiting on the peer is not OK.

5 years agoutil-lib: follow shell syntax for escape in quotes
Louis Taylor [Mon, 14 Jan 2019 21:35:10 +0000 (21:35 +0000)] 
util-lib: follow shell syntax for escape in quotes

Fixes #10659.

This changes the behaviour of parsing environment files to more closely
follow POSIX shell standards.

This has the effect that these variables defined in a file:

    VAR1='\value'
    VAR2="\value"

Are now interpreted as `\value` instead of interpreting the `\`
character and interpreting them as `value`.

For more information about the behaviour followed, see:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02

5 years agoman: use <varname> and <option> instead of <literal> in systemd.link(5) 11449/head
Zbigniew Jędrzejewski-Szmek [Thu, 17 Jan 2019 12:53:00 +0000 (13:53 +0100)] 
man: use <varname> and <option> instead of <literal> in systemd.link(5)

This looks better and allows those terms to be indexed in systemd.directives.
In particular, <literal></literal> is dropped from around section names
([Match] and others) because the parens are distinctive enough on their own.
The same style is used in systemd.unit(5) and other pages that describe
sections.

5 years agoNEWS: describe the naming scheme updates
Zbigniew Jędrzejewski-Szmek [Wed, 16 Jan 2019 21:38:22 +0000 (22:38 +0100)] 
NEWS: describe the naming scheme updates

5 years agolink-config: default to "keep" policy if naming-scheme<=239 is used
Zbigniew Jędrzejewski-Szmek [Wed, 16 Jan 2019 13:53:49 +0000 (14:53 +0100)] 
link-config: default to "keep" policy if naming-scheme<=239 is used

This makes the new (>=240) behaviour conditional, restoring backwards compat, as least
as long as an old naming scheme is used.

5 years agoudev: move naming-scheme bits into their own file
Zbigniew Jędrzejewski-Szmek [Wed, 16 Jan 2019 13:47:56 +0000 (14:47 +0100)] 
udev: move naming-scheme bits into their own file

5 years agolink-config: add "keep" policy and use it by default
Zbigniew Jędrzejewski-Szmek [Wed, 16 Jan 2019 13:26:29 +0000 (14:26 +0100)] 
link-config: add "keep" policy and use it by default

If "keep" policy is specified, and the interface has a name that is
NET_NAME_USER or NET_NAME_RENAMED, we stop processing rules. "keep" should
probably be specified either first or last depending on the preference.

This partially reimplements 55b6530baacf4658a183b15b010a8cf3483fde08, in the
sense that if the "keep" policy is not specified, and if the interface has
a NamingPolicy, it will be renamed, even if it had a name previously.
So this breaks backwards compatibility in this case, but that's more in line
with what users expect.

Closes #9006.

5 years agohwdb: Add Huawei section and remap keys (#11406)
Ayman Bagabas [Thu, 17 Jan 2019 12:47:43 +0000 (07:47 -0500)] 
hwdb: Add Huawei section and remap keys (#11406)

hwdb: Add support for 'Huawei WMI hotkeys' driver

Since 'Huawei WMI hotkeys' driver finally got merged into kernel
[commit](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/platform/x86/huawei-wmi.c?id=bf4fb28c6e74495de9e1e4ad359cd2272ac12c53),
this remaps 'KEY_MICMUTE' to 'F20' to make the key work and disables
brightness keys on (MACH-WX9) since it's already supported by kernel.

5 years agoAdd note about transactions being genereated independently of a unit's state.
bl33pbl0p [Wed, 16 Jan 2019 20:53:42 +0000 (20:53 +0000)] 
Add note about transactions being genereated independently of a unit's state.

Meanwhile, change dead -> inactive as it is not a unit state.

5 years agoCODING_STYLE: fix grammar mistake
Chris Morin [Wed, 16 Jan 2019 21:04:30 +0000 (13:04 -0800)] 
CODING_STYLE: fix grammar mistake

5 years agocore: Fix -EOPNOTSUPP emergency action error string
Aaron Plattner [Wed, 16 Jan 2019 18:26:15 +0000 (10:26 -0800)] 
core: Fix -EOPNOTSUPP emergency action error string

The error string for operations that are not supported (e.g. "shutdown" for
user-defined units) should take two arguments, where the first one is the type
of action being defined (i.e. "FailureAction" vs. "SuccessAction") and the
second is the string that was invalid.

Currently, the code prints this:

 $ systemd-run --user --wait -p SuccessAction=poweroff true
 Failed to start transient service unit: EmergencyAction setting invalid for manager type: SuccessAction

Change the format string to instead print:

 $ systemd-run --user --wait -p SuccessAction=poweroff true
 Failed to start transient service unit: SuccessAction setting invalid for manager type: poweroff

5 years agocore: Fix return argument check for parse_emergency_action
Aaron Plattner [Wed, 16 Jan 2019 18:00:21 +0000 (10:00 -0800)] 
core: Fix return argument check for parse_emergency_action

This function returns 0 on success and a negative value on failure. On success,
it writes the parsed action to the address passed in its third argument.

`bus_set_transient_emergency_action` does this:

 r = parse_emergency_action(s, system, &v);
 if (v < 0)
     // handle failure

However, `v` is not updated if the function fails, and this should be checking
`r` instead of `v`.

The result of this is that if an invalid failure (or success) action is
specified, systemd ends up creating the unit anyway and then misbehaves if it
tries to run the failure action because the action value comes from
uninitialized stack data. In my case, this resulted in a failed assertion:

 Program received signal SIGABRT, Aborted.
 0x00007fe52cca0d7f in raise () from /snap/usr/lib/libc.so.6
 (gdb) bt
 #0  0x00007fe52cca0d7f in raise () from /snap/usr/lib/libc.so.6
 #1  0x00007fe52cc8b672 in abort () from /snap/usr/lib/libc.so.6
 #2  0x00007fe52d66f169 in log_assert_failed_realm (realm=LOG_REALM_SYSTEMD, text=0x56177ab8e000 "action < _EMERGENCY_ACTION_MAX", file=0x56177ab8dfb8 "../src/core/emergency-action.c", line=33, func=0x56177ab8e2b0 <__PRETTY_FUNCTION__.14207> "emergency_action") at ../src/basic/log.c:795
 #3  0x000056177aa98cf4 in emergency_action (m=0x56177c992cb0, action=2059118610, options=(unknown: 0), reboot_arg=0x0, exit_status=1, reason=0x7ffdd2df4290 "unit run-u0.service failed") at ../src/core/emergency-action.c:33
 #4  0x000056177ab2b739 in unit_notify (u=0x56177c9eb340, os=UNIT_ACTIVE, ns=UNIT_FAILED, flags=(unknown: 0)) at ../src/core/unit.c:2504
 #5  0x000056177aaf62ed in service_set_state (s=0x56177c9eb340, state=SERVICE_FAILED) at ../src/core/service.c:1104
 #6  0x000056177aaf8a29 in service_enter_dead (s=0x56177c9eb340, f=SERVICE_SUCCESS, allow_restart=true) at ../src/core/service.c:1712
 #7  0x000056177aaf9233 in service_enter_signal (s=0x56177c9eb340, state=SERVICE_FINAL_SIGKILL, f=SERVICE_SUCCESS) at ../src/core/service.c:1854
 #8  0x000056177aaf921b in service_enter_signal (s=0x56177c9eb340, state=SERVICE_FINAL_SIGTERM, f=SERVICE_SUCCESS) at ../src/core/service.c:1852
 #9  0x000056177aaf8eb3 in service_enter_stop_post (s=0x56177c9eb340, f=SERVICE_SUCCESS) at ../src/core/service.c:1788
 #10 0x000056177aaf91eb in service_enter_signal (s=0x56177c9eb340, state=SERVICE_STOP_SIGKILL, f=SERVICE_SUCCESS) at ../src/core/service.c:1850
 #11 0x000056177aaf91bc in service_enter_signal (s=0x56177c9eb340, state=SERVICE_STOP_SIGTERM, f=SERVICE_FAILURE_EXIT_CODE) at ../src/core/service.c:1848
 #12 0x000056177aaf9759 in service_enter_running (s=0x56177c9eb340, f=SERVICE_FAILURE_EXIT_CODE) at ../src/core/service.c:1941
 #13 0x000056177ab005b7 in service_sigchld_event (u=0x56177c9eb340, pid=112, code=1, status=1) at ../src/core/service.c:3296
 #14 0x000056177aad84b5 in manager_invoke_sigchld_event (m=0x56177c992cb0, u=0x56177c9eb340, si=0x7ffdd2df48f0) at ../src/core/manager.c:2444
 #15 0x000056177aad88df in manager_dispatch_sigchld (source=0x56177c994710, userdata=0x56177c992cb0) at ../src/core/manager.c:2508
 #16 0x00007fe52d72f807 in source_dispatch (s=0x56177c994710) at ../src/libsystemd/sd-event/sd-event.c:2846
 #17 0x00007fe52d730f7d in sd_event_dispatch (e=0x56177c993530) at ../src/libsystemd/sd-event/sd-event.c:3229
 #18 0x00007fe52d73142e in sd_event_run (e=0x56177c993530, timeout=18446744073709551615) at ../src/libsystemd/sd-event/sd-event.c:3286
 #19 0x000056177aad9f71 in manager_loop (m=0x56177c992cb0) at ../src/core/manager.c:2906
 #20 0x000056177aa7c876 in invoke_main_loop (m=0x56177c992cb0, ret_reexecute=0x7ffdd2df4bff, ret_retval=0x7ffdd2df4c04, ret_shutdown_verb=0x7ffdd2df4c58, ret_fds=0x7ffdd2df4c70, ret_switch_root_dir=0x7ffdd2df4c48, ret_switch_root_init=0x7ffdd2df4c50, ret_error_message=0x7ffdd2df4c60) at ../src/core/main.c:1792
 #21 0x000056177aa7f251 in main (argc=2, argv=0x7ffdd2df4e78) at ../src/core/main.c:2573

Fix this by checking the correct variable.

5 years agoethtool: Make sure advertise is actually set when autonegotiation is used
Jan Janssen [Tue, 15 Jan 2019 14:46:32 +0000 (15:46 +0100)] 
ethtool: Make sure advertise is actually set when autonegotiation is used

5 years agolink-config: unentangle the renaming logic and add logging
Zbigniew Jędrzejewski-Szmek [Wed, 16 Jan 2019 13:08:02 +0000 (14:08 +0100)] 
link-config: unentangle the renaming logic and add logging

What policy we dicide to use it rather important, but this bit of information
wasn't logged. Let's always do that.

The code was also written in a confusing way, which probably contributed to the
unintended effects of 55b6530baacf4658a183b15b010a8cf3483fde08 and other commits.
We would loop over all policies, and note if "kernel" was specified, and then
possibly unset the result at the end. Let's immediately log the result and cut
to the end if we can figure out the answer.

No functional change intended, except for the new log lines.
Using goto is not very elegant, but we can't use break because of the switch,
and there are multiple conditions to break the loop, so using goto is cleanest.

5 years agouser-util: remove unsed NOLEGACY define 11450/head
Zbigniew Jędrzejewski-Szmek [Tue, 15 Jan 2019 16:15:48 +0000 (17:15 +0100)] 
user-util: remove unsed NOLEGACY define

AFAICT, it was never hooked up to meson, so it'd only work if somebody manually
defined the flag. I think it's preferable to drop the ifdef: it removes only a
single access call to a fixed location, which is realy cheap. If poeple don't
want to make use of this, they should just not create the file. Making this
both compile-time optional and opt-in in the filesystem is unnecessary.

5 years agoDrop some unnecessary newlines
Zbigniew Jędrzejewski-Szmek [Tue, 15 Jan 2019 16:13:48 +0000 (17:13 +0100)] 
Drop some unnecessary newlines

5 years agoMerge pull request #11441 from poettering/foreach-string-rework
Zbigniew Jędrzejewski-Szmek [Wed, 16 Jan 2019 17:10:54 +0000 (18:10 +0100)] 
Merge pull request #11441 from poettering/foreach-string-rework

FOREACH_STRING() rework

5 years agoseccomp: drop mincore() from @system-service syscall filter group
Lennart Poettering [Wed, 16 Jan 2019 11:13:37 +0000 (12:13 +0100)] 
seccomp: drop mincore() from @system-service syscall filter group

Previously, this system call was included in @system-service since it is
a "getter" only, i.e. only queries information, and doesn't change
anything, and hence was considered not risky.

However, as it turns out, mincore() is actually security sensitive, see
the discussion here:

https://lwn.net/Articles/776034/

Hence, let's adjust the system call filter and drop mincore() from it.

This constitues a compatibility break to some level, however I presume
we can get away with this as the systemcall is pretty exotic. The fact
that it is pretty exotic is also reflected by the fact that the kernel
intends to majorly change behaviour of the system call soon (see the
linked LWN article)

5 years agolibsystemd-network: use xsprintf in one more place
Zbigniew Jędrzejewski-Szmek [Thu, 10 Jan 2019 15:13:06 +0000 (16:13 +0100)] 
libsystemd-network: use xsprintf in one more place

DECIMAL_STR_MAX includes space for NUL, so we don't need 2 here.

5 years agoudev: 'val' may be NULL, use strempty()
Yu Watanabe [Wed, 16 Jan 2019 04:02:04 +0000 (13:02 +0900)] 
udev: 'val' may be NULL, use strempty()

5 years agoman: Fix a typo in systemd.exec.xml
Philip Withnall [Wed, 16 Jan 2019 12:03:53 +0000 (12:03 +0000)] 
man: Fix a typo in systemd.exec.xml

Signed-off-by: Philip Withnall <withnall@endlessm.com>
5 years agoRevert "Always rename an interface to its name specified in config if no NamePolicy...
Zbigniew Jędrzejewski-Szmek [Wed, 16 Jan 2019 12:28:41 +0000 (13:28 +0100)] 
Revert "Always rename an interface to its name specified in config if no NamePolicy= is specified"

This reverts commit 55b6530baacf4658a183b15b010a8cf3483fde08.

This commit description says "Always rename an interface to its name specified
in config if no NamePolicy= is specified", but it does much more:
1. It completely changes the meaning of NamePolicy=kernel. Before, it meant that an interface
   with type==NAMEPOLICY_KERNEL would not be renamed. After, the kernel name only works as
   a fallback, if no policy matches.
2. The "if no NamePolicy= is specified" part is not true at all, the interface will be renamed
   according to the specified NamePolicy=.

After 55b6530baacf, the should_rename() function is named very misleadingly: it is only used
to mean "respect kernel predictable name if no naming policy matches".

Let's revert, and start with a clean slate. This fixes #11436.

5 years agoLog the job being merged
bl33pbl0p [Wed, 16 Jan 2019 00:03:22 +0000 (00:03 +0000)] 
Log the job being merged

Makes it easier to understand what was merged (and easier to realize why).

Example is a start job running, and another unit triggering a verify-active job. It is not clear what job was it that from baz.service that merged into the installed job for bar.service in the debug logs. This makes it useful when debugging issues.

Jan 15 11:45:58 jupiter systemd[1218]: baz.service: Trying to enqueue job baz.service/start/replace
Jan 15 11:45:58 jupiter systemd[1218]: baz.service: Installed new job baz.service/start as 498
Jan 15 11:45:58 jupiter systemd[1218]: bar.service: Merged into installed job bar.service/start as 497
Jan 15 11:45:58 jupiter systemd[1218]: baz.service: Enqueued job baz.service/start as 498

It becomes:
Jan 15 11:45:58 jupiter systemd[1218]: bar.service: Merged bar.service/verify-active into installed job bar.service/start as 497

5 years agostrv: rework FOREACH_STRING() macro 11441/head
Lennart Poettering [Tue, 15 Jan 2019 23:13:38 +0000 (00:13 +0100)] 
strv: rework FOREACH_STRING() macro

So it's apparently problematic that we use STRV_MAKE() (i.e. a compound
initializer) outside of the {} block we use it in (and that includes
outside of the ({}) block, too). Hence, let's rework the macro to not
need that.

This also makes the macro shorter, which is definitely a good and more
readable. Moreover, it will now complain if the iterator is a "char*"
instead of a "const char*", which is good too.

Fixes: #11394
5 years agotest,systemctl,nspawn: use "const char*" instead of "char*" as iterator for FOREACH_S...
Lennart Poettering [Tue, 15 Jan 2019 23:12:50 +0000 (00:12 +0100)] 
test,systemctl,nspawn: use "const char*" instead of "char*" as iterator for FOREACH_STRING()

The macro iterates through literal strings (i.e. constant strings),
hence it's more correct to have the iterator const too.

5 years agoEnable regular file and FIFO protection
Lucas Werkmeister [Tue, 15 Jan 2019 23:16:10 +0000 (00:16 +0100)] 
Enable regular file and FIFO protection

These sysctls were added in Linux 4.19 (torvalds/linux@30aba6656f), and
we should enable them just like we enable the older hardlink/symlink
protection since v199. Implements #11414.

5 years agotests: Add test for IPv6 source routing 11375/head
Daniel Axtens [Mon, 14 Jan 2019 14:15:15 +0000 (01:15 +1100)] 
tests: Add test for IPv6 source routing

The test is a bit messy because it must be done on a device that
enforces a tentative state for IPv6 addresses, and it appears
that the dummy device does not. So we use a bond instead.

Signed-off-by: Daniel Axtens <dja@axtens.net>
5 years agoInstall routes after addresses are ready
Daniel Axtens [Wed, 5 Dec 2018 10:49:35 +0000 (21:49 +1100)] 
Install routes after addresses are ready

If an IPv6 route is added with a source address that is still
tentative, the kernel will refuse to install it.

Previously, once we sent the messages to the kernel to add the
addresses, we would immediately proceed to add the routes. The
addresses would usually still be tentative at this point, so
adding static IPv6 routes was broken - see issue #5882.

Now, only begin to configure routes once the addresses are ready,
by restructuring the state machine, and tracking when addresses are
ready, not just added.

Fixes: #5882
Signed-off-by: Daniel Axtens <dja@axtens.net>
5 years agoFix omission in docs
Joost Heitbrink [Tue, 15 Jan 2019 20:27:08 +0000 (21:27 +0100)] 
Fix omission in docs

change "if is missing" to "if /etc/machine-id is missing".

5 years agoMerge pull request #11418 from yuwata/fix-11404
Zbigniew Jędrzejewski-Szmek [Tue, 15 Jan 2019 20:04:32 +0000 (21:04 +0100)] 
Merge pull request #11418 from yuwata/fix-11404

network: fix infinite loop in setting up wireguard

5 years agoMerge pull request #11345 from kirbyfan64/tmpfiles-c-empty
Zbigniew Jędrzejewski-Szmek [Tue, 15 Jan 2019 15:54:19 +0000 (16:54 +0100)] 
Merge pull request #11345 from kirbyfan64/tmpfiles-c-empty

tmpfiles: Make C still copy if the destination directory is empty

5 years agoMerge pull request #11428 from yuwata/network-issue-9130-v2
Zbigniew Jędrzejewski-Szmek [Tue, 15 Jan 2019 15:44:27 +0000 (16:44 +0100)] 
Merge pull request #11428 from yuwata/network-issue-9130-v2

network: wait for kernel to reply ipv6 peer address

5 years agoNEWS: typos
Zbigniew Jędrzejewski-Szmek [Tue, 15 Jan 2019 07:29:49 +0000 (08:29 +0100)] 
NEWS: typos

5 years agonetwork: make Link and NetDev always have the valid poiter to Manager
Yu Watanabe [Sun, 13 Jan 2019 15:30:37 +0000 (00:30 +0900)] 
network: make Link and NetDev always have the valid poiter to Manager

c4397d94c3d94909188d82e086ebedf5d3690569 introduces
link_detach_from_manager() and netdev_detach_from_manager(), and they
set Link::manager or NetDev::manager NULL.
But, at the time e.g. link is removed, hence link_drop() is called,
there may be still some asynchronous netlink call is waiting, and
their callbacks hit assertion.

This make {link,netdev}_detach_from_manager() just drop all references
from manager, but keep the pointer to manager.

Fixes #11411.

5 years agoUpdate uk.po
Mikhail Kasimov [Tue, 15 Jan 2019 13:30:22 +0000 (15:30 +0200)] 
Update uk.po

Updated translation for ```src/timedate/org.freedesktop.timedate1.policy```

5 years agoRevert "pam_systemd: set $DBUS_SESSION_BUS_ADDRESS unconditionally" 11378/head
Zbigniew Jędrzejewski-Szmek [Thu, 10 Jan 2019 09:06:18 +0000 (10:06 +0100)] 
Revert "pam_systemd: set $DBUS_SESSION_BUS_ADDRESS unconditionally"

This reverts commit 69bd76f2b90cd00c1596b2e2c05845a4d9596fd2.

$DBUS_SESSION_BUS_ADDRESS is again set only if the socket exists.

Quoting https://github.com/systemd/systemd/pull/11327#issuecomment-452019027:
> [setting $DBUS_SESSION_BUS_ADDRESS unconditionally] makes pam_systemd
> incompatible with installations and distributions where dbus was not
> configured with --enable-user-session, and the session dbus-daemon is started
> by autolaunching or dbus-launch (as opposed to dbus.socket). I don't think
> that's wise: using autolaunching or dbus-launch, and disabling or not
> installing dbus.socket and dbus.service on the systemd user instance, is our
> compatibility story for people who still need a D-Bus session bus per X11
> session for whatever reason.
>
> For example, Debian can currently do either way, with a dbus-user-session
> package strongly recommended but not actually mandatory. dbus-user-session
> requires libpam-systemd; if pam_systemd now requires dbus.socket (which is in
> the dbus-user-session package), that's a circular dependency, which we
> normally try hard to avoid.

For systems that use dbus.socket this doesn't matter much, because the
user session is ordered after the user managaer, which pulls in dbus.socket
very early. For example, when logging over ssh:

sshd[20796]: pam_systemd(sshd:session): pam-systemd initializing
sshd[20796]: pam_systemd(sshd:session): Asking logind to create session: uid=1001 pid=20796 service=sshd type=tty class=user desktop= seat= vtnr=0 tty= display= remote=yes remote_user= remote_host=::1
sshd[20796]: pam_systemd(sshd:session): Session limits: memory_max=n/a tasks_max=n/a cpu_weight=n/a io_weight=n/a
systemd[1]: Created slice User Slice of UID 1001.
systemd[1]: Starting User Runtime Directory /run/user/1001...
systemd-logind[1210]: New session 3796 of user guest.
systemd[1]: Started User Runtime Directory /run/user/1001.
systemd[1]: Starting User Manager for UID 1001...
systemd[20805]: pam_systemd(systemd-user:session): pam-systemd initializing
systemd[20805]: Starting D-Bus User Message Bus Socket.
...
systemd[20805]: Reached target Sockets.
systemd[20805]: Reached target Basic System.
systemd[1]: Started User Manager for UID 1001.
systemd[1]: Started Session 3796 of user guest.
sshd[20796]: pam_systemd(sshd:session): Reply from logind: id=3796 object_path=/org/freedesktop/login1/session/_33796 runtime_path=/run/user/1001 session_fd=13 seat= vtnr=0 original_uid=1001
sshd[20796]: pam_unix(sshd:session): session opened for user guest by (uid=0)

Hence, everything in the ssh session is ordered after the user instance.
And in the user instance, services should be orderd after dbus.socket using
inter-unit dependencies. dbus.socket in turns does
systemctl --user set-environment DBUS_SESSION_BUS_ADDRESS=unix:path=%t/bus.

So there should be no race between starting of the dbus socket and our check
if it exists.

The alternative would be to set the "DBUS_SESSION_BUS_ADDRESS=unix:path=%s/bus;autolaunch:".
AFAICT, this would work as well. But I don't see any case where it actually works
better. Since this is an area with many compatiblity concerns, let's stick to
the previous setup which seems to work well.

5 years agopam_systemd: do no allocate the path of fixed length
Zbigniew Jędrzejewski-Szmek [Thu, 10 Jan 2019 08:53:34 +0000 (09:53 +0100)] 
pam_systemd: do no allocate the path of fixed length

5 years agoudev: do logging before setting variables to NULL
Zbigniew Jędrzejewski-Szmek [Tue, 15 Jan 2019 07:17:44 +0000 (08:17 +0100)] 
udev: do logging before setting variables to NULL

gcc-9 diagnoses this as an error.
Reported by Jeff Law.

5 years agoUpdate systemd-system.conf.xml
Mikhail Kasimov [Tue, 15 Jan 2019 12:52:34 +0000 (14:52 +0200)] 
Update systemd-system.conf.xml

Updating due to phrase "Defaults to DefaultTimeoutStartSec= from the manager configuration file, except when Type=oneshot is used, in which case the timeout is disabled by default (see systemd-system.conf)" from [0] https://github.com/systemd/systemd/blob/master/man/systemd.service.xml

5 years agoRemove 'inline' attributes from static functions in .c files (#11426)
Topi Miettinen [Tue, 15 Jan 2019 07:12:28 +0000 (09:12 +0200)] 
Remove 'inline' attributes from static functions in .c files (#11426)

Let the compiler perform inlining (see #11397).

5 years agotimedate: refuse to set time when previous request is not finished 11424/head
Yu Watanabe [Tue, 15 Jan 2019 05:51:30 +0000 (14:51 +0900)] 
timedate: refuse to set time when previous request is not finished

If `timedatectl set-time` is invoked right after `timedatectl set-ntp true`,
then, the NTP service may not be started yet.

Fixes #11420.

5 years agotimedate: treat 'activating' or 'inactivating' NTP client status as 'active'
Yu Watanabe [Mon, 14 Jan 2019 17:59:48 +0000 (02:59 +0900)] 
timedate: treat 'activating' or 'inactivating' NTP client status as 'active'

When `timedatectl set-time` is called, NTP client may be in
'activating' or something. For safety, let's treat such states as
'active'.

This also changes all unit file status except for 'masked' or 'disabled'
are treated as 'enabled'.

5 years agotest: add a testcase for Address.Peer= with ipv6 11428/head
Yu Watanabe [Mon, 14 Jan 2019 20:48:39 +0000 (05:48 +0900)] 
test: add a testcase for Address.Peer= with ipv6

Testcase for #9130.

5 years agonetworkd: wait for kernel to reply ipv6 peer address
Susant Sahani [Mon, 10 Dec 2018 17:05:40 +0000 (22:35 +0530)] 
networkd: wait for kernel to reply ipv6 peer address

When we configure address with peer, peer address is repliedby kernel.
Hence add the peer when it is available.

Closes #9130.

5 years agoMerge pull request #11417 from yuwata/fix-11416
Michael Biebl [Mon, 14 Jan 2019 01:39:11 +0000 (02:39 +0100)] 
Merge pull request #11417 from yuwata/fix-11416

udevadm: fix segfault

5 years agotest: add a testcase for 23 wirguard peers 11418/head
Yu Watanabe [Mon, 14 Jan 2019 01:06:21 +0000 (10:06 +0900)] 
test: add a testcase for 23 wirguard peers

5 years agonetwork: wireguard: rename and split set_wireguard_interface()
Yu Watanabe [Mon, 14 Jan 2019 00:45:20 +0000 (09:45 +0900)] 
network: wireguard: rename and split set_wireguard_interface()

This does not change the behavior except for fixing the issue #11404.

Fixes #11404.

5 years agonetlink: set maximum size of WGDEVICE_A_IFNAME
Yu Watanabe [Sun, 13 Jan 2019 19:43:33 +0000 (04:43 +0900)] 
netlink: set maximum size of WGDEVICE_A_IFNAME

5 years agoudevadm: fix segfault 11417/head
Yu Watanabe [Sun, 13 Jan 2019 21:34:15 +0000 (06:34 +0900)] 
udevadm: fix segfault

Fixes #11416.

5 years agoman: fix reference
Yu Watanabe [Sat, 12 Jan 2019 23:42:32 +0000 (08:42 +0900)] 
man: fix reference

Fixes #11396.

5 years agoMerge pull request #11409 from yuwata/udev-synthetic-errno
Zbigniew Jędrzejewski-Szmek [Sun, 13 Jan 2019 10:11:22 +0000 (11:11 +0100)] 
Merge pull request #11409 from yuwata/udev-synthetic-errno

udev: update logs

5 years agoudev: use ENODATA when 'No entry found from hwdb' 11409/head
Yu Watanabe [Sun, 13 Jan 2019 08:55:33 +0000 (17:55 +0900)] 
udev: use ENODATA when 'No entry found from hwdb'

Before:
IMPORT builtin 'hwdb' fails: No such file or directory

After:
IMPORT builtin 'hwdb' fails: No data available

Previous log is confusing and may be understood as hwdb file not exist.

5 years agoudev: use SYNTHETIC_ERRNO() macro in log_device_*_errno()
Yu Watanabe [Sun, 13 Jan 2019 08:50:47 +0000 (17:50 +0900)] 
udev: use SYNTHETIC_ERRNO() macro in log_device_*_errno()

5 years agoMerge pull request #11393 from mrc0mmand/fix-service-masking-in-TEST-01-BASIC
Evgeny Vereshchagin [Sun, 13 Jan 2019 01:45:48 +0000 (04:45 +0300)] 
Merge pull request #11393 from mrc0mmand/fix-service-masking-in-TEST-01-BASIC

test: drop service masking in TEST-01-BASIC

5 years agoREADME: mention that meson-0.49 is required to build PIEs
Yu Watanabe [Sun, 13 Jan 2019 00:42:28 +0000 (09:42 +0900)] 
README: mention that meson-0.49 is required to build PIEs

Follow-up for 4e4bbc439eb7f16a608f457d3eaac08c60633212.

5 years agoNEWS: add more entries
Yu Watanabe [Sun, 13 Jan 2019 00:31:27 +0000 (09:31 +0900)] 
NEWS: add more entries

5 years agoNEWS: document deprecation of PermissionsStartOnly= in v240
Zbigniew Jędrzejewski-Szmek [Sat, 12 Jan 2019 19:35:17 +0000 (20:35 +0100)] 
NEWS: document deprecation of PermissionsStartOnly= in v240

https://github.com/systemd/systemd/pull/10802#issuecomment-453772058

5 years agoNEWS: update for v241
Zbigniew Jędrzejewski-Szmek [Thu, 10 Jan 2019 21:25:52 +0000 (22:25 +0100)] 
NEWS: update for v241

5 years agoudev: use usec_t for timeout in udev_ctrl_send_*()
Yu Watanabe [Tue, 8 Jan 2019 03:02:08 +0000 (12:02 +0900)] 
udev: use usec_t for timeout in udev_ctrl_send_*()

5 years agoudevadm: also set LOG_DEBUG to LOG_REAL_SYSTEMD when --debug is passed
Yu Watanabe [Tue, 8 Jan 2019 01:48:04 +0000 (10:48 +0900)] 
udevadm: also set LOG_DEBUG to LOG_REAL_SYSTEMD when --debug is passed

5 years agoudev: also update log level for LOG_REALM_SYSTEMD
Yu Watanabe [Tue, 8 Jan 2019 01:46:40 +0000 (10:46 +0900)] 
udev: also update log level for LOG_REALM_SYSTEMD

Now, not a few udevd debug logs come from sd-device or sd-hwdb.
Only setting LOG_REALM_UDEV may not sufficient to debug.
We have already similar code in main() and udevadm.

5 years agoudevadm: use SYNTHETIC_ERRNO() macro
Yu Watanabe [Fri, 11 Jan 2019 23:33:09 +0000 (08:33 +0900)] 
udevadm: use SYNTHETIC_ERRNO() macro

5 years agoudevadm: improve error message when no option specified for 'control' command
Yu Watanabe [Fri, 11 Jan 2019 23:31:53 +0000 (08:31 +0900)] 
udevadm: improve error message when no option specified for 'control' command

Also drop redundant block, use SYNTHETIC_ERRNO(), and add log_oom().