Commit Graph

45275 Commits

Author SHA1 Message Date
Lennart Poettering 4c150809eb update TODO 2020-06-10 18:37:00 +02:00
Frantisek Sumsal e47add9edc test: make TEST-02-CRYPTSETUP a bit more robust
Prompted by systemd/systemd#16111.

* check if /var is a mountpoint - if not, something went wrong. In case
  of systemd/systemd#16111 the /failed file was created, because
  systemd-cryptsetup failed, but it ended up being empty, making the result
  check incorrectly pass
* forward journal messages to console - if we fail to mount /var,
  journald won't flush logs to the persistent storage and we end up
  empty handed and with no clue what went wrong

For example, without systemd/systemd#16111 and with this patch:
...
[FAILED] Failed to start systemd-cryptsetup@varcrypt.service.
See 'systemctl status systemd-cryptsetup@varcrypt.service' for details.
[DEPEND] Dependency failed for cryptsetup.target.
...
[    3.882451] systemd-cryptsetup[581]: Key file /etc/varkey is world-readable. This is not a good idea!
[    3.883946] systemd-cryptsetup[581]: WARNING: Locking directory /run/cryptsetup is missing!
[    3.884846] systemd-cryptsetup[581]: Failed to load Bitlocker superblock on device /dev/disk/by-uuid/180ba5ef-873b-4018-9968-47c23431f71a: Invalid argument
...
[    4.099451] sh[606]: + mountpoint /var
[    4.100025] sh[603]: + systemctl poweroff --no-block
[    4.101636] systemd[1]: Finished systemd-user-sessions.service.
[    4.102598] sh[608]: /var is not a mountpoint
[FAILED] Failed to start testsuite-02.service.
2020-06-10 17:42:25 +02:00
Anita Zhang bb9244781c core: don't consider SERVICE_SKIP_CONDITION for abnormal or failure restarts
Fixes: #16115
2020-06-10 17:12:55 +02:00
David Edmundson 6a881daf85 docs: Change suffix for desktop applications to support non-transient services
One problem found with the current draft specification is we can't have
an application provide a non-transient systemd service file in a way
that is spec compliant as the service name currently needs to end in a
random token defined by the launcher.

This came up when trying to put DBus activated services into the correct
cgroup. There isn't enough metadata in the DBus service file to know the
correct application ID, and the most intuitive fix is for those
applications to just specify the SystemdService file in the existing
system. They're generally unique for a given user session anyway so
don't need a separate cgroup identifier.

This changes the spec for RANDOM to be optional for services.

It also changes the separator between in services to act like templates.
Ultimately that's what we're trying to recreate with the RANDOM token of
the systemd service and it's a better fit. It's needed as otherwise with
launcher and the random ident being both optional it would be impossible
to get the application ID reliably.

Scopes are unchanged as they don't support templates.
2020-06-10 17:10:57 +02:00
Lennart Poettering 97033ba455 pager: set PR_DEATHSIG for pager to SIGINT rather than SIGTERM
"less" doesn't properly reset its terminal on SIGTERM, it does so only
on SIGINT. Let's thus configure SIGINT instead of SIGTERM.

I think this is something less should fix too, and clean up things
correctly on SIGTERM, too. However, given that we explicitly enable
SIGINT behaviour by passing "K" to $LESS I figure it makes sense if we
also send SIGINT instead of SIGTERM to match it.

Fixes: #16084
2020-06-10 10:31:22 +02:00
Lennart Poettering c85b6ff1b2 docs: point contributors to list of most recent systemd releases
Fixes: #16083
2020-06-10 10:30:02 +02:00
Zbigniew Jędrzejewski-Szmek 51b367b86d
Merge pull request #16111 from poettering/bitlck-fix
bitlocker cryptsetup fix
2020-06-10 10:25:36 +02:00
Zbigniew Jędrzejewski-Szmek 9664be199a
Merge pull request #16118 from poettering/inaccessible-fixlets
move $XDG_RUNTIME_DIR/inaccessible/ to $XDG_RUNTIME_DIR/systemd/inaccessible
2020-06-10 10:23:13 +02:00
Zbigniew Jędrzejewski-Szmek 2befe404d4
Merge pull request #16120 from poettering/udevd-fixlets
minor udev fixlets
2020-06-10 10:18:36 +02:00
Zbigniew Jędrzejewski-Szmek 02939ee001
Merge pull request #16087 from mrc0mmand/travis-build-check
travis: check build with various compiler options
2020-06-10 09:06:14 +02:00
Lennart Poettering dad28bffd6 tree-wide: check POLLNVAL everywhere
poll() sets POLLNVAL inside of the poll structures if an invalid fd is
passed. So far we generally didn't check for that, thus not taking
notice of the error. Given that this specific kind of error is generally
indication of a programming error, and given that our code is embedded
into our projects via NSS or because people link against our library,
let's explicitly check for this and convert it to EBADF.

(I ran into a busy loop because of this missing check when some of my
test code accidentally closed an fd it shouldn't close, so this is a
real thing)
2020-06-10 08:57:31 +02:00
Frantisek Sumsal dfa64b64a7 tree-wide: mark assert()-only variables as unused
to make a compilation with -Db_ndebug=true and --werror pass once again.
2020-06-09 21:31:10 +02:00
Frantisek Sumsal b36746c90e travis: check build with various compiler options
In the past we occasionally stumbled upon a build issue which could be
reproduced only with specific optimization level or other compilation
option. Let's try to build the current revision with several most common
compiler options causing such issues to catch them early.
2020-06-09 21:27:07 +02:00
Daan De Meyer 45204921be
Merge pull request #16104 from ssahani/dhcpv6-iaid
networkctl: Display DHCPv6 IAID
2020-06-09 21:18:28 +02:00
YmrDtnJu 2ffadd3cee AppArmor: Support for loading a set of pre-compiled profiles at startup time
Let systemd load a set of pre-compiled AppArmor profile files from a policy
cache at /etc/apparmor/earlypolicy. Maintenance of that policy cache must be
done outside of systemd.

After successfully loading the profiles systemd will attempt to change to a
profile named systemd.

If systemd is already confined in a profile, it will not load any profile files
and will not attempt to change it's profile.

If anything goes wrong, systemd will only log failures. It will not fail to
start.
2020-06-09 20:27:47 +02:00
Lennart Poettering d689f0f20a
Merge pull request #16058 from Werkov/fix-memory-protection-default
Fix memory protection default setting
2020-06-09 20:02:53 +02:00
Lennart Poettering 4f4f37b20d
Merge pull request #16046 from bluca/dissect_squashfs_verity
dissect: single-filesystem verity images with external hashdevice
2020-06-09 19:52:21 +02:00
Yigal Korman 2233c2703c man: udevadm: mention non-zero exit code on settle
'udevadm settle --timeout=XY' will return 1 in case the timeout was
reached and the event queue was not empty.
The manpage should mention it.
2020-06-09 17:31:49 +02:00
Yu Watanabe 60b316b1e9 test-network: wait 2min for the bridge being in configured state
On some CIs, it may takes more than 40 seconds.

Hopefully fixes #16105.
2020-06-09 17:19:22 +02:00
Chris Down 69876f94ab doc: Try to clarify automount dependency confusion
Arch recently upgraded systemd to 245.6. Shortly afterwards, users began
reporting[0] that systemd detected an ordering cycle, and they were
unable to log in. The reason they were unable to log in was because of
ordering cycle resolution:

    [...]
    systemd[1]: sysinit.target: Job systemd-tmpfiles-setup.service/start deleted to break ordering cycle starting with sysinit.target/start
    systemd[1]: sysinit.target: Job systemd-update-done.service/start deleted to break ordering cycle starting with sysinit.target/start
    systemd[1]: sysinit.target: Job systemd-journal-catalog-update.service/start deleted to break ordering cycle starting with sysinit.target/start
    systemd[1]: sysinit.target: Job local-fs.target/start deleted to break ordering cycle starting with sysinit.target/start
    systemd[1]: sysinit.target: Job systemd-tmpfiles-setup.service/start deleted to break ordering cycle starting with sysinit.target/start
    [...]

Whether the resolution did the right thing here or not is a longer-term
discussion, but in the interim we should at least make this distinction
between automount dependencies and mount dependencies clearer in the
documentation, so that users and distribution maintainers know what's
acceptable. In this case Arch actually backed out b3d7aef5 entirely and
released a new version due to the confusion.

Also see https://github.com/systemd/systemd-stable/issues/69.

0: https://bugs.archlinux.org/task/66908
2020-06-09 17:13:59 +02:00
Michał Bartoszkiewicz fa0e23c900 docs: use bool in varlink interface definition
Boolean type in varlink is named bool, not boolean.
2020-06-09 17:11:38 +02:00
Lennart Poettering 48b747fa03 inaccessible: move inaccessible file nodes to /systemd/ subdir in runtime dir always
Let's make sure $XDG_RUNTIME_DIR for the user instance and /run for the
system instance is always organized the same way: the "inaccessible"
device nodes should be placed in a subdir of either called "systemd" and
a subdir of that called "inaccessible".

This way we can emphasize the common behaviour, and only differ where
really necessary.

Follow-up for #13823
2020-06-09 16:23:56 +02:00
Lennart Poettering b8c9074534 login: use ERRNO_IS_PRIVILEGE() where appropriate 2020-06-09 16:13:51 +02:00
Lennart Poettering d582afe144 mkdir: use log_full_errno() where appropriate 2020-06-09 16:13:16 +02:00
Lennart Poettering 6b2229c6c6 udev: set fewer process properties
On systemd systems we generally don't need to chdir() to root, we don't
need to setup /dev/ ourselves (as PID 1 does that during earliest boot),
and we don't need to set the OOM adjustment values, as that's done via
unit files.

Hence, drop this. if people want to use udev from other init systems
they should do this on their own, I am very sure it's a good thing to do
it from outside of udevd, so that fewer privileges are required by udevd. In
particular the dev_setup() stuff is something that people who build
their own non-systemd distros want to set up themselves anyway, in
particular as they already have to mount devtmpfs themselves anyway.

Note that this only drops stuff that isn't really necessary for testing
stuff, i.e. process properties and settings that don't matter if you
quickly want to invoke udev from a terminal session to test something.
2020-06-09 15:40:20 +02:00
Lennart Poettering fe56acd8e0 udevd: use cpus_in_affinity_mask()
Let's make use of our own helpers. This has the benefit that we can deal
with arbitrarily sized affinity masks.
2020-06-09 15:39:53 +02:00
Lennart Poettering 57b611a5bf
Merge pull request #16074 from msekletar/freezer-test-flakes
Freezer test flakes
2020-06-09 14:38:40 +02:00
Lennart Poettering 6930d069a3 cryptsetup: pass selected mode to crypt_load() when doing LUKS
This doesn't fix anything IRL, but is a bit cleaner, since it makes sure
that arg_type is properly passed to crypt_load() in all cases.

We actually never set arg_type to CRYPT_LUKS2, which is why this wasn't
noticed before, but theoretically this might change one day, and
existing comments suggest it as possible value for arg_type, hence let's
process it properly.
2020-06-09 14:24:21 +02:00
Lennart Poettering 5af39ac850 cryptsetup: try to load bitlocker superblock only if requested
let's do automatic discovery only for our native LUKS/LUKS2 headers,
since they are Linux stuff, and let's require that BitLocker to be
requested explicitly.

This makes sure cryptsetup without either "luks" nor "bitlk" in the
option string will work. Right now it would fail because we'd load the
superblock once with luks and once with bitlk and one of them would
necessarily fail.

Follow-up for #15979
2020-06-09 14:24:15 +02:00
Yegor Vialov 8b8ae7959d
hwbd entry for Dell Inspiron Chromebook 14 2-in-1 sensor (#16109) 2020-06-09 13:31:58 +02:00
Adam Nielsen f01994380e login: allow individual USB ports to be assigned to seats
Assigning seats to specific USB ports lets the devices plugged into them
inherit the port's seat assignment.
2020-06-09 13:30:59 +02:00
Luca Boccassi e7cbe5cb9e dissect: support single-filesystem verity images with external verity hash
dm-verity support in dissect-image at the moment is restricted to GPT
volumes.
If the image a single-filesystem type without a partition table (eg: squashfs)
and a roothash/verity file are passed, set the verity flag and mark as
read-only.
2020-06-09 12:19:21 +01:00
Susant Sahani 331ee15f18 networkctl: DHCPv6 - display IAID 2020-06-09 19:58:36 +09:00
Susant Sahani 01dd138031 sd-network: Introduce API to get DHCPv6 IAID 2020-06-09 19:58:36 +09:00
Susant Sahani 18d8a2cf30 network: DHCPv6 - export IAID to state file 2020-06-09 19:58:31 +09:00
Susant Sahani d69d4038ec dhcp6: Provide method to access IAID 2020-06-09 19:57:38 +09:00
Lennart Poettering ed66590d15
Merge pull request #16080 from YmrDtnJu/9p
9p is a network filesystem
2020-06-09 10:51:20 +02:00
Jan Klötzke bf76080180 core: let user define start-/stop-timeout behaviour
The usual behaviour when a timeout expires is to terminate/kill the
service. This is what user usually want in production systems. To debug
services that fail to start/stop (especially sporadic failures) it
might be necessary to trigger the watchdog machinery and write core
dumps, though. Likewise, it is usually just a waste of time to
gracefully stop a stuck service. Instead it might save time to go
directly into kill mode.

This commit adds two new options to services: TimeoutStartFailureMode=
and TimeoutStopFailureMode=. Both take the same values and tweak the
behavior of systemd when a start/stop timeout expires:

 * 'terminate': is the default behaviour as it has always been,
 * 'abort': triggers the watchdog machinery and will send SIGABRT
   (unless WatchdogSignal was changed) and
 * 'kill' will directly send SIGKILL.

To handle the stop failure mode in stop-post state too a new
final-watchdog state needs to be introduced.
2020-06-09 10:04:57 +02:00
Lennart Poettering 8b5616fa91
Merge pull request #16073 from keszybz/shell-completion
Bash completion for homectl and help improvement for kernel-install
2020-06-09 09:33:41 +02:00
Lennart Poettering d3d0b763b4
Merge pull request #15953 from keszybz/gdb-script
Update gdb script to match current sources and other hashmap improvements
2020-06-09 09:31:49 +02:00
Lennart Poettering 5a36324962
Merge pull request #16047 from poettering/udev-ro-block
udev: optionally mark all block devices popping up read-only by default
2020-06-09 09:09:32 +02:00
Lennart Poettering 707dc7949c update TODO 2020-06-09 08:54:48 +02:00
Yu Watanabe a4d1bef73f
Merge pull request #16085 from ssahani/network-client-id
networkctl: add support to display DHCPv4 client ID
2020-06-09 15:30:23 +09:00
Maxim Fomin 6cc27c29ad Add 'bitlk' option to mount Bitlocker drives with cryptsetup. 2020-06-09 08:12:55 +02:00
YmrDtnJu c15ab81ed9
mount-tool: Replace fstype_is_{network,api_vfs} with fstype_is_blockdev_backed
Not every filesystem that is not a network filesystem and also not an API VFS
filesystem has a corresponding block device.
2020-06-08 19:36:42 +02:00
YmrDtnJu ac2474e4ff
basic: New function fstype_is_blockdev_backed for fstypes that need a blockdev
The function returns true if the specified filesystem requires a block device.
2020-06-08 19:36:42 +02:00
Niccolò Maggioni b11e98037c hwdb: add HP Spectre x360's mic mute switch
Tested on HP Spectre x360 Convertible 13-aw0xxx
2020-06-08 18:15:20 +02:00
Lennart Poettering b1481b2092
Merge pull request #16092 from yuwata/network-accept-local-16090
network: introduce IPv4AcceptLocal= setting
2020-06-08 18:15:03 +02:00
Lennart Poettering a34a2933e9 man: single-char parameters take no '='
The suggested syntax is simply not valid and results in an error.
2020-06-08 16:53:37 +02:00
Lennart Poettering 048b4dc2e1 units: tweak udev unit descriptions 2020-06-08 16:53:37 +02:00