Commit Graph

41477 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek db11487d10 manager: put bin before sbin for user instances
Traditionally, user logins had a $PATH in which /bin was before /sbin, while
root logins had a $PATH with /sbin first. This allows the tricks that
consolehelper is doing to work. But even if we ignore consolehelper, having the
path in this order might have been used by admins for other purposes, and
keeping the order in user sessions will make it easier the adoption of systemd
user sessions a bit easier.

Fixes #733.
https://bugzilla.redhat.com/show_bug.cgi?id=1744059

OOM handling in manager_default_environment wasn't really correct.
Now the (theorertical) malloc failure in strv_new() is handled.

Please note that this has no effect on:
- systems with merged /bin-/sbin (e.g. arch)

- when there are no binaries that differ between the two locations.

  E.g. on my F30 laptop there is exactly one program that is affected:
  /usr/bin/setup -> consolehelper.

  There is less and less stuff that relies on consolehelper, but there's still
  some.

So for "clean" systems this makes no difference, but helps with legacy setups.

$ dnf repoquery --releasever=31 --qf %{name} --whatrequires usermode
anaconda-live
audit-viewer
beesu
chkrootkit
driftnet
drobo-utils-gui
hddtemp
mate-system-log
mock
pure-ftpd
setuptool
subscription-manager
system-config-httpd
system-config-rootpassword
system-switch-java
system-switch-mail
usermode-gtk
vpnc-consoleuser
wifi-radar
xawtv
2019-08-27 18:24:44 +02:00
Zbigniew Jędrzejewski-Szmek 581fef8d56 core: stop removing non-existent and duplicate lookup paths
When we would iterate over the lookup paths for each unit, making the list as
short as possible was important for performance. With the current cache, it
doesn't matter much. Two classes of paths were being removed:
- paths which don't exist in the filesystem
- paths which symlink to a path earlier in the search list
Both of those points cause problems with the caching code:
- if a user creates a directory that didn't exist before and puts units there,
  now we will notice the new mtime an properly load the unit. When the path
  was removed from list, we wouldn't.
- we now properly detect whether a unit path is on the path or not.
  Before, if e.g. /lib/systemd/system, /usr/lib/systemd/systemd were both on
  the path, and /lib was a symlink to /usr/lib, the second directory would be
  pruned from the path. Then, the code would think that a symlink
  /etc/systemd/system/foo.service→/lib/systemd/system/foo.service is an alias,
  but /etc/systemd/system/foo.service→/usr/lib/systemd/system/foo.service would
  be considered a link (in the systemctl link sense).

Removing the pruning has a slight negative performance impact in case of
usr-merge systems which have systemd compiled with non-usr-merge paths.
Non-usr-merge systems are deprecated, and this impact should be very small, so
I think it's OK. If it turns out to be an issue, the loop in function that
builds the cache could be improved to skip over "duplicate" directories with
same logic that the cache pruning did before. I didn't want to add this,
becuase it complicates the code to improve a corner case.

Fixes #13272.
2019-08-27 18:12:20 +02:00
Yu Watanabe 6c431a16c3
Merge pull request #13382 from keszybz/network-ipv6-enable
Network ipv6 enable
2019-08-28 00:29:29 +09:00
Zbigniew Jędrzejewski-Szmek 57ad760746 network: drop all checks of ipv6_disabled sysctl
*We* control the sysctl setting. If the user configured IPv6, then we apply the
settings, and just make sure that at some point during the configuration the
sysctl is disabled (i.e. ipv6 enabled) if we have IPv6 configured.

Replaces #13283.
2019-08-27 15:31:48 +02:00
Zbigniew Jędrzejewski-Szmek fef40ceb5d
Merge pull request #13402 from jwrdegoede/accel-quirks
hwdb: Accel quirks for 2 devices
2019-08-27 08:52:49 +02:00
VD-Lycos c0b62cd6a7 Add accel mount matrix for Medion Akoya E2293
Add ACCEL_MOUNT_MATRIX for Medion Akoya E2293 MD61130
2019-08-26 11:17:05 +03:00
Dan Streetman 58c1a34437 test/TEST-10-ISSUE-2467: remove testsuite.service TimeoutStartSec
This test runs under qemu, which may run on some testbeds without
acceleration; in those cases, a 10s timeout is frequently too short.

Simply removing the timeout to allow the default timeoutsec should
be enough time for the test to finish, even on very slow testbeds.
2019-08-26 12:47:15 +09:00
Dan Streetman 65c5f3d074 test/TEST-18-FAILUREACTION: fix typo to actually run firstphase action
The if test for running the firstphase of the test should be negated
so the firstphase is actually executed.
2019-08-26 12:46:39 +09:00
Hans de Goede 38c865648d hwdb: Add accel. mount matrix and location for the Trekstor Primebook C11B
The Trekstor Primebook C11B 2-in-1 has 2 accelerometers. Add mount-matrix
and location info for both to 60-sensor.hwdb.
2019-08-25 20:36:54 +02:00
Hans de Goede 7b04c7af10 hwdb: Add accel location quirk for the GPD win
The acceleromater in the GPD win is in the base, mark it as such so that
iio-sensor-proxy does not try to use it for display rotation.

Note as mentioned in the added comment the DMI strings are unfortunately
somewhat generic, but the combination of using all DMI strings including
the BIOS build data + the sensor modalias should be unique enough.
2019-08-25 20:36:54 +02:00
Dan Streetman adcc450f46 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.
2019-08-25 15:37:51 +09:00
Dan Streetman 84c49ad197 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.
2019-08-25 15:36:47 +09:00
Evgeny Vereshchagin e0eefa50a3 semaphore: switch back to the master branch 2019-08-24 10:06:48 +03:00
Arian van Putten d527ebef88 Fix typo in sd_event_set_watchdog manpage (#13393) 2019-08-24 15:16:44 +09:00
Zbigniew Jędrzejewski-Szmek f21e2ecb8b NEWS: update contributors list 2019-08-22 13:47:11 +02:00
Zbigniew Jędrzejewski-Szmek 52720867ff hwdb: update for v243-rc2
Diff on the hwdb/*.hwdb files shows that again, this is only additions and
minor corrections.
2019-08-22 13:43:50 +02:00
Arian van Putten 0e4a4f56be 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.
2019-08-22 13:39:54 +02:00
Susant Sahani 482efedc08 network: Do not disable IPv6 by writing to sysctl
Only enable is and do not disable IPv6
2019-08-22 13:21:57 +02:00
Anita Zhang 23f8fbb303 core: TAKE_PTR in timer_add_one_calendar_spec
Introduced in d00a52c

Fixes #13373
2019-08-22 11:02:56 +02:00
Hans de Goede 1262ecb983 hwdb: add sensor location for HP ProBook4535s
https://bugzilla.redhat.com/show_bug.cgi?id=1717712
2019-08-22 11:00:35 +02:00
Lennart Poettering 2ec71e439f 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)
2019-08-22 10:02:28 +02:00
Zbigniew Jędrzejewski-Szmek d0696f3b75
Merge pull request #13365 from keszybz/fix-commits-from-pr-13246
Fix commits from #13246
2019-08-22 09:13:25 +02:00
Albrecht Lohofener 4b1b33f4a1 Add Chuwi Hi10 to 60-sensor.hwdb (#13351) 2019-08-22 09:12:31 +02:00
Zbigniew Jędrzejewski-Szmek 5cc2cd1cd8 pid1: always log successfull process termination quietly
Fixes #13372.
2019-08-22 09:09:45 +02:00
Lennart Poettering 2de1ce6838
Merge pull request #13368 from keszybz/close-watchdog
shared/watchdog: close watchdog device when done with it
2019-08-21 15:36:02 +02:00
Zbigniew Jędrzejewski-Szmek 4dba44a5a5 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.
2019-08-21 15:35:21 +02:00
Zbigniew Jędrzejewski-Szmek 1fedf13839 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.
2019-08-20 21:15:13 +02:00
Zbigniew Jędrzejewski-Szmek ba90388221
Merge pull request #13367 from poettering/null-console-fixes
Fixes inspired by console=null
2019-08-20 21:13:36 +02:00
Lennart Poettering 8c3dfa7d47 fsck: add logging and fix error codes where appropriate 2019-08-20 17:35:06 +02:00
Lennart Poettering ea7584329b 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
2019-08-20 17:34:19 +02:00
Lennart Poettering 4a8daee72f load-fragment: use path_join() where appropriate 2019-08-20 17:32:34 +02:00
Lennart Poettering d5a1c99b25 log: don't invalidate open console fd if we can't open a new one 2019-08-20 17:32:17 +02:00
Lennart Poettering 9281e70375 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
2019-08-20 17:30:17 +02:00
Lennart Poettering e11a5c72ba log: cast various log_open() calls to (void) 2019-08-20 17:29:49 +02:00
Lennart Poettering 97e5cc8818 update TODO 2019-08-20 16:21:01 +02:00
Lennart Poettering 48a81b20ab
Merge pull request #13360 from keszybz/udev-watch-more
udev: set "watch" for more devices
2019-08-20 13:55:47 +02:00
Zbigniew Jędrzejewski-Szmek be440e094c id128: actually support --pretty
We must be all lazy, at least I know I always used -p ;).
2019-08-20 12:01:23 +02:00
Zbigniew Jędrzejewski-Szmek a83577fa66 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.
2019-08-20 12:01:23 +02:00
Zbigniew Jędrzejewski-Szmek 8788a56863 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.
2019-08-20 12:01:23 +02:00
Zbigniew Jędrzejewski-Szmek 9fc879d415 basic/build.h: fix typo 2019-08-20 12:01:23 +02:00
Kai Krakow 2dbc45aea7 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.

Github-Link: https://github.com/systemd/systemd/issues/7057
Signed-off-by: Kai Krakow <kai@kaishome.de>
2019-08-20 11:50:59 +02:00
Lennart Poettering 06e93130b4
Merge pull request #13356 from keszybz/static-nodes-perms
Fix permissions on static nodes
2019-08-19 18:02:46 +02:00
Lennart Poettering 344edf1056
Merge pull request #13353 from keszybz/analyze-cat-config-relabel-extra.d
systemd-analyze cat-config relabel-extra.d/
2019-08-19 15:38:00 +02:00
Zbigniew Jędrzejewski-Szmek 1f9290fcc4 tmpfiles: override permissions of static nodes that need this
Fixes #13350.
2019-08-19 12:08:14 +02:00
Zbigniew Jędrzejewski-Szmek a8fb09f573 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.
2019-08-19 11:10:40 +02:00
Zbigniew Jędrzejewski-Szmek 265c14cd40 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.
2019-08-19 11:05:58 +02:00
Zbigniew Jędrzejewski-Szmek 81d791f158 analyze: make cat-config work with relabel-extra.d 2019-08-19 10:20:01 +02:00
Zbigniew Jędrzejewski-Szmek 4c70211c5a systemctl: use unicode in one more place 2019-08-19 10:17:49 +02:00
Zbigniew Jędrzejewski-Szmek bcf09321c9 man: owned to → owned by 2019-08-19 10:17:46 +02:00
Zbigniew Jędrzejewski-Szmek 4eaa2486b8
Merge pull request #13235 from yuwata/network-routing-policy-rule-family-13233
network: add RoutingPolicyRule.Family= setting
2019-08-19 10:08:23 +02:00