platform/upstream/systemd.git
5 years agotest: add more tests for "systemctl clean"
Yu Watanabe [Sat, 31 Aug 2019 07:30:12 +0000 (09:30 +0200)]
test: add more tests for "systemctl clean"

5 years agocore/swap: support "systemctl clean" for swap units
Yu Watanabe [Sun, 25 Aug 2019 13:26:33 +0000 (22:26 +0900)]
core/swap: support "systemctl clean" for swap units

5 years agocore/mount: support "systemctl clean" for mount units
Yu Watanabe [Sun, 25 Aug 2019 13:08:47 +0000 (22:08 +0900)]
core/mount: support "systemctl clean" for mount units

5 years agocore/socket: support "systemctl clean" for socket units
Yu Watanabe [Sun, 25 Aug 2019 09:20:56 +0000 (18:20 +0900)]
core/socket: support "systemctl clean" for socket units

5 years agocore: introduce unit_fork_and_watch_rm_rf()
Yu Watanabe [Sun, 25 Aug 2019 08:57:08 +0000 (17:57 +0900)]
core: introduce unit_fork_and_watch_rm_rf()

5 years agocore: move timeout_clean_usec from Service to ExecContext
Yu Watanabe [Sun, 25 Aug 2019 08:47:57 +0000 (17:47 +0900)]
core: move timeout_clean_usec from Service to ExecContext

5 years agotest: add tests for systemctl clean with DynamicUser=yes
Yu Watanabe [Sun, 25 Aug 2019 07:27:33 +0000 (16:27 +0900)]
test: add tests for systemctl clean with DynamicUser=yes

5 years agocore: also remove private directories by systemctl clean
Yu Watanabe [Thu, 22 Aug 2019 16:04:24 +0000 (01:04 +0900)]
core: also remove private directories by systemctl clean

Fixes #13355.

5 years agocore: introduce exec_directory_is_private() helper function
Yu Watanabe [Thu, 22 Aug 2019 15:48:38 +0000 (00:48 +0900)]
core: introduce exec_directory_is_private() helper function

Also, this follows up 40cd2ecc26b776ef085fd0fd29e8e96f6422a0d3.

5 years agotest/test-functions: use truncate instead of dd to create testbed image
Dan Streetman [Tue, 13 Aug 2019 12:05:06 +0000 (08:05 -0400)]
test/test-functions: use truncate instead of dd to create testbed image

This avoids unnecessary noise in the stderr logs which dd always produces,
such as:

0+0 records in
0+0 records out
0 bytes copied, 0.000155284 s, 0.0 kB/s

Using truncate should not result in any functional change; the image will
still be created as a sparse file of the size specified.

5 years agotest/test-functions: use binaries from $BUILD_DIR or installed system
Dan Streetman [Tue, 13 Aug 2019 11:52:57 +0000 (07:52 -0400)]
test/test-functions: use binaries from $BUILD_DIR or installed system

In Ubuntu CI, we test binaries from the installed system, not from
$BUILD_DIR, so use the appropriate binary.  Most of the calls to the
binaries are part of checking/processing asan-built binaries, and so
did not apply to Ubuntu CI, except for generating noise in the stderr
log like:

objdump: '/tmp/autopkgtest.83yGoI/build.fHB/src/test/TEST-01-BASIC/systemd-journald': No such file

However this also applies to the call to systemd-nspawn, which the debian
upstream test wrapper was sed-adjusting to use the installed binary
instead of the binary in $BUILD_DIR.  This commit allows removing that
sed processing of the test-functions file during Ubuntu CI test.

5 years agosemaphore: switch back to the master branch
Evgeny Vereshchagin [Sat, 24 Aug 2019 02:51:53 +0000 (02:51 +0000)]
semaphore: switch back to the master branch

5 years agoFix typo in sd_event_set_watchdog manpage (#13393)
Arian van Putten [Sat, 24 Aug 2019 06:16:44 +0000 (08:16 +0200)]
Fix typo in sd_event_set_watchdog manpage (#13393)

5 years agoNEWS: update contributors list
Zbigniew Jędrzejewski-Szmek [Thu, 22 Aug 2019 11:47:11 +0000 (13:47 +0200)]
NEWS: update contributors list

5 years agohwdb: update for v243-rc2
Zbigniew Jędrzejewski-Szmek [Thu, 22 Aug 2019 07:21:43 +0000 (09:21 +0200)]
hwdb: update for v243-rc2

Diff on the hwdb/*.hwdb files shows that again, this is only additions and
minor corrections.

5 years agojournalctl: Make journalctl --user-unit= match on _SYSTEMD_USER_SLICE
Arian van Putten [Mon, 12 Aug 2019 17:36:56 +0000 (19:36 +0200)]
journalctl:  Make journalctl --user-unit= match on _SYSTEMD_USER_SLICE

journalctl --unit= already did this, and allows you to tail all the logs
for a certain slice easily. It seemed only natural to make --user-unit
behave in a similar way.

The _SYSTEMD_USER_SLICE field was not documented as being added by
journald, so I have added that to the documentation too.

Furthermore, I have documented the existing behaviour of --unit= and the
new behaviour of --user-unit=

The behaviour was actually not documented before, so I am also OK with
removing the match for the --unit= command instead.  The user would then
have to manually provide _SYSTEMD_SLICE= filter to journalctl in both
cases. Both options work for me.

5 years agocore: TAKE_PTR in timer_add_one_calendar_spec
Anita Zhang [Thu, 22 Aug 2019 06:03:16 +0000 (23:03 -0700)]
core: TAKE_PTR in timer_add_one_calendar_spec

Introduced in d00a52c

Fixes #13373

5 years agohwdb: add sensor location for HP ProBook4535s
Hans de Goede [Thu, 22 Aug 2019 06:55:09 +0000 (08:55 +0200)]
hwdb: add sensor location for HP ProBook4535s

https://bugzilla.redhat.com/show_bug.cgi?id=1717712

5 years agojournald: slightly bump OOM adjust for journald (#13366)
Lennart Poettering [Thu, 22 Aug 2019 08:02:28 +0000 (10:02 +0200)]
journald: slightly bump OOM adjust for journald (#13366)

If logging disappears issues are hard to debug, hence let's give
journald a slight edge over other services when the OOM killer hits.

Here are the special adjustments we now make:

 systemd-coredump@.service.in OOMScoreAdjust=500
 systemd-journald.service.in  OOMScoreAdjust=-250
 systemd-udevd.service.in     OOMScoreAdjust=-1000

(i.e. the coredump processing is made more likely to be killed on OOM,
and udevd and journald are less likely to be killed)

5 years agoMerge pull request #13365 from keszybz/fix-commits-from-pr-13246
Zbigniew Jędrzejewski-Szmek [Thu, 22 Aug 2019 07:13:25 +0000 (09:13 +0200)]
Merge pull request #13365 from keszybz/fix-commits-from-pr-13246

Fix commits from #13246

5 years agoAdd Chuwi Hi10 to 60-sensor.hwdb (#13351)
Albrecht Lohofener [Thu, 22 Aug 2019 07:12:31 +0000 (09:12 +0200)]
Add Chuwi Hi10 to 60-sensor.hwdb (#13351)

5 years agopid1: always log successfull process termination quietly
Zbigniew Jędrzejewski-Szmek [Wed, 21 Aug 2019 14:20:59 +0000 (16:20 +0200)]
pid1: always log successfull process termination quietly

Fixes #13372.

5 years agoMerge pull request #13368 from keszybz/close-watchdog
Lennart Poettering [Wed, 21 Aug 2019 13:36:02 +0000 (15:36 +0200)]
Merge pull request #13368 from keszybz/close-watchdog

shared/watchdog: close watchdog device when done with it

5 years agopid1: after creating transient drop-ins, put file in path cache
Zbigniew Jędrzejewski-Szmek [Wed, 21 Aug 2019 07:14:52 +0000 (09:14 +0200)]
pid1: after creating transient drop-ins, put file in path cache

The alternative would be to recreate the cache, but dropins can be created very
often for transient settings, so updating the cache seems like a much faster
option.

Fixes #13287.

5 years agoshared/watchdog: close watchdog device when done with it
Zbigniew Jędrzejewski-Szmek [Tue, 20 Aug 2019 18:24:47 +0000 (20:24 +0200)]
shared/watchdog: close watchdog device when done with it

The file descriptor was opened with O_CLOEXEC, so in practice this doesn't
change too much, but it seems cleaner to always close the old fd when
changing the device path.

5 years agoMerge pull request #13367 from poettering/null-console-fixes
Zbigniew Jędrzejewski-Szmek [Tue, 20 Aug 2019 19:13:36 +0000 (21:13 +0200)]
Merge pull request #13367 from poettering/null-console-fixes

Fixes inspired by console=null

5 years agofsck: add logging and fix error codes where appropriate
Lennart Poettering [Tue, 20 Aug 2019 15:35:06 +0000 (17:35 +0200)]
fsck: add logging and fix error codes where appropriate

5 years agomanager: simplify manager_get_confirm_spawn() a bit
Lennart Poettering [Tue, 20 Aug 2019 15:34:16 +0000 (17:34 +0200)]
manager: simplify manager_get_confirm_spawn() a bit

Let's use our usual way of storing error codes.

Let's remove a redundant temporary variable we never change

5 years agoload-fragment: use path_join() where appropriate
Lennart Poettering [Tue, 20 Aug 2019 15:32:34 +0000 (17:32 +0200)]
load-fragment: use path_join() where appropriate

5 years agolog: don't invalidate open console fd if we can't open a new one
Lennart Poettering [Tue, 20 Aug 2019 15:32:17 +0000 (17:32 +0200)]
log: don't invalidate open console fd if we can't open a new one

5 years agoterminal-util: add fallback logic to make_console_stdio()
Lennart Poettering [Tue, 20 Aug 2019 15:30:15 +0000 (17:30 +0200)]
terminal-util: add fallback logic to make_console_stdio()

If /dev/console can't be opened, let's use /dev/null instead.

Inspired by: #13332

5 years agolog: cast various log_open() calls to (void)
Lennart Poettering [Tue, 20 Aug 2019 15:29:49 +0000 (17:29 +0200)]
log: cast various log_open() calls to (void)

5 years agoupdate TODO
Lennart Poettering [Tue, 20 Aug 2019 14:21:01 +0000 (16:21 +0200)]
update TODO

5 years agoMerge pull request #13360 from keszybz/udev-watch-more
Lennart Poettering [Tue, 20 Aug 2019 11:55:47 +0000 (13:55 +0200)]
Merge pull request #13360 from keszybz/udev-watch-more

udev: set "watch" for more devices

5 years agoid128: actually support --pretty
Zbigniew Jędrzejewski-Szmek [Tue, 6 Aug 2019 16:23:54 +0000 (18:23 +0200)]
id128: actually support --pretty

We must be all lazy, at least I know I always used -p ;).

5 years agotest-journal-flush: provide at least *some* logs
Zbigniew Jędrzejewski-Szmek [Fri, 2 Aug 2019 13:07:56 +0000 (15:07 +0200)]
test-journal-flush: provide at least *some* logs

Ubunut autopkgtest fails with:
405/501 test-journal-flush                      FAIL     0.74 s (killed by signal 6 SIGABRT)

--- command ---
SYSTEMD_KBD_MODEL_MAP='/tmp/autopkgtest.BgjJJv/build.yAM/systemd/src/locale/kbd-model-map' SYSTEMD_LANGUAGE_FALLBACK_MAP='/tmp/autopkgtest.BgjJJv/build.yAM/systemd/src/locale/language-fallback-map' PATH='/tmp/autopkgtest.BgjJJv/build.yAM/systemd/build-deb:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games' /tmp/autopkgtest.BgjJJv/build.yAM/systemd/build-deb/test-journal-flush
--- stderr ---
Assertion 'r >= 0' failed at src/journal/test-journal-flush.c:48, function main(). Aborting.
-------

It's hard to say what is going on here without any error messages whatsoever.
The test goes into deep details of journal file handling, so it needs to also
do logging on its own.

5 years agotest-event: stop debugging spew
Zbigniew Jędrzejewski-Szmek [Fri, 2 Aug 2019 13:00:02 +0000 (15:00 +0200)]
test-event: stop debugging spew

Ubuntu autopkgtests print output from all tests, and test-event produces
a lot of it. Let's cut it down to reasonable size.

5 years agobasic/build.h: fix typo
Zbigniew Jędrzejewski-Szmek [Thu, 1 Aug 2019 11:04:16 +0000 (13:04 +0200)]
basic/build.h: fix typo

5 years agocgroup: Also set io.bfq.weight
Kai Krakow [Sat, 17 Aug 2019 00:33:43 +0000 (02:33 +0200)]
cgroup: Also set io.bfq.weight

Current kernels with BFQ scheduler do not yet set their IO weight
through "io.weight" but through "io.bfq.weight" (using a slightly
different interface supporting only default weights, not per-device
weights). This commit enables "IOWeight=" to just to that.

This patch may be dropped at some time later.

Link: https://github.com/systemd/systemd/issues/7057
Signed-off-by: Kai Krakow <kai@kaishome.de>
5 years agoMerge pull request #13356 from keszybz/static-nodes-perms
Lennart Poettering [Mon, 19 Aug 2019 16:02:46 +0000 (18:02 +0200)]
Merge pull request #13356 from keszybz/static-nodes-perms

Fix permissions on static nodes

5 years agoMerge pull request #13353 from keszybz/analyze-cat-config-relabel-extra.d
Lennart Poettering [Mon, 19 Aug 2019 13:38:00 +0000 (15:38 +0200)]
Merge pull request #13353 from keszybz/analyze-cat-config-relabel-extra.d

systemd-analyze cat-config relabel-extra.d/

5 years agotmpfiles: override permissions of static nodes that need this
Zbigniew Jędrzejewski-Szmek [Mon, 19 Aug 2019 09:50:04 +0000 (11:50 +0200)]
tmpfiles: override permissions of static nodes that need this

Fixes #13350.

5 years agoshared/seccomp: add sync_file_range2
Zbigniew Jędrzejewski-Szmek [Mon, 19 Aug 2019 06:51:39 +0000 (08:51 +0200)]
shared/seccomp: add sync_file_range2

Some architectures need the arguments to be reordered because of alignment
issues. Otherwise, it's the same as sync_file_range.

5 years agoRename tmpfiles.d/kmod.conf to static-nodes.conf
Zbigniew Jędrzejewski-Szmek [Mon, 19 Aug 2019 09:05:58 +0000 (11:05 +0200)]
Rename tmpfiles.d/kmod.conf to static-nodes.conf

It is generated using kmod, but apart from that doesn't have
much to do with kmod.

5 years agoanalyze: make cat-config work with relabel-extra.d
Zbigniew Jędrzejewski-Szmek [Tue, 6 Aug 2019 20:07:17 +0000 (22:07 +0200)]
analyze: make cat-config work with relabel-extra.d

5 years agosystemctl: use unicode in one more place
Zbigniew Jędrzejewski-Szmek [Tue, 6 Aug 2019 19:20:18 +0000 (21:20 +0200)]
systemctl: use unicode in one more place

5 years agoman: owned to → owned by
Zbigniew Jędrzejewski-Szmek [Tue, 6 Aug 2019 07:05:12 +0000 (09:05 +0200)]
man: owned to → owned by

5 years agoMerge pull request #13235 from yuwata/network-routing-policy-rule-family-13233
Zbigniew Jędrzejewski-Szmek [Mon, 19 Aug 2019 08:08:23 +0000 (10:08 +0200)]
Merge pull request #13235 from yuwata/network-routing-policy-rule-family-13233

network: add RoutingPolicyRule.Family= setting

5 years agoMerge pull request #13345 from yuwata/network-fix-preferred-lifetime-zero-13341
Zbigniew Jędrzejewski-Szmek [Mon, 19 Aug 2019 07:59:16 +0000 (09:59 +0200)]
Merge pull request #13345 from yuwata/network-fix-preferred-lifetime-zero-13341

network: fix PreferredLifetime=0

5 years agoRevert "shared/conf-parser,networkd: EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE → EXTRACT_...
Zbigniew Jędrzejewski-Szmek [Wed, 14 Aug 2019 15:41:31 +0000 (17:41 +0200)]
Revert "shared/conf-parser,networkd: EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE → EXTRACT_UNQUOTE"

This reverts commit 8a07b4033e5d3c86931b3dd2ddbca41118c05c60.
The tests are kept. test-networkd-conf is adjusted to pass.

This fixes #13276. I think current rules are extremely confusing, as the
case in test-networkd-conf shows. We apply some kinds of unescaping (relating
to quoting), but not others (related to escaping of special characters).
But fixing this is hard, because people have adjusted quoting to match
our rules, and if we make the rules "better", things might break in unexpected
places.

5 years agocgroup-util: update comment to reflect stable kernel fixes
Topi Miettinen [Fri, 16 Aug 2019 08:42:04 +0000 (11:42 +0300)]
cgroup-util: update comment to reflect stable kernel fixes

5 years agoMerge pull request #13344 from ddstreet/test-functions
Yu Watanabe [Sun, 18 Aug 2019 15:34:35 +0000 (00:34 +0900)]
Merge pull request #13344 from ddstreet/test-functions

Minor/cosmetic changes to test/test-functions, some test.sh

5 years agotest: increase qemu timeout for TEST-18 and TEST-19
Dan Streetman [Thu, 15 Aug 2019 20:27:05 +0000 (16:27 -0400)]
test: increase qemu timeout for TEST-18 and TEST-19

These tests runs under qemu, and on some testbeds, without acceleration.
On those systems, the current 180 second overall test timeout is too
short to run the test.

Increasing the timeout to 600s should be enough, even for slow
non-accelerated qemu testbeds.

5 years agotest-network: update test for PreferredLifetime=0
Yu Watanabe [Sat, 17 Aug 2019 17:15:11 +0000 (02:15 +0900)]
test-network: update test for PreferredLifetime=0

5 years agonetwork: do not check deprecated flag in address_is_ready()
Yu Watanabe [Sun, 18 Aug 2019 15:04:37 +0000 (00:04 +0900)]
network: do not check deprecated flag in address_is_ready()

Without this change, the address with PreferredLifetime=0 cannot be ready,
and thus, no consequent setting up process does not start.
The bug was introduced by 6aa5773.

Follow-up for b7ed5384ab55cd4d7b8d7d1ec7f5d5e145f0a2b1.

Fixes #13341.

5 years agoman: add missing comma
Theo Ouzhinski [Sat, 17 Aug 2019 17:21:50 +0000 (13:21 -0400)]
man: add missing comma

5 years agotrivial spelling fixes (#13339)
Mr-Foo [Sat, 17 Aug 2019 16:30:57 +0000 (16:30 +0000)]
trivial spelling fixes (#13339)

5 years agotest/test-functions: add mkdir to import_initdir
Dan Streetman [Sat, 17 Aug 2019 16:24:00 +0000 (12:24 -0400)]
test/test-functions: add mkdir to import_initdir

This dir is created by create_empty_image_rootdir, as well as indirectly
by some other functions, but it should be created by import_initdir so
the newly-exported $initdir exists and can be used immediately without
relying on other functions to create it.

5 years agotest: replace $TESTDIR/root with $initdir
Dan Streetman [Thu, 15 Aug 2019 13:39:31 +0000 (09:39 -0400)]
test: replace $TESTDIR/root with $initdir

The $initdir var is already set to $TESTDIR/root, it should be used
instead of direct use of $TESTDIR/root.

5 years agotest: TEST-33 and TEST-36 should use create_empty_image_rootdir
Dan Streetman [Sat, 17 Aug 2019 16:20:56 +0000 (12:20 -0400)]
test: TEST-33 and TEST-36 should use create_empty_image_rootdir

This recently added function handles mkdir and mounting of the empty image,
as well as umounting after test_setup.

5 years agotest/test-functions: avoid stderr noise, only umount on cleanup if mountpoint
Dan Streetman [Tue, 13 Aug 2019 11:50:59 +0000 (07:50 -0400)]
test/test-functions: avoid stderr noise, only umount on cleanup if mountpoint

Only umount it during cleanup if the $TESTDIR/root dir is a mountpoint.
This avoids adding noise to the stderr log such as:

mountpoint: /var/tmp/systemd-test.waLOFT/root: No such file or directory

5 years agotest-network: add tests for RoutingPolicyRule.Family=ipv6 and both
Yu Watanabe [Wed, 31 Jul 2019 03:09:03 +0000 (12:09 +0900)]
test-network: add tests for RoutingPolicyRule.Family=ipv6 and both

5 years agonetwork: add RoutingPolicyRule.Family= setting
Yu Watanabe [Wed, 31 Jul 2019 22:41:36 +0000 (07:41 +0900)]
network: add RoutingPolicyRule.Family= setting

Closes #13233.

5 years agonetwork: split out copying logic from routing_policy_rule_add_internal()
Yu Watanabe [Sat, 3 Aug 2019 20:16:43 +0000 (05:16 +0900)]
network: split out copying logic from routing_policy_rule_add_internal()

5 years agonetwork: rename AddressFamilyBoolean -> AddressFamily
Yu Watanabe [Sat, 3 Aug 2019 20:09:08 +0000 (05:09 +0900)]
network: rename AddressFamilyBoolean -> AddressFamily

We usually do not call an extended boolean as XxxBoolean.

5 years agonetwork: add missing entry in serialization/deserialization
Yu Watanabe [Thu, 1 Aug 2019 19:22:44 +0000 (04:22 +0900)]
network: add missing entry in serialization/deserialization

5 years agonetwork: serialize/deserialize address family
Yu Watanabe [Thu, 1 Aug 2019 20:19:26 +0000 (05:19 +0900)]
network: serialize/deserialize address family

5 years agonetwork: refuse the case To= and From= are in different address family
Yu Watanabe [Thu, 1 Aug 2019 20:07:40 +0000 (05:07 +0900)]
network: refuse the case To= and From= are in different address family

5 years agoudev: allow persistent storage rules work for ubi devices
Zbigniew Jędrzejewski-Szmek [Fri, 16 Aug 2019 11:37:14 +0000 (13:37 +0200)]
udev: allow persistent storage rules work for ubi devices

Back in dbbf424c8b77c1649e822c20c0b1fee1d2cfd93d, we merged a rule to add
persistent storage for /dev/ubi*, but this rule could have never worked because
of the top-level exclude.

Also set "watch" for /dev/ubi*.

5 years agoudev: assume all devices which have persistent links also need to be watched
Zbigniew Jędrzejewski-Szmek [Fri, 16 Aug 2019 11:20:04 +0000 (13:20 +0200)]
udev: assume all devices which have persistent links also need to be watched

We had two similar lists, but one was accepting many more device types.
I assume that this is by mistake, simply because the lack of device links
is easier to notice than the lack of synthesized event after the device is
written to. This uses the same list in both places, effectively adding
"watch" attribute to /dev/nbd*, /dev/zd*, etc.

5 years agoMerge pull request #13317 from ddstreet/werror
Zbigniew Jędrzejewski-Szmek [Fri, 16 Aug 2019 08:19:09 +0000 (10:19 +0200)]
Merge pull request #13317 from ddstreet/werror

Fix build warnings, so Ubuntu CI can pass --werror to meson

5 years ago po: update Ukrainian translation (#13329)
Yuri Chornoivan [Fri, 16 Aug 2019 07:55:19 +0000 (10:55 +0300)]
 po: update Ukrainian translation (#13329)

* Update Ukrainian translation

* po: update Ukrainian translation

5 years agounit-file: downgrade accidentaly high-prio debug log message
Lennart Poettering [Thu, 15 Aug 2019 10:34:31 +0000 (12:34 +0200)]
unit-file: downgrade accidentaly high-prio debug log message

5 years agonetworkctl: avoid outputting '(null)' for LLDP ports without description
Lennart Poettering [Thu, 15 Aug 2019 17:28:06 +0000 (19:28 +0200)]
networkctl: avoid outputting '(null)' for LLDP ports without description

5 years agosrc/boot/efi/meson.build: if meson --werror is true, set gcc -Werror
Dan Streetman [Tue, 13 Aug 2019 00:34:43 +0000 (20:34 -0400)]
src/boot/efi/meson.build: if meson --werror is true, set gcc -Werror

This part of the build does not use the normal meson parameters, so
we need to explicitly check for the meson --werror parameter, and if
it's true, set the gcc -Werror parameter for this subdir's build.

5 years agosrc/boot/efi/linux: elide __attribute__((regparm(0))) on non-i386
Dan Streetman [Tue, 13 Aug 2019 11:02:33 +0000 (07:02 -0400)]
src/boot/efi/linux: elide __attribute__((regparm(0))) on non-i386

This attribute is x86_32-only, so when building on non-intel archs it
generates a compiler warning.  When building with -Werror this turns
into an error, so only include the attribute on i386 arch builds.

5 years agosrc/boot/efi/shim: elide __attribute__((sysv_abi)) on non-intel archs
Dan Streetman [Tue, 13 Aug 2019 10:45:04 +0000 (06:45 -0400)]
src/boot/efi/shim: elide __attribute__((sysv_abi)) on non-intel archs

This attribute is x86-only, so when building on non-intel archs it
generates a compiler warning.  When building with -Werror this turns
into an error, so only include the attribute on intel archs.

5 years agosrc/basic/missing_syscall: add comment lines for PR 13319 changes
Dan Streetman [Thu, 15 Aug 2019 01:08:36 +0000 (21:08 -0400)]
src/basic/missing_syscall: add comment lines for PR 13319 changes

Add a comment line explaining that the syscall defines might be
defined to invalid negative numbers, as libseccomp redefines them
to negative numbers if not defined by the kernel headers, which is
not obvious just from reading the code checking for defined && > 0

5 years agoREADME: add an OSS-Fuzz badge
Evgeny Vereshchagin [Thu, 15 Aug 2019 07:23:55 +0000 (07:23 +0000)]
README: add an OSS-Fuzz badge

Since bug reports, backtraces, coverage reports and build logs are scattered
across at least four different places and there is no publicly available dashboards
the badge can point to, let's just point it to the build logs, which hopefully are going to be
a little bit more usable once https://github.com/google/oss-fuzz/issues/2690 is
addressed.

5 years agoupdate-utmp: fix assertion failure if rescue.target, multi-user.target and graphical...
Tommi Rantala [Mon, 5 Aug 2019 11:01:58 +0000 (14:01 +0300)]
update-utmp: fix assertion failure if rescue.target, multi-user.target and graphical.target are all inactive

If rescue.target, multi-user.target and graphical.target are all
inactive, get_current_runlevel() is not able to determine current
runlevel, and returns with zero. This zero runlevel value results to
assertion failure in utmp_put_runlevel().

 # systemctl stop rescue.target multi-user.target graphical.target
 # systemctl start systemd-update-utmp-runlevel.service

 systemd[1]: Stopped target Graphical Interface.
 systemd[1]: Stopped target Multi-User System.
 systemd[1]: Starting Update UTMP about System Runlevel Changes...
 systemd-update-utmp[67]: Assertion 'runlevel > 0' failed at src/shared/utmp-wtmp.c:275, function utmp_put_runlevel(). Aborting.
 systemd[1]: systemd-update-utmp-runlevel.service: Main process exited, code=dumped, status=6/ABRT
 systemd[1]: systemd-update-utmp-runlevel.service: Failed with result 'core-dump'.
 systemd[1]: Failed to start Update UTMP about System Runlevel Changes.

Let's just print a warning in this case and skip the utmp update, to
avoid systemd-update-utmp-runlevel.service failures.

5 years agoMerge pull request #13273 from RPigott/zshcomp
Zbigniew Jędrzejewski-Szmek [Wed, 14 Aug 2019 16:21:12 +0000 (18:21 +0200)]
Merge pull request #13273 from RPigott/zshcomp

Enable resolvectl zsh completions

5 years agosysusers: properly mark generated accounts as locked
Lennart Poettering [Wed, 7 Aug 2019 10:35:29 +0000 (12:35 +0200)]
sysusers: properly mark generated accounts as locked

Previously, we'd only set the shell to /usr/bin/nologin and lock the
password for system users. Let's go one step further and also lock the
whole account.

This is a paranoid safety precaution, since neither disabling the shell
like this nor disabling the password is sufficient to lock an account,
since remote shell tools generally allow passing different shells, and
logins into ftp or similar protocols don't know the shell concept anyway.
Moreover, in times of ssh authentication by password is just one
option of authentication among many.

Takes inspiration from the recommendations in usermod(8)'s -L switch:

    "Note: if you wish to lock the account (not only access with a
    password), you should also set the EXPIRE_DATE to 1."

5 years agoMerge pull request #13298 from RPigott/busctl
Zbigniew Jędrzejewski-Szmek [Wed, 14 Aug 2019 16:18:55 +0000 (18:18 +0200)]
Merge pull request #13298 from RPigott/busctl

zsh: add busctl completions

5 years agohwdb: acceleration mount matrix for a Medion Akoya E3221 (#13310)
EtherGraf [Wed, 14 Aug 2019 16:15:50 +0000 (18:15 +0200)]
hwdb: acceleration mount matrix for a Medion Akoya E3221 (#13310)

5 years agosrc/basic/missing_syscall: change #ifndef to #if ! (defined && > 0)
Dan Streetman [Thu, 25 Jul 2019 11:57:30 +0000 (07:57 -0400)]
src/basic/missing_syscall: change #ifndef to #if ! (defined && > 0)

The #ifndef check used to work for missing __NR_* syscall defines, but
unfortunately libseccomp now redefines missing syscall number to negative
numbers, in their public header file, e.g.:
https://github.com/seccomp/libseccomp/blob/master/include/seccomp.h.in#L801

When systemd is built, since it includes <seccomp.h>, it pulls in the
incorrect negative value for any __NR_* syscall define that's included in
the seccomp.h header (for those syscalls that the kernel headers don't
yet define, e.g. when built with older/stable-distro kernels).  This leads
to bugs like:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1821625

This changes the check so that it can override the negative number that
libseccomp defines, instead of trying to use the negative syscall number.
To avoid gcc warnings (which are failures with meson --werror), this checks
without generating a redefinition gcc warning.

I have no idea why libseccomp decided to define missing syscalls
to negative numbers inside their *public* header file, causing
problems like this.

5 years agoshared/unit-file: fix systemctl cat user@.service
Zbigniew Jędrzejewski-Szmek [Tue, 6 Aug 2019 19:20:07 +0000 (21:20 +0200)]
shared/unit-file: fix systemctl cat user@.service

I assumed that unit_name_to_instnace() returns NULL if there is no instance.
In fact it returns "", so the check for instance was wrong.

Also avoid unnecessary call to unit_name_is_valid().

5 years agoMerge pull request #13302 from yuwata/network-set-put-fixes
Lennart Poettering [Wed, 14 Aug 2019 14:18:06 +0000 (16:18 +0200)]
Merge pull request #13302 from yuwata/network-set-put-fixes

network: fixes related to set_put()

5 years agoMerge pull request #13318 from ddstreet/s390_seccomp
Lennart Poettering [Wed, 14 Aug 2019 14:13:58 +0000 (16:13 +0200)]
Merge pull request #13318 from ddstreet/s390_seccomp

add s390 pkey_mprotect syscall number, and s390 mmap syscall definitions

5 years agocore: Avoid race when starting dbus services
Mattias Jernberg [Thu, 11 Jul 2019 16:13:46 +0000 (18:13 +0200)]
core: Avoid race when starting dbus services

In high load scenarios it is possible for services to be started
before the NameOwnerChanged signal is properly installed.

Emulate a callback by also queuing a GetNameOwner when the match is
installed.

Fixes: #12956

5 years agotest: ppc64* qemu is qemu-system-ppc64
Daniel Black [Wed, 14 Aug 2019 01:48:26 +0000 (11:48 +1000)]
test: ppc64* qemu is qemu-system-ppc64

5 years agohwdb: Fix airplane mode spam on HP Spectre x360 Convertible
Francesco Pennica [Tue, 13 Aug 2019 10:10:56 +0000 (12:10 +0200)]
hwdb: Fix airplane mode spam on HP Spectre x360 Convertible

Added additional rule matching my HP Spectre x360 Convertible from 2015 (skylake)

5 years agoshell-completion: complete --match argument for busctl
Ronan Pigott [Wed, 14 Aug 2019 03:27:56 +0000 (20:27 -0700)]
shell-completion: complete --match argument for busctl

5 years agosrc/shared/seccomp-util.c: Add mmap definitions for s390
Dan Streetman [Thu, 25 Jul 2019 00:48:49 +0000 (20:48 -0400)]
src/shared/seccomp-util.c: Add mmap definitions for s390

5 years agosrc/basic/missing_syscall: add s390 syscall number for __NR_pkey_mprotect
Dan Streetman [Wed, 24 Jul 2019 23:58:48 +0000 (19:58 -0400)]
src/basic/missing_syscall: add s390 syscall number for __NR_pkey_mprotect

The syscall number for s390 was added to the kernel at:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b41c51c8e194c0bdfb4b1778a137aea8246c86cd

5 years agoTODO: add more, and drop implemented stuff
Lennart Poettering [Tue, 13 Aug 2019 12:40:30 +0000 (14:40 +0200)]
TODO: add more, and drop implemented stuff

5 years agotest: store coredumps in journal
Frantisek Sumsal [Mon, 12 Aug 2019 22:14:54 +0000 (00:14 +0200)]
test: store coredumps in journal

To make debugging much easier, especially for crashes in tests under
QEMU, let's store the entire coredump bundle in the systemd journal,
which is usually kept around by various CIs. Right now, we usually end
up with a journal, but without the coredump itself, which is pretty
useless.

5 years agohwdb: Add axis overrides for HP Envy x360 (#13304)
William Wold [Mon, 12 Aug 2019 22:03:55 +0000 (18:03 -0400)]
hwdb: Add axis overrides for HP Envy x360 (#13304)

5 years agoMerge pull request #13303 from yuwata/bootctl-segfaults
Frantisek Sumsal [Mon, 12 Aug 2019 19:16:51 +0000 (19:16 +0000)]
Merge pull request #13303 from yuwata/bootctl-segfaults

bootctl: fix segfaults

5 years agonetworkd: Keep track of static neighbors
William A. Kennington III [Fri, 19 Apr 2019 07:53:34 +0000 (00:53 -0700)]
networkd: Keep track of static neighbors

We need to keep track of the static neighbors that are configured on the
interface so that we can delete stale entries that were removed.

5 years agobootctl: arg_dolloar_boot_path() may return NULL
Yu Watanabe [Sun, 11 Aug 2019 15:05:28 +0000 (00:05 +0900)]
bootctl: arg_dolloar_boot_path() may return NULL