]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoboot: Add support for -ftrapv
Jan Janssen [Fri, 10 Mar 2023 08:21:08 +0000 (09:21 +0100)] 
boot: Add support for -ftrapv

3 years agoboot: Add support for -fstack-protector
Jan Janssen [Fri, 10 Mar 2023 08:01:29 +0000 (09:01 +0100)] 
boot: Add support for -fstack-protector

3 years agoboot: Detect nested assertions
Jan Janssen [Fri, 10 Mar 2023 08:12:05 +0000 (09:12 +0100)] 
boot: Detect nested assertions

3 years agosystemctl: fix formatting of circular dep.
David Tardon [Fri, 17 Mar 2023 08:58:13 +0000 (09:58 +0100)] 
systemctl: fix formatting of circular dep.

Before:
a.target
○ └─b.target
    └─...
●   └─paths.target

After:
a.target
○ └─b.target
    ├─...
●   └─paths.target

3 years agosystemctl: fix indentation of circular deps
David Tardon [Fri, 17 Mar 2023 08:53:23 +0000 (09:53 +0100)] 
systemctl: fix indentation of circular deps

We're still at level `level` here.

Before:
b.target
○ ├─a.target
  │   └─...
● └─paths.target

After:
b.target
○ ├─a.target
  │ └─...
● └─paths.target

Fixes #26052.

3 years agoMerge pull request #26783 from yuwata/loop-ref-follow-up
Daan De Meyer [Fri, 17 Mar 2023 09:00:43 +0000 (10:00 +0100)] 
Merge pull request #26783 from yuwata/loop-ref-follow-up

udev: slightly extend comment and add more tests

3 years agotest: add a testcase that dir_fd_is_root() is not confused by bind mount
Yu Watanabe [Wed, 15 Mar 2023 19:50:08 +0000 (04:50 +0900)] 
test: add a testcase that dir_fd_is_root() is not confused by bind mount

See the comment in dir_fd_is_root() and
https://github.com/systemd/systemd/pull/26820#issuecomment-1469554966.

3 years agoMerge pull request #26803 from yuwata/udevadm-verify-summary
Yu Watanabe [Fri, 17 Mar 2023 03:14:04 +0000 (12:14 +0900)] 
Merge pull request #26803 from yuwata/udevadm-verify-summary

udevadm-verify: print a short summary

3 years agomkosi: Enable some debugging options by default
Daan De Meyer [Thu, 16 Mar 2023 17:28:14 +0000 (18:28 +0100)] 
mkosi: Enable some debugging options by default

3 years agoman: fix misspelled executable name (#26858)
Addison Snelling [Fri, 17 Mar 2023 02:36:32 +0000 (21:36 -0500)] 
man: fix misspelled executable name (#26858)

3 years agorepart: Report better errors if partition sizes are too small 26855/head
Daan De Meyer [Thu, 16 Mar 2023 22:15:19 +0000 (23:15 +0100)] 
repart: Report better errors if partition sizes are too small

3 years agorepart: Zero full verity signature partition size
Daan De Meyer [Thu, 16 Mar 2023 21:11:31 +0000 (22:11 +0100)] 
repart: Zero full verity signature partition size

systemd-dissect requires the entirety of the partition following the
signature to be zeroed, so let's do just that.

3 years agorepart: Make sure we seek to beginning of partition target before copy
Daan De Meyer [Thu, 16 Mar 2023 21:10:50 +0000 (22:10 +0100)] 
repart: Make sure we seek to beginning of partition target before copy

3 years agomkosi: Use default timeout of 10s
Daan De Meyer [Thu, 16 Mar 2023 11:12:38 +0000 (12:12 +0100)] 
mkosi: Use default timeout of 10s

Let's override the default timeout to something more reasonable for
mkosi builds.

3 years agoudev/ata_id: use unliagned helpers 26785/head
Zbigniew Jędrzejewski-Szmek [Thu, 16 Mar 2023 15:42:32 +0000 (16:42 +0100)] 
udev/ata_id: use unliagned helpers

The array is a union, aligned as uint16_t, so we were accessing fields at
offsets of two, so we didn't do actually do unaligned access. But let's make
this explicit.

3 years agoudev/v4l_id: use O_CLOEXEC|O_NOCTTY
Zbigniew Jędrzejewski-Szmek [Thu, 16 Mar 2023 15:40:00 +0000 (16:40 +0100)] 
udev/v4l_id: use O_CLOEXEC|O_NOCTTY

This is the usual set of flags. O_CLOEXEC doesn't matter because we don't spawn
anything, but O_NOCTTY could possibly make a difference if the helper is called
on a wrong device type.

3 years agomeson: add udev builtins to dist-check
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 11:13:51 +0000 (12:13 +0100)] 
meson: add udev builtins to dist-check

They now pass, and we might as well test them to avoid unexpected
regressions.

3 years agoudev: implement --version in all builtins
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 17:12:04 +0000 (18:12 +0100)] 
udev: implement --version in all builtins

Those are separate binaries, and occasionally people will get a misplaced
binary that doesn't match the rest of the installed system and be confused, so
it good to be able to check the version. It is also nice to have the same
interface in all binaries.

Note that we usually use a separate 'enum ARG_VERSION = 0x100' for an option
without a short name. We can use a less verbose approach of simply taking any
unused letter, which works just as well and even the compiler would warn us
if we tried to use the letter in another place. This way we avoid a few lines
of boilerplate.

The help texts are adjusted to have an empty line between the synopsis and
option list, and no empty lines after the option list.

3 years agoudev/cdrom_id: do not abort on unknown options
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 10:59:43 +0000 (11:59 +0100)] 
udev/cdrom_id: do not abort on unknown options

Copy-pasta is good, but you have to pick a reliable source.

3 years agoudev/mtd_probe: convert to run()
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 10:49:48 +0000 (11:49 +0100)] 
udev/mtd_probe: convert to run()

3 years agoudev/mtd_probe: implement --help
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 10:46:01 +0000 (11:46 +0100)] 
udev/mtd_probe: implement --help

3 years agoudev/fido_id: implement --help
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 10:39:44 +0000 (11:39 +0100)] 
udev/fido_id: implement --help

3 years agoudev/ata_id: stop using errno, fix logic
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 10:28:54 +0000 (11:28 +0100)] 
udev/ata_id: stop using errno, fix logic

The code was setting errno, which we don't do, and which is hard to get right…
Rework the code to use the usual negative-errno convention and add some
debug logging.

disk_scsi_inquiry_command() was working partially by accident: the v3 fallback
would enter the v4 check path, and pass it because the v4 data would still be
initialized to 0.

3 years agoudev/ata_id: drop unused output parameter
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 09:56:17 +0000 (10:56 +0100)] 
udev/ata_id: drop unused output parameter

3 years agotest: wrap mkfs.*/mksquashfs/mkswap binaries when running w/ ASan
Frantisek Sumsal [Thu, 16 Mar 2023 10:42:12 +0000 (11:42 +0100)] 
test: wrap mkfs.*/mksquashfs/mkswap binaries when running w/ ASan

3 years agojournald-console: Add colors when forwarding to console 26849/head
Daan De Meyer [Thu, 16 Mar 2023 10:22:58 +0000 (11:22 +0100)] 
journald-console: Add colors when forwarding to console

Let's color output when we're forwarding to the console. To make this
work, we inherit TERM from pid 1 and use it to decide whether we should
output colors or not.

3 years agoterminal-util: Don't assume terminal is dumb if connected to /dev/null
Daan De Meyer [Thu, 16 Mar 2023 10:21:28 +0000 (11:21 +0100)] 
terminal-util: Don't assume terminal is dumb if connected to /dev/null

If we're connected to /dev/null, we're likely going to be writing
colors to something that's not stdout/stderr, so let's fall back to
checking TERM if that's the case.

3 years agodoc: update ELF_PACKAGE_METADATA to use linker flag instead of manual script
Luca Boccassi [Thu, 16 Mar 2023 00:17:50 +0000 (00:17 +0000)] 
doc: update ELF_PACKAGE_METADATA to use linker flag instead of manual script

bfd/gold/mold/lld support this flag, so document it explicitly, and drop the
manually written linker script which is no longer necessary

3 years agotest: add tests for summary output of udevadm verify 26803/head
Yu Watanabe [Wed, 15 Mar 2023 20:25:39 +0000 (05:25 +0900)] 
test: add tests for summary output of udevadm verify

3 years agotest: reindent testsuite-17.11.sh
Yu Watanabe [Wed, 15 Mar 2023 20:04:35 +0000 (05:04 +0900)] 
test: reindent testsuite-17.11.sh

3 years agoudevadm-verify: add a short summary
Yu Watanabe [Mon, 13 Mar 2023 12:32:30 +0000 (21:32 +0900)] 
udevadm-verify: add a short summary

3 years agosd-journal: fix segfault
Yu Watanabe [Wed, 15 Mar 2023 06:12:41 +0000 (15:12 +0900)] 
sd-journal: fix segfault

Unfortunately, journal_file_next_entry() returns 0 when the next entry
not found. The commit cc938e4a0ab67707e489cc3970a8557ad89801ca adds
FIXME comment about that. We should really fix that, but the function and
its return value are used in many place, hence checking all usecases is not
easy. So, let's workaround that here, and handle the 0 return value by
the caller.

Follow-up for 34af74946e8853411f18120007ebaca6549b2a52.

Fixes #26822.

3 years agoMerge pull request #26835 from poettering/userdb-modernizations
Luca Boccassi [Thu, 16 Mar 2023 00:25:01 +0000 (00:25 +0000)] 
Merge pull request #26835 from poettering/userdb-modernizations

various userdbd modernizations

3 years agoupdated usage of SD_BUS_METHOD_WITH_NAMES macros to SD_BUS_METHOD_WIT… (#26840)
OMOJOLA JOSHUA [Wed, 15 Mar 2023 22:52:24 +0000 (23:52 +0100)] 
updated usage of SD_BUS_METHOD_WITH_NAMES macros to SD_BUS_METHOD_WIT… (#26840)

* localed: update usage of SD_BUS_METHOD_WITH_NAMES macros to SD_BUS_METHOD_WITH_ARGS

3 years agogithub: update default and example in template
Yu Watanabe [Wed, 15 Mar 2023 19:12:52 +0000 (04:12 +0900)] 
github: update default and example in template

3 years agoMerge pull request #26771 from YHNdnzj/machinectl-edit
Yu Watanabe [Wed, 15 Mar 2023 19:02:11 +0000 (04:02 +0900)] 
Merge pull request #26771 from YHNdnzj/machinectl-edit

machinectl: add verb edit and cat to operate on .nspawn files

3 years agomanager: fix scope for environment generators
Ludwig Nussel [Wed, 15 Mar 2023 09:20:59 +0000 (10:20 +0100)] 
manager: fix scope for environment generators

fixes regression introduced by 4870133bfa

3 years agotest: fix testsuite-17.10.sh
Dmitry V. Levin [Wed, 15 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
test: fix testsuite-17.10.sh

Make sure /etc/udev/hwdb.d/ exists before creating a file inside it.

Fixes: 95cf8cae77f7 ("test: add coverage test for udevadm")
3 years agoMerge pull request #26831 from YHNdnzj/edit-util-followup
Yu Watanabe [Wed, 15 Mar 2023 18:51:55 +0000 (03:51 +0900)] 
Merge pull request #26831 from YHNdnzj/edit-util-followup

edit-util: follow-ups

3 years agoudev-rules: check for conflicting and duplicate expressions
Dmitry V. Levin [Sun, 12 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: check for conflicting and duplicate expressions

Log an error when a rule line contains conflicting match expressions, e.g.
  NAME=="value", NAME!="value"

Log a warning when a rule line contains duplicate expressions, e.g.
  NAME=="value", NAME=="value"

3 years agoUpdate github issue template to include systemd-dissect
Cornelius Hoffmann [Wed, 15 Mar 2023 15:28:00 +0000 (16:28 +0100)] 
Update github issue template to include systemd-dissect

3 years agouserdbd: make static const what we can make so 26835/head
Lennart Poettering [Wed, 15 Mar 2023 14:48:17 +0000 (15:48 +0100)] 
userdbd: make static const what we can make so

3 years agouserdbd: rework to use sd_event_add_child() instead of manual SIGCHLD
Lennart Poettering [Wed, 15 Mar 2023 14:46:54 +0000 (15:46 +0100)] 
userdbd: rework to use sd_event_add_child() instead of manual SIGCHLD

Let's modernize userdbd furzer, and use the common child handling we
nowadays have in sd-event, instead of rolling our own.

This also means we'll start using pidfds where we can.

3 years agouserdbd: make use of FORK_CLOSE_ALL_FDS + FORK_REOPEN_LOG where we can
Lennart Poettering [Wed, 15 Mar 2023 14:01:11 +0000 (15:01 +0100)] 
userdbd: make use of FORK_CLOSE_ALL_FDS + FORK_REOPEN_LOG where we can

3 years agouserdbd: modernize signal handling
Lennart Poettering [Wed, 15 Mar 2023 13:59:32 +0000 (14:59 +0100)] 
userdbd: modernize signal handling

Let's make use of SD_EVENT_SIGNAL_PROCMASK so that we don't have to mask
the signals manually. Let's use sd_event_set_exit_signal() instead of
rolling our own SIGTERM/SIGINT handling. Let's use "floating" event
sources instead of keeping references on our own.

Let's also debug log if we can't enable watchdog handling.

3 years agoMerge pull request #26784 from DaanDeMeyer/chase-fix
Daan De Meyer [Wed, 15 Mar 2023 14:51:47 +0000 (15:51 +0100)] 
Merge pull request #26784 from DaanDeMeyer/chase-fix

Allow creating files and directories with chase_symlinks_open() and further improvements

3 years agofs-util: Drop unlink_noerrno()
Daan De Meyer [Wed, 15 Mar 2023 10:55:44 +0000 (11:55 +0100)] 
fs-util: Drop unlink_noerrno()

3 years agotest: add testsuite-74.machinectl 26771/head
Mike Yuan [Mon, 13 Mar 2023 12:33:36 +0000 (20:33 +0800)] 
test: add testsuite-74.machinectl

3 years agomachinectl: add verb edit and cat to operate on .nspawn files
Mike Yuan [Sat, 11 Mar 2023 16:56:13 +0000 (00:56 +0800)] 
machinectl: add verb edit and cat to operate on .nspawn files

This allows operating on .nspawn files using machinectl.

Closes #26246

3 years agoedit-util: log unexpected errors if we fail to remove the parent dir 26831/head
Mike Yuan [Wed, 15 Mar 2023 11:38:19 +0000 (19:38 +0800)] 
edit-util: log unexpected errors if we fail to remove the parent dir

3 years agoMerge pull request #26820 from DaanDeMeyer/dir-fd-is-root
Daan De Meyer [Wed, 15 Mar 2023 11:48:14 +0000 (12:48 +0100)] 
Merge pull request #26820 from DaanDeMeyer/dir-fd-is-root

fd-util: Add dir_fd_is_root()

3 years agoedit-util: use path_equal
Mike Yuan [Mon, 13 Mar 2023 02:16:14 +0000 (10:16 +0800)] 
edit-util: use path_equal

3 years agochase-symlinks: Add more assertions 26784/head
Daan De Meyer [Tue, 14 Mar 2023 12:52:50 +0000 (13:52 +0100)] 
chase-symlinks: Add more assertions

Let's turn some runtime errors into assertions and add a few new
assertions.

3 years agochase-symlinks: Rework open() functions and some chase flags
Daan De Meyer [Mon, 13 Mar 2023 15:17:21 +0000 (16:17 +0100)] 
chase-symlinks: Rework open() functions and some chase flags

Currently, when CHASE_PARENT is specified, we chase the parent directory
of the symlink itself. Let's change this and chase the parent directory
of the symlink target so that trying to open the actual file later with
O_NOFOLLOW doesn't fail with ELOOP.

To get the current behavior, callers can add CHASE_NOFOLLOW to chase
the parent directory of the symlink itself.

Currently, when CHASE_MKDIR_0755 is specified, we create all components
of the path as directories. Instead, let's change the flag to only create
parent directories and leave the final component of the PATH untouched.
Also, allow CHASE_NONEXISTENT with CHASE_MKDIR_0755 now that it doesn't
create all components anymore.

Finally, rework chase_symlinks_and_open() and chase_symlinkat_at_and_open()
to always chase the parent directory and use xopenat() to open the final
component of the path. This allows us to pass O_CREAT to create the file or
directory (O_DIRECTORY) if it is missing. If CHASE_PARENT is configured, we
just reopen the parent directory that we chased.

3 years agoAdd rebrands of Medion Akoya notebooks/tablets
bri [Sat, 11 Mar 2023 22:38:35 +0000 (17:38 -0500)] 
Add rebrands of Medion Akoya notebooks/tablets

3 years agoMerge pull request #26804 from fbuihuu/fixes-for-test-58-repart
Luca Boccassi [Wed, 15 Mar 2023 10:56:07 +0000 (10:56 +0000)] 
Merge pull request #26804 from fbuihuu/fixes-for-test-58-repart

Fixes for test 58 repart

3 years agofd-util: Add dir_fd_is_root() 26820/head
Daan De Meyer [Wed, 1 Feb 2023 12:14:29 +0000 (13:14 +0100)] 
fd-util: Add dir_fd_is_root()

3 years agomountpoint-util: Add path_get_mnt_id_at()
Daan De Meyer [Tue, 14 Mar 2023 21:00:11 +0000 (22:00 +0100)] 
mountpoint-util: Add path_get_mnt_id_at()

3 years agoMerge pull request #26825 from keszybz/log-message-fix
Luca Boccassi [Wed, 15 Mar 2023 10:49:35 +0000 (10:49 +0000)] 
Merge pull request #26825 from keszybz/log-message-fix

Log message fix

3 years agoudev/ata_id: convert to run()
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 09:45:23 +0000 (10:45 +0100)] 
udev/ata_id: convert to run()

3 years agoudev/ata_id: split out parse_argv()
Zbigniew Jędrzejewski-Szmek [Mon, 13 Mar 2023 09:42:14 +0000 (10:42 +0100)] 
udev/ata_id: split out parse_argv()

Beef up syntax and error messages a bit.

3 years agocore: fix "(null)" in output 26825/head
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 21:56:42 +0000 (22:56 +0100)] 
core: fix "(null)" in output

We want an empty string, not NULL. I made some brainfart here.
Fixup for 1980a25dc03aa500d4ee2725d696f68d265cd4ca.

3 years agocore: reduce scope of variable
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 15:52:18 +0000 (16:52 +0100)] 
core: reduce scope of variable

3 years agoMerge pull request #26800 from t-8ch/memfd_create
Lennart Poettering [Wed, 15 Mar 2023 08:28:09 +0000 (09:28 +0100)] 
Merge pull request #26800 from t-8ch/memfd_create

memfd: add support for exec flags

3 years agoMerge pull request #26794 from bluca/log_extra_fields
Lennart Poettering [Wed, 15 Mar 2023 08:27:47 +0000 (09:27 +0100)] 
Merge pull request #26794 from bluca/log_extra_fields

core: append LogExtraFields= values to log_unit* messages

3 years agocore: make the memory pressure cgroup path writable when ProtectControlGroups=yes
Luca Boccassi [Tue, 14 Mar 2023 20:12:33 +0000 (20:12 +0000)] 
core: make the memory pressure cgroup path writable when ProtectControlGroups=yes

The interface requires services to write to the cgroup file to activate notifications,
but with ProtectControlGroups=yes we make it read-only. Add a writable bind mount.

Follow-up for 6bb0084204bd93122c9f04391b80aea5a8a0ff08

3 years agotest: assume run-unit-tests.py and unit tests are installed in the same directory
Franck Bui [Thu, 26 Jan 2023 15:14:01 +0000 (16:14 +0100)] 
test: assume run-unit-tests.py and unit tests are installed in the same directory

This avoids hard coding the path of the directory where the unit tests are
installed.

3 years agotreewide: memfd_create: use exec flags 26800/head
Thomas Weißschuh [Tue, 14 Mar 2023 03:42:23 +0000 (03:42 +0000)] 
treewide: memfd_create: use exec flags

Use the flags MEMFD_EXEC or MEMFD_NOEXEC_SEAL as applicable.

These warnings instruct the kernel wether the memfd is executable or
not.

Without specifying those flags the kernel will emit the following
warning since version 6.3,
commit 105ff5339f49 ("mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC"):

    kernel: memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=1 'systemd'

3 years agomemfd-util: add wrapper for memfd_create
Thomas Weißschuh [Tue, 14 Mar 2023 03:42:05 +0000 (03:42 +0000)] 
memfd-util: add wrapper for memfd_create

The wrapper removes the flags MFD_EXEC and MFD_NOEXEC_SEAL when running
on kernels not understanding those flags.

3 years agomissing: add memfd exec flags
Thomas Weißschuh [Mon, 13 Mar 2023 14:14:21 +0000 (14:14 +0000)] 
missing: add memfd exec flags

3 years agostub: Remove overlapping PE section warning
Jan Janssen [Tue, 14 Mar 2023 13:32:43 +0000 (14:32 +0100)] 
stub: Remove overlapping PE section warning

Now that we always create PE images with a non-zero image base we cannot
run into this issue anymore. Any tool that still uses the old hard-coded
section offsets will end up creating bad images with sections below the
image base. objcopy will warn about this and any PE loader will simply
refuse to load such an image. Meanwhile updated tools do not use
hard-coded offsets anymore.

3 years agoMerge pull request #26815 from keszybz/cgls-no-xattrs-by-default
Luca Boccassi [Wed, 15 Mar 2023 00:24:02 +0000 (00:24 +0000)] 
Merge pull request #26815 from keszybz/cgls-no-xattrs-by-default

Do not show xattrs and cgroup ids in cgls by default

3 years agoMerge pull request #26808 from keszybz/no-controllers-followup
Luca Boccassi [Wed, 15 Mar 2023 00:23:05 +0000 (00:23 +0000)] 
Merge pull request #26808 from keszybz/no-controllers-followup

Docs and dump output follow-up for the case of delegation with no controllers

3 years agomkfs-util: Redirect mksquashfs output to /dev/null
Daan De Meyer [Tue, 14 Mar 2023 13:32:37 +0000 (14:32 +0100)] 
mkfs-util: Redirect mksquashfs output to /dev/null

The -quiet option for mksquashfs was added somewhat recently so to
support older versions, let's redirect stdout of mksquashfs to
/dev/null instead.

3 years agoMerge pull request #26683 from YHNdnzj/systemctl-shutdown-when
Luca Boccassi [Wed, 15 Mar 2023 00:19:50 +0000 (00:19 +0000)] 
Merge pull request #26683 from YHNdnzj/systemctl-shutdown-when

systemctl: add --when for scheduled poweroff/halt/reboot/kexec support

3 years agosrc: changed instances of sd_bus_call_method() to bus_call_method() (#26819)
OMOJOLA JOSHUA [Wed, 15 Mar 2023 00:12:57 +0000 (01:12 +0100)] 
src: changed instances of sd_bus_call_method() to bus_call_method() (#26819)

* src: changed instances of sd_bus_call_method() to bus_call_method()

3 years agoupdate TODO
Lennart Poettering [Tue, 14 Mar 2023 21:36:14 +0000 (22:36 +0100)] 
update TODO

3 years agodissect: make all paths we operation on absolute
Lennart Poettering [Mon, 13 Mar 2023 12:09:46 +0000 (13:09 +0100)] 
dissect: make all paths we operation on absolute

Let's avoid any ambiguities around paths, and make them absolute when
accepting them, like we do in most our tools now. This makes us
independent of the current working directory and allows us to change it
without issues or pass around the paths elsewhere if need be.

3 years agocore: fix mount flag help output, it only takes one argument
Lennart Poettering [Tue, 14 Mar 2023 10:03:48 +0000 (11:03 +0100)] 
core: fix mount flag help output, it only takes one argument

3 years agodissect: mark UID/GIDs that are surprising in DDIs with colors
Lennart Poettering [Tue, 14 Mar 2023 10:04:46 +0000 (11:04 +0100)] 
dissect: mark UID/GIDs that are surprising in DDIs with colors

DDIs should not contain files owned by dynamic users or the nobody
users. Let's subtly highlight those entries in mtree output.

3 years agocgls: add -x and -c options 26815/head
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 16:58:08 +0000 (17:58 +0100)] 
cgls: add -x and -c options

-x is short for --xattrs=yes and
-c is short for --cgroup-id=yes.

3 years agocgls: stop showing cgroup ids and xattrs by default
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 16:51:24 +0000 (17:51 +0100)] 
cgls: stop showing cgroup ids and xattrs by default

Those are rather specialized bits of information, useful mostly for debugging.
I use cgls quite often but never had the need to use either of those…
But they take up a significant amount of screen real estate, esp. when
executed as root:

-.slice
├─user.slice (#1683)
│ → user.invocation_id: 74b0bd1258c5485eb969016384e0d06a
│ → trusted.invocation_id: 74b0bd1258c5485eb969016384e0d06a
│ └─user-1000.slice (#6488)
│   → user.invocation_id: b0261a14fe74490d9a9d5266c52cceb6
│   → trusted.invocation_id: b0261a14fe74490d9a9d5266c52cceb6
│   ├─user@1000.service … (#6590)
│   │ → user.invocation_id: 9e1fb54ad07940d8b92c33c81d169f11
│   │ → user.delegate: 1
│   │ → trusted.invocation_id: 9e1fb54ad07940d8b92c33c81d169f11
│   │ → trusted.delegate: 1
│   │ ├─session.slice (#6874)
...

Let's not show them by default, so we can show more cgroups.

(Also, on a terminal, we already highlight delegate units via underlining and
an ellipsis, so 'user.delegate:1' is redundant.)

3 years agocgtop: drop counterproductive bitfields
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 16:24:43 +0000 (17:24 +0100)] 
cgtop: drop counterproductive bitfields

The variable after the bitfields has 8 byte alignment, so we weren't saving any
memory, but the code to serve the bitfields was more complicated.

3 years agocgtop: split out the main loop into a separate function
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 16:24:07 +0000 (17:24 +0100)] 
cgtop: split out the main loop into a separate function

This way the initial setup is nicely separated from the main loop logic.

3 years agocore: append LogExtraFields= values to log_unit* messages 26794/head
Luca Boccassi [Mon, 13 Mar 2023 21:34:37 +0000 (21:34 +0000)] 
core: append LogExtraFields= values to log_unit* messages

This ensure messages from PID1 regarding a unit also contain those
fields. For example, portable services have PORTABLE=<image> as
extra fields, which is useful to identify which version of a portable
image produced a log message like an error or an oomd kill.

3 years agolog: add iov helpers for log_context
Luca Boccassi [Mon, 13 Mar 2023 21:33:58 +0000 (21:33 +0000)] 
log: add iov helpers for log_context

3 years agochase-symlinks: Remove unused ret_fd arguments
Daan De Meyer [Mon, 13 Mar 2023 20:55:04 +0000 (21:55 +0100)] 
chase-symlinks: Remove unused ret_fd arguments

3 years agomanager: in dump, show no controllers as "(none)" 26808/head
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 11:35:33 +0000 (12:35 +0100)] 
manager: in dump, show no controllers as "(none)"

https://github.com/systemd/systemd/commit/7b3693e4e4c9cae50fca65136278a62fae11327e#r103711181

3 years agoman: document "Delegate=" a bit more
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 11:27:37 +0000 (12:27 +0100)] 
man: document "Delegate=" a bit more

This case is a bit surprising, even if logical if one understands how the
parser works. Let's be more explicit.

Follow-up for 7b3693e4e4c9cae50fca65136278a62fae11327e.

3 years agotest-time-util: add test cases to invalidate "show" and "cancel" 26683/head
Mike Yuan [Mon, 13 Mar 2023 23:16:18 +0000 (07:16 +0800)] 
test-time-util: add test cases to invalidate "show" and "cancel"

Ensure that systemctl reboot --when=show and --when=cancel will not result in ambiguities

3 years agosystemctl: add option --when for scheduled shutdown
Mike Yuan [Sun, 5 Mar 2023 15:27:44 +0000 (23:27 +0800)] 
systemctl: add option --when for scheduled shutdown

Pass an empty string or "cancel" will cancel the action.
Pass "show" will show the scheduled actions.

Replaces #17258

3 years agosystemctl: logind: make logind_schedule_shutdown accept action as param
Mike Yuan [Sun, 5 Mar 2023 15:11:48 +0000 (23:11 +0800)] 
systemctl: logind: make logind_schedule_shutdown accept action as param

3 years agosystemctl: logind: add missing asserts
Mike Yuan [Mon, 13 Mar 2023 22:56:17 +0000 (06:56 +0800)] 
systemctl: logind: add missing asserts

3 years agoMerge pull request #26662 from yuwata/test-execute-network-namespace-path
Daan De Meyer [Tue, 14 Mar 2023 10:16:15 +0000 (11:16 +0100)] 
Merge pull request #26662 from yuwata/test-execute-network-namespace-path

test-execute: add tests for NetworkNamespacePath=

3 years agotest-50-dissect: add test for long reference name 26783/head
Yu Watanabe [Mon, 13 Mar 2023 14:36:32 +0000 (23:36 +0900)] 
test-50-dissect: add test for long reference name

3 years agoudev: mention that the kernel silently truncates lo_file_name if too long
Yu Watanabe [Mon, 13 Mar 2023 14:28:58 +0000 (23:28 +0900)] 
udev: mention that the kernel silently truncates lo_file_name if too long

Resolves the confusion in https://github.com/systemd/systemd/pull/26693#discussion_r1131151335.

3 years agotests: don't use absolute paths when installing binaries in TEST-58-REPART 26804/head
Franck Bui [Tue, 14 Mar 2023 09:08:11 +0000 (10:08 +0100)] 
tests: don't use absolute paths when installing binaries in TEST-58-REPART

Let image_install figures the binary paths out itself as not all distributions
ship the mkfs.* tools in the same location. For example openSUSE ships
mksquashfs in /usr/bin/.

3 years agotests: fix inverted condition in testsuite-58.sh
Franck Bui [Tue, 14 Mar 2023 09:06:39 +0000 (10:06 +0100)] 
tests: fix inverted condition in testsuite-58.sh

3 years agochase-symlinks: Fix memory leak
Daan De Meyer [Mon, 13 Mar 2023 16:07:50 +0000 (17:07 +0100)] 
chase-symlinks: Fix memory leak

3 years agofs-util: Add xopenat()
Daan De Meyer [Tue, 14 Mar 2023 08:55:04 +0000 (09:55 +0100)] 
fs-util: Add xopenat()

xopenat() will create directories if O_DIRECTORY and O_CREAT are
specified. Note that this is not an atomic operation.