Commit graph

46099 commits

Author SHA1 Message Date
Lennart Poettering b10fd796f5 user-util: add mangle_gecos() call for turning strings into fields suitable as GECOS fields 2020-08-07 17:36:11 +02:00
Matt Fenwick c1c28fe2f7 fix typo in systemctl help 2020-08-07 16:57:28 +02:00
Zbigniew Jędrzejewski-Szmek 992aa67231
Merge pull request #16604 from poettering/tmpfiles-image
add --image= switch to tmpfiles, sysusers, journalctl
2020-08-07 10:08:42 +02:00
Lennart Poettering e3eec1fd10 journalctl: in "-o cat" mode show color
Let's provide a modicum of niceness, even in this barebones mode.

Fixes: #16232
2020-08-07 10:05:13 +02:00
Lennart Poettering bbac7da2b3 units: order systemd-user-sessions.service after home.mount
This should make /home as automount work reasonably well.

If /home is an automount this has little effect at boot, because if the
automount is not triggered it doesn't matter how the associated mount is
ordered.

It does matter at shutdown however, where home.mount is likely active
now. There the ordering means we'll end sessions first, and only then
deactivate home.mount.

Fixes: #16291
2020-08-07 10:02:05 +02:00
Lennart Poettering fdc6c4f49c update TODO 2020-08-07 00:02:29 +02:00
Lennart Poettering a6991726f8 man: clarify that LogNamespace= is for system services only
Fixes: #16638
2020-08-06 18:24:11 +02:00
Zbigniew Jędrzejewski-Szmek f1cc283a5a
Merge pull request #16321 from bluca/mount_images
core: new feature MountImages
2020-08-06 18:23:03 +02:00
Kamil Dudka 4191b3282a _sd-common.h: avoid parsing errors with Coverity
The commit 1070d271fa which was supposed
too fix this does not seem to take effect any more.  We get again 34%
compilation success rate while scanning systemd itself.  Moreover, the
installed header file breaks compilation of programs that include it:

"/usr/include/systemd/_sd-common.h", line 23: error #35: #error directive: "Do
          not include _sd-common.h directly; it is a private header."
  #  error "Do not include _sd-common.h directly; it is a private header."
     ^
2020-08-06 16:26:57 +02:00
Lennart Poettering fc733bed3b update TODO 2020-08-06 14:08:59 +02:00
Luca Boccassi b3d133148e core: new feature MountImages
Follows the same pattern and features as RootImage, but allows an
arbitrary mount point under / to be specified by the user, and
multiple values - like BindPaths.

Original implementation by @topimiettinen at:
https://github.com/systemd/systemd/pull/14451
Reworked to use dissect's logic instead of bare libmount() calls
and other review comments.
Thanks Topi for the initial work to come up with and implement
this useful feature.
2020-08-05 21:34:55 +01:00
Luca Boccassi a082edd53a strv: add strv_split_colon_pairs function
Given a string in the format 'one:two three four:five', returns a string
vector with each word. If the second element of the tuple is not
present, an empty string is returned in its place, so that the vector
can be processed in pairs.

[zjs: use EXTRACT_UNESCAPE_SEPARATORS instead of EXTRACT_CUNESCAPE_RELAX.
This way we do escaping exactly once and in normal strict mode.]
2020-08-05 21:29:13 +01:00
Zbigniew Jędrzejewski-Szmek 1e198efcdb basic/extract-word: add EXTRACT_UNESCAPE_SEPARATORS mode
This allows separators to be escaped, for example to allow
"a\🅱️c", to be treated as "a:b", "c" with ":" as the separator.
2020-08-05 21:29:13 +01:00
Lennart Poettering 612d3a68d6 update TODO 2020-08-05 20:34:58 +02:00
Lennart Poettering 71b1d2ded1 man: document the new --image= switches in journalctl/sysusers/tmpfiles 2020-08-05 20:34:58 +02:00
Lennart Poettering cc171228d4 journalctl: add --image= switch 2020-08-05 20:34:58 +02:00
Lennart Poettering 0c3ee12737 sysusers: add support for a --image= switch 2020-08-05 20:34:58 +02:00
Lennart Poettering 63d3d0a50b tmpfiles: support --image= similar to --root= 2020-08-05 20:34:58 +02:00
Lennart Poettering 6aa05ebdd8 firstboot: move --image= logic into common code
That way we can reuse it in tmpfiles/sysusers/journalctl and so on.
2020-08-05 20:34:58 +02:00
Luca Boccassi 866fdcceb4 test: add another test case for extract_many_words
Covers some functionality that we want to use for config tuples
2020-08-05 19:28:55 +01:00
Lennart Poettering b8e35011f7 tmpfiles: properly prefix paths in debug outputs
This is otherwise very confusing...
2020-08-05 20:26:25 +02:00
Lennart Poettering b63aacaa1a tmpfiles: we don't support the combination of --root and --user, hence refuse it
--user only really works with certain env vars such as XDG_RUNTIME_DIR
set, but that's just weird if --root= is used.
2020-08-05 20:26:25 +02:00
Lennart Poettering dd04fb3268 tmpfiles: add new switch -E for quickly excluding /proc, /dev, /sys and /run 2020-08-05 20:26:25 +02:00
Zbigniew Jędrzejewski-Szmek 28365e88d0 analyze: fix 'cat-config systemd/zram-generator.conf'
Also makes this work for various systemd config files that support .d.
2020-08-05 20:23:52 +02:00
Axel Rasmussen a119185c02 selinux: improve comment about getcon_raw semantics
This code was changed in this pull request:
https://github.com/systemd/systemd/pull/16571

After some discussion and more investigation, we better understand
what's going on. So, update the comment, so things are more clear
to future readers.
2020-08-05 20:20:45 +02:00
Marc Kleine-Budde 3f449f2106 Update DISCOVERABLE_PARTITIONS.md
This patch fixes a typo in the link to the systemd-id128 documentation.
2020-08-05 19:55:26 +02:00
Lennart Poettering 1efe30ded3
Merge pull request #16556 from keszybz/test-terminal-colors
Test terminal colors
2020-08-05 09:35:16 +02:00
Anita Zhang fe01daee67
Merge pull request #16650 from keszybz/two-doc-updates
Two doc updates
2020-08-04 18:05:38 -07:00
Zbigniew Jędrzejewski-Szmek fea4ac42e3
Merge pull request #16652 from eliroca/adapt-tests-for-SUSE
Adapt tests to work on SUSE
2020-08-04 17:13:28 +02:00
Lennart Poettering f01da474d1 update TODO 2020-08-04 16:47:40 +02:00
Zbigniew Jędrzejewski-Szmek d06bd2e785 Merge pull request #16596 from poettering/event-time-rel
Conflict in src/libsystemd-network/test-ndisc-rs.c fixed manually.
2020-08-04 16:07:03 +02:00
Zbigniew Jędrzejewski-Szmek 1472b58835
Merge pull request #16260 from poettering/pcre2-dlopen
turn pcre2 dependency into dlopen() dependency
2020-08-04 15:37:48 +02:00
Zbigniew Jędrzejewski-Szmek 3a4378cb9e
Merge pull request #16145 from poettering/qrcode-dlopen
journalctl: make libqrencode a weak (dlopen() style) dependency
2020-08-04 15:25:50 +02:00
Lennart Poettering 11579a956d home: use ID128_UUID_STRING_MAX where appropriate 2020-08-04 12:40:34 +02:00
Joerg Behrmann c90b6abc91 docs: spelling fixes 2020-08-04 12:39:03 +02:00
Lennart Poettering 99fca0d3fe update TODO 2020-08-04 08:58:01 +02:00
Zbigniew Jędrzejewski-Szmek 94efaa3181 core: reset bus error before reuse
From a report in https://bugzilla.redhat.com/show_bug.cgi?id=1861463:
usb-gadget.target: Failed to load configuration: No such file or directory
usb-gadget.target: Failed to load configuration: No such file or directory
usb-gadget.target: Trying to enqueue job usb-gadget.target/start/fail
usb-gadget.target: Failed to load configuration: No such file or directory
Assertion '!bus_error_is_dirty(e)' failed at src/libsystemd/sd-bus/bus-error.c:239, function bus_error_setfv(). Ignoring.
sys-devices-platform-soc-2100000.bus-2184000.usb-ci_hdrc.0-udc-ci_hdrc.0.device: Failed to enqueue SYSTEMD_WANTS= job, ignoring: Unit usb-gadget.target not found.

I *think* this is the place where the reuse occurs: we call
bus_unit_validate_load_state(unit, e) twice in a row.
2020-08-03 17:54:32 +02:00
Elisei Roca 491b736a49 test: adapt TEST-13-NSPAWN-SMOKE for SUSE 2020-08-03 17:41:29 +02:00
Elisei Roca ef8b52c657 test: adapt TEST-21-SYSUSERS for SUSE 2020-08-03 16:32:14 +02:00
Zbigniew Jędrzejewski-Szmek c9fecf18b9
Merge pull request #16595 from bengal/bg/dhcpv6-fqdn
dhcp6: parse the FQDN option
2020-08-03 15:17:00 +02:00
Chris Down 45ba6a5853 doc: Put proot under "container" section
Missed in #15426. Otherwise, it ends up only taking the first two rows
of the table, in no section.
2020-08-03 14:52:49 +02:00
Zbigniew Jędrzejewski-Szmek 3e2d2fbbdd docs: reword intro in DISCOVERABLE PARTITIONS
This specification is useful independently of UEFI, so avoid making assertions
about UEFI. Also reword the intro to say what this is about in the very first
sentence. Closes #16570.
2020-08-03 14:51:47 +02:00
Zbigniew Jędrzejewski-Szmek f254abcd72 man: describe that changing Storage= does not move existing data
Fixes #16384.
2020-08-03 14:51:47 +02:00
Zbigniew Jędrzejewski-Szmek 18dbc899ff
Merge pull request #16258 from hunger/master
systemd-repart: Add an option to generate a JSON report
2020-08-03 10:05:32 +02:00
Zbigniew Jędrzejewski-Szmek 7e62257219
Merge pull request #16308 from bluca/root_image_options
service: add new RootImageOptions feature
2020-08-03 10:04:36 +02:00
Marti Raudsepp 09364a8043 machine: Pass machine, user, program values to polkit on OpenMachineShell
This allows more granular access control in PolicyKit rules, similar to
/etc/sudoers, for polkit actions:
* org.freedesktop.machine1.host-shell
* org.freedesktop.machine1.shell

Example configuration, place in /etc/polkit-1/rules.d/

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.machine1.host-shell"
        && subject.user == "my-user"
        && action.lookup("user") == "target-user") {
            return polkit.Result.YES;
    }
});
2020-08-03 10:03:13 +02:00
Zbigniew Jędrzejewski-Szmek 653ca0d913
Merge pull request #16609 from poettering/initrd-unit-fixes
units: some initrd unit fixes
2020-08-03 10:01:30 +02:00
Kir Kolyshkin 1cdbff1c84 kernel-install/90-loaderentry: fix when /boot is not mountpoint
I happen to have a machine where /boot is not a separate mountpoint,
but rather just a directory under /. After upgrade to recent Fedora,
I found out that grub2 can't find any new kernels.

This happens because loadentry script generates kernel and initrd file
paths relative to /boot, while grub2 expects path to be relative to the
root of filesystem on which they are residing.

This commit fixes this issue by using stat's %m to find the mount point
of a partition holding the images, and using it as a prefix to be
removed from ENTRY_DIR_ABS.

Note that %m for stat requires coreutils 8.6, released in Oct 2010.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-08-03 10:01:03 +02:00
Daan De Meyer 6f646e0175 nspawn: Fix incorrect usage of putenv
strv_env_get only returns the environment variable value. putenv expects
KEY=VALUE format strings. Use setenv instead to fix the use.
2020-08-03 09:58:05 +02:00
Beniamino Galvani c43eea9f2e dhcp6: parse the FQDN option
Parse option 39 (Client Fully Qualified Domain Name, RFC 4704) from the DHCP
reply, which specifies the FQDN assigned by the server to the client.
2020-08-03 09:36:18 +02:00