1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
Commit Graph

54371 Commits

Author SHA1 Message Date
Yu Watanabe
fbdda4bb53 network: ndisc: split out prefix option handling into ndsic_router_process_prefix() 2021-11-09 08:09:04 +09:00
Lennart Poettering
43f4b5101c man: document new --json= mode 2021-11-08 21:42:53 +01:00
Lennart Poettering
9897989ef3 man: document new --multipler= switch 2021-11-08 21:42:53 +01:00
Lennart Poettering
18e94a40b8 userwork: make sure to return correct errors when service is not specified correctly
Fixes: #21215 #21222
2021-11-08 21:42:53 +01:00
Lennart Poettering
790e3ed3cc userdbctl: always show summary after printing table (unless legend is off)
We do this in many (most?) other tools, do so here too. It's quite
useful info to count users/groups/…
2021-11-08 21:40:30 +01:00
Lennart Poettering
4083d825e9 userdbctl: add a switch for explicitly enabling/disabling multiplexer-based lookups
This is incredibly useful for debugging.
2021-11-08 21:40:30 +01:00
Lennart Poettering
e032cbd591 userdbctl: make JSON output mode details configurable like in the other tools
Let's add --json= with the same parser as in the other tools, and honour
it.
2021-11-08 21:40:30 +01:00
Lennart Poettering
0595ff1680 userdbctl: explicitly handle ESRCH/ENOLINK from userdb_all()
Similar in style to previous commit, let's handle these two errors
properly, i.e. as equivalent to no entries found. Let's debug log about
them, to make things either to deal with when debugging (after all
userdbctl to a large degree are debugging tools).
2021-11-08 21:40:30 +01:00
Lennart Poettering
e908961d2e userwork: properly handle ENOLINK error from lower-level userdb code
The lower-level userdb code will return ENOLINK if varlink lookups are
disabled explicitly and we couldn#t find an answer any other way. Let's
not propagate this to clients, since they don't have control over this
feature anyway: we decide internally when to disable varlink lookups
(e.g. if DropIn lookups are requested we disable them) and to the client
side that should not be visible: if we can't find a record with the
flags we pick then we should report then we can't find any, and that's
it.

Fixes: #21223
2021-11-08 21:40:30 +01:00
Lennart Poettering
5c12ee3656 man: extend os-release docs a bit regarding quotes
Fixes: #21194
2021-11-08 18:21:00 +00:00
Zbigniew Jędrzejewski-Szmek
e2de2d28f4
Merge pull request #20813 from unusual-thoughts/exittype_v2
Reintroduce ExitType
2021-11-08 15:06:37 +01:00
Albert Brox
da845dabf5 implement aliasing for systemd-analyze verify 2021-11-08 12:08:23 +00:00
Christian Brauner
a6d1760024 build: preserve correct mode when generating files via jinja2
When using "capture : true" in custom_target()s the mode of the source
file is not preserved when the generated file is not installed and so
needs to be tweaked manually. Switch from output capture to creating the
target file and copy the permissions from the input file.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-08 12:06:48 +00:00
Henri Chain
e83a422797 Use ExitType=cgroup for autostart generated services
This fixes a bug[1] with some generated autostart app services which
fork and exit immediately after main application process start,
that caused them not to launch during session startup, as the entire
cgroup was immediately killed by systemd.

This can also happen with apps such as file browsers, whose initial
process will exit after the window is closed, but who intend to leave a
daemon child running.

Since the forking model of a .desktop application cannot be known at
service generation time otherwise, ExitType=cgroup is the only effective
way to fix this bug.

[1] https://bugs.kde.org/show_bug.cgi?id=433299
2021-11-08 10:15:24 +01:00
Henri Chain
596e447076 Reintroduce ExitType
This introduces `ExitType=main|cgroup` for services.
Similar to how `Type` specifies the launch of a service, `ExitType` is
concerned with how systemd determines that a service exited.

- If set to `main` (the current behavior), the service manager will consider
  the unit stopped when the main process exits.

- The `cgroup` exit type is meant for applications whose forking model is not
  known ahead of time and which might not have a specific main process.
  The service will stay running as long as at least one process in the cgroup
  is running. This is intended for transient or automatically generated
  services, such as graphical applications inside of a desktop environment.

Motivation for this is #16805. The original PR (#18782) was reverted (#20073)
after realizing that the exit status of "the last process in the cgroup" can't
reliably be known (#19385)

This version instead uses the main process exit status if there is one and just
listens to the cgroup empty event otherwise.

The advantages of a service with `ExitType=cgroup` over scopes are:
- Integrated logging / stdout redirection
- Avoids the race / synchronisation issue between launch and scope creation
- More extensive use of drop-ins and thus distro-level configuration:
  by moving from scopes to services we can have drop ins that will affect
  properties that can only be set during service creation,
  like `OOMPolicy` and security-related properties
- It makes systemd-xdg-autostart-generator usable by fixing [1], as obviously
  only services can be used in the generator, not scopes.

[1] https://bugs.kde.org/show_bug.cgi?id=433299
2021-11-08 10:15:23 +01:00
Dan Streetman
bf47f71c1c test: refactor test-procfs-util for clarity and skip test on perm failure
After commit c3dead53d5 the test can fail
if the procfs file(s) aren't writable, because the check for permission
failure happens after a call that will never fail, since setting the
limit to the existing limit will always pass.

This also refactors the function slightly to make the test var names
clearer.
2021-11-08 08:37:08 +01:00
Peter Hutterer
2d8840eb66 hwdb: remove the tablet pad entry for the UC-Logic 1060N
This entry only matches on vid/pid, so the pen event node of the device
would also get assigned the ID_INPUT_TABLET_PAD property - making it
break with libinput.

On top of that, UC-Logic's tablets re-use USB ids, so now we're breaking
multiple devices this way.

To get this device tagged correctly, use libwacom which has the
per-device hwdb entries.

Fixes #17953

This reverts commit 0fbe78ac7a
2021-11-08 07:39:17 +01:00
Ettore Atalan
6e671b3f07 po: Translated using Weblate (German)
Currently translated at 77.7% (147 of 189 strings)

Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/de/
Translation: systemd/main
2021-11-08 10:04:26 +09:00
Luca Boccassi
5df64f148d
Merge pull request #21237 from bluca/analyze_skip
analyze: allow a custom policy to skip a check
2021-11-06 11:19:40 +00:00
Lennart Poettering
0cdb32ef52
Merge pull request #21171 from DaanDeMeyer/tty-dimensions
exec: Add TTYRows and TTYColumns properties to set TTY dimensions
2021-11-06 10:16:45 +01:00
Lennart Poettering
84f261853c user-record: show CIFS extra mount options, in output too
Follow-up for 4c2ee5c7f2
2021-11-06 00:27:34 +01:00
Frantisek Sumsal
a0ac3652fc test: wait until lvm-activate-$vgroup.service finishes
The new lvm autoactivation method runs `vgchange` via
`systemd-run --no-block`[0], which means that checking if the unit
is in the `active` state is not enough, since the main binary might
still be running. Let's fix this by waiting until the unit reaches
the `exited` sub state.

Follow-up to:
  * 29f8bef05e
  * e50d743f99

[0] https://sourceware.org/git/?p=lvm2.git;a=blob;f=udev/69-dm-lvm.rules.in;h=39e5b98074010745f78a7a86a05929700c9cd690;hb=67722b312390cdab29c076c912e14bd739c5c0f6#l83

Example:
```
[   17.102002] systemd-udevd[282]: sdf: '/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-iscsi_lvm2212 /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212'(err) 'Running as unit: lvm-activate-iscsi_>
[   17.102522] systemd-udevd[282]: sdf: Process '/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-iscsi_lvm2212 /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212' succeeded.
[   17.102697] systemd-udevd[282]: sdf: Adding watch on '/dev/sdf'
[   17.104944] systemd[1]: lvm-activate-iscsi_lvm2212.service: Changed dead -> running
...
[   17.105434] systemd[1]: Started /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212.
[   17.105601] systemd[931]: lvm-activate-iscsi_lvm2212.service: Executing: /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212
...
[   17.420228] testsuite-64.sh[268]: + systemctl -q is-active lvm-activate-iscsi_lvm2212.service
[   17.420228] testsuite-64.sh[268]: + return 0
[   17.420228] testsuite-64.sh[268]: + test -e /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2021-09.com.example:iscsi.lvm.test-lun-4
[   17.420228] testsuite-64.sh[268]: + udevadm settle
[   17.420228] testsuite-64.sh[268]: + test -e /dev/iscsi_lvm2212/mypart1
...
[   17.451313] systemd[1]: testsuite-64.service: Main process exited, code=exited, status=1/FAILURE
[   17.451475] systemd[1]: testsuite-64.service: Failed with result 'exit-code'.
...
[   17.555759] systemd[1]: Starting End the test...
[   17.556972] sh[941]: + systemctl poweroff --no-block
...
[   17.688923] lvm[931]:   2 logical volume(s) in volume group "iscsi_lvm2212" now active
...
[   17.838484] systemd[1]: lvm-activate-iscsi_lvm2212.service: Child 931 belongs to lvm-activate-iscsi_lvm2212.service.
[   17.838718] systemd[1]: lvm-activate-iscsi_lvm2212.service: Main process exited, code=exited, status=0/SUCCESS (success)

```
2021-11-05 22:48:38 +00:00
xdavidwu
0cfb0971f0 coredump: fix filename in journal when not compressed
Since 587f2a5e56, filename for
not-compressed coredump is missing from save_external_coredump, making
it write COREDUMP_FILENAME= (empty) in journal, making `coredumpctl`
report it missing but it is actually saved.
This fixes it.
2021-11-05 22:47:16 +00:00
Luca Boccassi
82100ef486 analyze: allow a custom policy to skip a check with weight=0
In some cases an offline analysis should ignore some fields, for example
a portable service in an image will never list RootImage/RootDirectory, as
they are added at runtime, and thus can be skipped.
2021-11-05 22:37:34 +00:00
Daan De Meyer
51462135fb exec: Add TTYRows and TTYColumns properties to set TTY dimensions 2021-11-05 21:32:14 +00:00
Daan De Meyer
b4bf9007cb getty: Pass tty to use by agetty via stdin
If the tty arg is set to "-", agetty uses the stdin fd as the tty.
Let's pass the tty this way so that we keep an fd open to the tty
at all times. If all fd's to a tty are closed, the kernel might
reset the tty which we want to avoid.
2021-11-05 21:32:11 +00:00
Tony Asleson
788a0ef179 test: exercise sytemd-integritysetup & generator
Ensures we can open a dm-integrity volume formated with
integritysetup.
2021-11-05 21:17:17 +00:00
Jan Janssen
ad102dd09a sd-boot: Add .osrel section
This allows starting systemd-boot from \EFI\Linux for easier testing
and bisection without risking an unbootable system as the user does not
need to replace their working loader.
2021-11-05 22:11:43 +01:00
Luca Boccassi
03e93377dc analyze: explain how the weight/range policy fields are used 2021-11-05 21:09:43 +00:00
Lennart Poettering
874cbf675d
Merge pull request #21252 from poettering/homed-record-dir-env-var
homed: add env var to override dir where we fine stored user records
2021-11-05 21:52:00 +01:00
Lennart Poettering
7cdd5c0d4c user-record: fix display of access mode 2021-11-05 21:37:45 +01:00
Lennart Poettering
30df35869c user-record: show fs/luks/gpt UUIDs as proper UUIDs
These are not defined by us, but are defined as proper UUIDs by their
respective specs, hence show them as such.
2021-11-05 21:37:20 +01:00
Lennart Poettering
67302b38b4 docs: document systemd-homed development env vars 2021-11-05 19:07:52 +01:00
Lennart Poettering
005daeed2b homed: add env var to override dir where we fine stored user records
This adds an env var which we can use to redirect where homed stores and
looks for user records kept on the host. This is useful for debugging
purposes so that one can easily run another homed instnce that doesn't
interfere with the main instance.
2021-11-05 18:35:28 +01:00
Jan Janssen
d874a13efc test: Add test for flag macros 2021-11-05 16:27:41 +01:00
Zbigniew Jędrzejewski-Szmek
20f7ada699
Merge pull request #20056 from calestyo/split-up-sysusers.d-systemd.conf.in
sysusers: split up systemd.conf
2021-11-05 15:30:33 +01:00
Luca Boccassi
8389fd19d2
Merge pull request #20138 from keszybz/coding-style-variable-decls
A coding style tweak and checking of sd_notify() calls and voidification of pager_open()
2021-11-05 13:57:30 +00:00
Zbigniew Jędrzejewski-Szmek
5f035b13de meson-render-jinja2: use ast.literal_eval()
Imports are sorted in the usual fashion: stdlib first.

literal_eval() parses string/numbers/lists/sets/dicts, and nothing else, while
eval will execute any python code. Using literal_eval() is generally more
correct, because it avoids the risk of side effects from the parsed expression.
In this case, we generate the parsed strings ourselves, so it's very unlikely
to have anything unexpected in the expressions. But let's do the correct thing
anyway.
2021-11-05 14:56:32 +01:00
Zbigniew Jędrzejewski-Szmek
7f9521d5e1
Merge pull request #21225 from medhefgo/boot-cleanup
Boot cleanup
2021-11-05 14:53:47 +01:00
Luca Boccassi
fac2c3e97d basic/mountpoint-util: detect erofs as a read-only FS 2021-11-05 14:02:04 +01:00
Lennart Poettering
d7654742ee loop-util: reopen device node if we shortcut loop device creation
The LoopDevice object supports a shortcut: if the backing fd we are
supposed to create a loopback device of refers to a
block device alrady then we'll use it as is – if we can – instead of
setting up an unnecessary loopback device that would be pretty much
the same as its backing device.

Previously, when doing this we'd just dup() the original backing fd and
use that. But that's problematic in case O_DIRECT was set on the fd,
since we'll keep that flag set on our copy too, which means we can't do
simple, regular IO on it anymore.

Thus, let's reopen the inode in this case with the exact access flags
we'd apply if we'd actually allocate and open a new loopback device.

Fixes: #21176
2021-11-05 07:08:16 +00:00
Luca Boccassi
d54017e8f7 analyze: fix typos in test policy 2021-11-04 19:22:28 +00:00
Luca Boccassi
7544461cd0
Merge pull request #21229 from keszybz/improve-m-hint
Improve hint to use -M in various tools
2021-11-04 18:40:26 +00:00
Jan Janssen
d1da890004 sd-boot: Fix efi_arch checks
efi_arch is set to whatever meson returns from host_machine.cpu_family() and
gnu_efi_arch is then set accordingly.

On x86, efi_arch == x86 and gnu_efi_arch == ia32. Surprisingly, compilation
worked (without disabling some instruction sets) and nobody ever complained
about systemd-bootia32.efi not working.
2021-11-04 18:54:31 +01:00
Jan Janssen
1840dfc327 sd-boot: Detect supported compile args
This brings the final list of compiler arguments more in line with
how meson does things. In particular, --buildtype=plain will not
add any optimizations on its own (and would have to be provided
through CFLAGS=).
2021-11-04 18:54:31 +01:00
Jan Janssen
f8a738bbc0 sd-boot: Add some link flags
These flags are used by gnu-efi. Adding --no-undefined even allows
us to drop the no-undefined-symbols.sh test in favor of immediate
compile time errors.
2021-11-04 18:54:31 +01:00
Jan Janssen
1f6f233f87 sd-stub: Fix possible memory leak 2021-11-04 18:54:31 +01:00
Jan Janssen
65ff3d2626 sd-boot: Check for existence of required pe sections 2021-11-04 18:48:53 +01:00
Jan Janssen
ff9d65f6ff sd-boot: Move optional header verification into verify_pe 2021-11-04 18:37:07 +01:00
Jan Janssen
785b5fcf5f sd-boot: Use FLAGS_SET 2021-11-04 18:37:07 +01:00