Commit Graph

47921 Commits

Author SHA1 Message Date
Yu Watanabe 55318801ba man: sort specifiers alphabetically 2020-11-25 14:39:10 +09:00
Yu Watanabe 46a3adeef3 man: add missing specifiers supported in [INSTALL] section 2020-11-25 14:38:50 +09:00
Lennart Poettering 2824aa0796 specifiers: introduce common macros for generating specifier tables
In many cases the tables are largely the same, hence define a common set
of macros to generate the common parts.

This adds in a couple of missing specifiers here and there, so is more
thant just refactoring: it actually fixes accidental omissions.

Note that some entries that look like they could be unified under these
macros can't really be unified, since they are slightly different. For
example in the DNSSD service logic we want to use the DNSSD hostname for
%H rather than the unmodified kernel one.
2020-11-25 14:13:02 +09:00
Michael Biebl ff84fadbf1
Merge pull request #17706 from ddstreet/test-move-pam-systemd-user
test/test-functions: copy /usr/lib/pam.d into $initdir
2020-11-24 21:45:12 +01:00
Lennart Poettering 7bfcc0de6a NEWS: mention that we intend to retrigger udev devices on package upgrade
Also, mention RISCV GPT partition types have been defined.
2020-11-24 20:13:48 +01:00
Christoph Ruegge d2e545f88e pam_systemd_home: export password as PAM_AUTHTOK 2020-11-24 17:49:43 +01:00
Lennart Poettering 567fe1d570
Merge pull request #17680 from yuwata/udev-link-mac-address
udev: to make MACAddress= take effect, MACAddressPolicy= must be "none"
2020-11-24 17:42:45 +01:00
Yu Watanabe 11b9105dfd seccomp: also move munmap into @default syscall filter set
Follow-up for 5abede3247.
2020-11-24 16:18:34 +01:00
INSUN PYO cfb6197bc3 sd-device-enumerator: do not return error when a device is removed
If /sys/class/OOO node is created and destroyed during booting (kernle driver initialization fails),
systemd-udev-trigger.service fails due to race condition.

***** race condition ***********************************************************************************
 1. kernel driver create /sys/class/OOO
 2. systemd-udev-trigger.service execues "/usr/bin/udevadm trigger --type=devices --action=add"

 3. device_enumerator_scan_devices() => enumerator_scan_devices_all() => enumerator_scan_dir("class") =>
    opendir("/sys/class") and iterate all subdirs ==> enumerator_scan_dir_and_add_devices("/sys/class/OOO")

 4. kernel driver fails and destroy /sys/class/OOO
 5. enumerator_scan_dir_and_add_devices("/sys/class/OOO") fails in opendir("/sys/class/OOO")

 6. "systemd-udev-trigger.service" fails
 7. udev coldplug fails and some device units not ready
 8. mount units asociated with device units fail
 9. local-fs.target fails
 10. enters emergency mode
********************************************************************************************************

***** status of systemd-udev-trigger.service unit ******************************************************
$ systemctl status systemd-udev-trigger.service
 systemd-udev-trigger.service - udev Coldplug all Devices
   Loaded: loaded (/usr/lib/systemd/system/systemd-udev-trigger.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-01-02 13:16:54 KST; 22min ago
     Docs: man:udev(7)
           man:systemd-udevd.service(8)
  Process: 2162 ExecStart=/usr/bin/udevadm trigger --type=subsystems --action=add (code=exited, status=0/SUCCESS)
  Process: 2554 ExecStart=/usr/bin/udevadm trigger --type=devices --action=add (code=exited, status=1/FAILURE)
  Main PID: 2554 (code=exited, status=1/FAILURE)

  Jan 02 13:16:54 localhost udevadm[2554]: Failed to scan devices: No such file or directory
  Jan 02 13:16:54 localhost systemd[1]: systemd-udev-trigger.service: Main process exited, code=exited, status=1/FAILURE
  Jan 02 13:16:54 localhost systemd[1]: systemd-udev-trigger.service: Failed with result 'exit-code'.
  Jan 02 13:16:54 localhost systemd[1]: Failed to start udev Coldplug all Devices.
*******************************************************************************************************

***** journal log with Environment=SYSTEMD_LOG_LEVEL=debug in systemd-udev-trigger.service  ***********
  Jan 01 21:57:20 localhost udevadm[2039]: sd-device-enumerator: Scanning /sys/bus
  Jan 01 21:57:20 localhost udevadm[2522]: sd-device-enumerator: Scan all dirs
  Jan 01 21:57:20 localhost udevadm[2522]: sd-device-enumerator: Scanning /sys/bus
  Jan 01 21:57:21 localhost udevadm[2522]: sd-device-enumerator: Scanning /sys/class
  Jan 01 21:57:21 localhost udevadm[2522]: sd-device-enumerator: Failed to scan /sys/class: No such file or directory
  Jan 01 21:57:21 localhost udevadm[2522]: Failed to scan devices: No such file or directory
*******************************************************************************************************
2020-11-24 21:38:19 +09:00
Yu Watanabe cd0d230e7b kernel-install: drop redundant "/"
Follow-up for 1cdbff1c84.

After the commit 1cdbff1c84, each entry .conf contains
redundant slash like the following:
```
$ cat xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-5.9.8-200.fc33.x86_64.conf
title      Fedora 33 (Thirty Three)
version    5.9.8-200.fc33.x86_64
machine-id xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
options    root=/dev/nvme0n1p2 ro rootflags=subvol=system/fedora selinux=0 audit=0
linux      //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/5.9.8-200.fc33.x86_64/linux
initrd     //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/5.9.8-200.fc33.x86_64/initrd
```
2020-11-24 11:18:40 +01:00
Yu Watanabe ca91ce3a33 man: bootctl set-default/oneshot accept an empty string 2020-11-24 11:17:37 +01:00
Frantisek Sumsal a2e926a135 Revert "semaphore: temporarily explicitly use the US image mirror"
This reverts commit 9ac47d9261.
2020-11-24 08:56:42 +01:00
Dan Streetman 3965279c67 test/test-functions: copy /usr/lib/pam.d into $initdir
The systemd-user file has been moved from /etc/pam.d into /usr/lib/pam.d,
so test-functions needs to copy it from /usr/lib/pam.d instead.

This will copy it from either location.
2020-11-23 17:17:19 -05:00
Yu Watanabe 6671ff5bad unit: update comment about OOM score
Follow-up for 6b2229c6c6.
2020-11-23 22:21:40 +01:00
Lennart Poettering 4fab57cec5
Merge pull request #17669 from yuwata/coccinelle-update
tree-wide: shorten code a bit suggested by coccinelle
2020-11-23 22:19:52 +01:00
Lennart Poettering e3650d619a
Merge pull request #17676 from yuwata/lgtm-fixes
tree-wide: several fixes prompted by LGTM
2020-11-23 22:18:28 +01:00
Dimitri John Ledkov 499f0f8209 gpt: add RISC-V GPT partition typecode uuid 2020-11-23 22:15:36 +01:00
Etienne Doms 5b639090d0 curl-util: fix callback prototype
CURLMOPT_SOCKETFUNCTION callback is an easy handle, not a multi.
2020-11-23 14:36:28 +01:00
Lennart Poettering 5acd143259
Merge pull request #17685 from yuwata/curl-no-oldies
meson: set CURL_NO_OLDIES in developer mode
2020-11-23 14:36:05 +01:00
Lennart Poettering 37d0d0747f
Merge pull request #17687 from yuwata/use-localtime_or_gmtime_r
use localtime_or_gmtime_r()
2020-11-23 14:35:36 +01:00
Yu Watanabe 8dc1ad04c2 backlight: add several debug logs and adjust log level of non critical error
This may help to investigate issues.
2020-11-23 14:35:14 +01:00
Jörg Thalheim 1d370b2c18 networkd/dhcp6: allow layer3 devices without MAC
Devices with multicast but without mac addresses i.e. tun devices
are not getting setuped correctly:

$ ip tuntap add mode tun dev tun0
$ ip addr show tun0
16: tun0: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 500
    link/none
$ cat /etc/systemd/network/tun0.network
[Match]
Name = tun0

[Network]
Address=192.168.1.1/32
$ ./systemd-networkd
tun0: DHCP6 CLIENT: Failed to set identifier: Invalid argument
tun0: Failed
2020-11-23 13:56:48 +01:00
vanou 207194c67f man: Fix misspelling of directive and typos in systemd-coredump man page
This commit fixes
 * misspelling of LimitCORE directive of systemd.exec
 * typos
in systemd-coredump man page.
2020-11-23 13:49:53 +01:00
Jérémy Nouhaud 18f3bc96f9
hwdb: set fuzz value for lenovo x240 touchpad to improve cursor precision (#17659) 2020-11-23 09:30:08 +10:00
Yu Watanabe f9c443b7a4 logs-show: use localtime_or_gmtime_r() 2020-11-21 04:38:41 +09:00
Yu Watanabe 56b0ef2fc2 timedate: use localtime_or_gmtime_r() and mktime_or_timegm() 2020-11-21 04:28:45 +09:00
Yu Watanabe 435b5ba8d5 meson: set CURL_NO_OLDIES in developer mode 2020-11-21 01:55:41 +09:00
Yu Watanabe 2d052a0a48 curl-util: fix type CURL -> CURLM 2020-11-21 01:55:31 +09:00
Franck Bui 07ccf434e7 units: restore sysfs conditions in sys-fs-fuse-connections.mount and sys-kernel-config.mount
Commit 42cc2855ba incorrectly removed the condition on sysfs in both
sys-fs-fuse-connections.mount and sys-kernel-config.mount. However there are
still needed in case modprobe of one of these modules is intentionally skipped
(due to lack of privs for example).

This patch restores the 2 conditions which should be safe for the common case,
since all conditions are only checked after all deps ordered before are
complete.

Follow-up for 42cc2855ba.
2020-11-21 01:10:17 +09:00
Yu Watanabe db39a62784 core/mount: mount_start() may be called during the state is MOUNT_MOUNTING_DONE
As, both MOUNT_MOUNTING and MOUNT_MOUNTING_DONE are mapped to
UNIT_ACTIVATING.

Fixes #17570.
2020-11-20 16:41:40 +01:00
Franck Bui 428a9f6f1d core: serialize u->pids until the processes have been moved to the scope cgroup
Otherwise if a daemon-reload happens somewhere between the enqueue of the job
start for the scope unit and scope_start() then u->pids might be lost and none
of the processes specified by "PIDs=" will be moved into the scope cgroup.
2020-11-20 15:57:59 +01:00
Yu Watanabe 6ca4a07077 man: to make MACAddress= take effect, MACAddressPolicy= must be "none" 2020-11-20 23:07:21 +09:00
Yu Watanabe a7a12bf404 link-config: warn when MACAddress= is set with MACAddressPolicy=persistent or random 2020-11-20 22:59:12 +09:00
Yu Watanabe d03cb6b85d link-config: make MACAddressPolicy= accept an empty string 2020-11-20 22:59:12 +09:00
Lennart Poettering eebd1c3ad2
Merge pull request #17649 from yuwata/resolve-dnssd-template-name
resolve: ignore invalid service template name
2020-11-20 14:56:59 +01:00
Lennart Poettering cd580a31ae
Merge pull request #17658 from jwrdegoede/hwdb-accel-work
hwdb accel work
2020-11-20 14:49:41 +01:00
Yu Watanabe e23baae0da systemctl: fix potential pointer overflow 2020-11-20 21:58:47 +09:00
Yu Watanabe 45752a2495 tools: drop unnecessary "else" after for loop 2020-11-20 19:47:11 +09:00
Yu Watanabe 48b11b09ab ask-passwd: drop a condition which is always false 2020-11-20 19:42:38 +09:00
Yu Watanabe 283ec78963 resolvectl: drop a condition which is always true 2020-11-20 19:39:49 +09:00
Yu Watanabe 1058390d20 pstore: use log_oom() 2020-11-20 02:59:02 +09:00
Yu Watanabe 0aa8730edc coccinelle: always use SYNTHETIC_ERRNO() macro 2020-11-20 02:59:00 +09:00
Yu Watanabe fed66db05d tree-wide: use return value of log_xxx_errno() 2020-11-20 02:58:27 +09:00
Yu Watanabe a61c0bdf39 coccinelle: add one more rule to use return value of log_xxx_errno() 2020-11-20 02:57:26 +09:00
Lennart Poettering 5abede3247 seccomp: move brk+mmap+mmap2 into @default syscall filter set
These three syscalls are internally used by libc's memory allocation
logic, i.e. ultimately back malloc(). Allocating a bit of memory is so
basic, it should just be in the default set.

This fixes a couple of issues with asan/msan and the seccomp tests: when
asan/msan is used some additional, large memory allocations take place
in the background, and unless mmap/mmap2/brk are allowlisted these will
fail, aborting the test prematurely.
2020-11-19 16:44:50 +01:00
Zbigniew Jędrzejewski-Szmek bca0618705
Merge pull request #17667 from fbuihuu/fix-module-loading-from-udev-rule
Fix module loading from udev rule
2020-11-19 16:35:32 +01:00
Lennart Poettering bb4cbb25d4 man: suffix settings name with = and enclose in <varname> 2020-11-19 16:16:17 +01:00
Franck Bui 42cc2855ba units: wait until some fs modules are entirely loaded before mounting their corresponding filesystem
udev requests to start the fs mount units when their respective module is
loaded. For that it monitors uevents of type "ADD" for the relevant fs modules.

However the uevent is sent by the kernel too early, ie before the init() of the
module is called hence before directories in /sys/fs/ are created.

This patch workarounds adds "Requires/After=modprobe@<fs-module>.service" to
the mount unit, which means that modprobe(8) will be called once the fs module
is announced to be loaded. This sounds pointless, but given that modprobe only
returns after the initialization of the module is complete, it should
workaround the issue.

As a side effect, the module will be automatically loaded if the mount unit is
started manually.

Fixes #17586.
2020-11-19 11:50:52 +01:00
Franck Bui b3e32582f6 Revert "units: skip modprobe@.service if the unit appears to be already loaded"
This reverts commit 9cbf1e58f9.

The presence of /sys/module/%I directory can't be used to assert that the load
of a given module is complete and therefore the call to modprobe(8) can be
skipped. Indeed this directory is created before the init() function of the
module is called.

Users of modprobe@.service needs to be sure that once this service returns the
module is fully operational.
2020-11-19 09:49:42 +01:00
Hans de Goede 86de5e4239 hwdb: Add accel orientation quirk for Acer Aspire Switch 10 SW3-016 2-in-1
Add a quirk to fix the accelerometer orientation on the
Acer Aspire Switch 10 SW3-016 2-in-1.
2020-11-18 21:23:35 +01:00