Commit graph

65867 commits

Author SHA1 Message Date
Yu Watanabe be994c2640 battery-check: several follow-ups
Follow-ups for e3d4148d50.

- add reference to initrd-battery-check.service in man page, and move
  its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
  indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),

etc, etc...
2023-06-29 15:41:00 +09:00
Yu Watanabe d625f717db meson: first try dependency(), then fallback to find_library()
This also drops the fallback for libacl, libcap, libcrypt, and libgcrypt,
as recent Ubuntu (at least, 20.04 LTS and newer) and Debian (at least, buster
and newer) have relevant .pc files.

Fixes #28161.
2023-06-29 15:38:53 +09:00
Lennart Poettering 08423f6d30 NEWS: various fixes/additions 2023-06-28 22:40:50 +02:00
Lennart Poettering 57859ed19f
Merge pull request #28168 from poettering/xdg-state-home
properly support XDG_STATE_HOME
2023-06-28 22:30:23 +02:00
Lennart Poettering b50aadaff2 tmpfiles: teach tmpfiles the new XDG_STATE_HOME variable too 2023-06-28 22:13:13 +02:00
Lennart Poettering cc8fdd5d30 man: properly close XML tags 2023-06-28 22:12:03 +02:00
Lennart Poettering fa1d34825a man: rebreak lines in file-hierarchy(7) a bit
(Does not change a single word, just rebreaks a bunch of paragraphs
matching our current line breaking rules)
2023-06-28 22:11:06 +02:00
Franklin Yu b4d6bc63e6 man: mention the newly-added XDG_STATE_HOME
The description is copied from config-home.

Taken from: #27795
2023-06-28 22:10:18 +02:00
Lennart Poettering 580a007bb6 test: add test for new XDG_STATE_HOME handling 2023-06-28 22:09:19 +02:00
Lennart Poettering f5bb36dcfe execute: don't bother with chowning StateDirectory= and friends in user mode 2023-06-28 22:08:35 +02:00
Lennart Poettering b93d24e07d execute: shorten code by making use of laccess() return code properly 2023-06-28 22:07:38 +02:00
Lennart Poettering db58f5de3d execute: shorten some code by using RET_NERRNO() 2023-06-28 22:06:49 +02:00
Lennart Poettering 59dd2bbbb6 execute: associate logs from setup_exec_directory() with the unit name 2023-06-28 22:06:07 +02:00
Lennart Poettering f9c91932b4 execute: add support for XDG_STATE_HOME for placing service state data in --user mode
This adds support for the new XDG_STATE_HOME env var that was added to
the xdg basedir spec. Previously, because the basedir spec didn't know
the concept we'd alias the backing dir for StateDirectory= to the one
for ConfigurationDirectory= when runnin in --user mode. With this change
we'll make separate. This brings us various benefits, such as proper
"systemctl clean" support, where we can clear service state separately
from service configuration, now in user mode too.

This does not come without complications: retaining compatibility with
older setups is difficult, because we cannot possibly identitfy which
files in existing populated config dirs are actually "state" and which
one are true" configuration.

Hence let's deal with this pragmatically: if we detect that a service
that has both dirs configured only has the configuration dir existing,
then symlink the state dir to the configuration dir to retain
compatibility.

This is not great, but it's the only somewhat reasonable way out I can
see.

Fixes: #25739
2023-06-28 22:01:55 +02:00
Lennart Poettering d5602c1632 execute: when recursively chowning StateDirectory= when spawning services, follow initial symlink
It should be OK to allow one level of symlink for the various types of
directories like StateDirectory=, LogsDirectory= and such.
2023-06-28 22:01:07 +02:00
Lennart Poettering d9e5137185 execute: remove redundant assignment 2023-06-28 22:00:08 +02:00
Lennart Poettering 170d978b2f execude: include RuntimeScope field in ExecParameters
Let's decouple execute.c a bit from the Manager object, let's pass the
runtime scope (i.e. the enum that discern invocation for user or system
context) as part of ExecParameters. This makes the scope available in
various functions without having to pass the Manager object in.
2023-06-28 21:59:02 +02:00
Lennart Poettering 17f06e97e4 path tool: add some basic ansi highlighing 2023-06-28 21:58:17 +02:00
Lennart Poettering 4bbfc9eac5 sd-path: bring spacing in sd-path.h and systemd-path tool in sync 2023-06-28 21:57:17 +02:00
Lennart Poettering 9a653235d1 sd-path: add support for XDG_STATE_HOME 2023-06-28 21:55:33 +02:00
Luca Boccassi 1c53c3bab1
Merge pull request #28178 from mrc0mmand/nss-tests
test: add a couple of tests for nss-myhostname & nss-mymachines
2023-06-28 19:41:11 +01:00
Luca Boccassi f18886fe17
Merge pull request #28164 from poettering/replace-env-var-fixes
pid1: warn about unset+invalid env var names when resolving ExecStart= expressions and similar
2023-06-28 19:40:51 +01:00
Lennart Poettering d1797c42cc update TODO 2023-06-28 19:22:57 +02:00
Lennart Poettering 4d8eca03e5
Merge pull request #28146 from keszybz/ansi-seq-skip
Pass ANSI sequences through when ellipsizing output
2023-06-28 19:18:27 +02:00
Lennart Poettering 5e4c66450c
Merge pull request #27830 from 1awesomeJ/initrd
PID1: Detect battery level in initrd and if low refuse continuing to …
2023-06-28 19:18:03 +02:00
Frantisek Sumsal 2b5e786005 test: enable LSan for certain wrapped binaries
So we're able to detect memory leaks in our NSS modules.

An example after introducing a memory leak in nss-myhostname.c:

testsuite-71.sh[2881]: =================================================================
testsuite-71.sh[2881]: ==2880==ERROR: LeakSanitizer: detected memory leaks
testsuite-71.sh[2881]: Direct leak of 2 byte(s) in 1 object(s) allocated from:
testsuite-71.sh[2881]:     #0 0x7fa28907243b in strdup (/usr/lib64/libasan.so.8.0.0+0x7243b)
testsuite-71.sh[2881]:     #1 0x7fa286a7bc10 in gethostname_full ../src/basic/hostname-util.c:67
testsuite-71.sh[2881]:     #2 0x7fa286a74af9 in gethostname_malloc ../src/basic/hostname-util.h:24
testsuite-71.sh[2881]:     #3 0x7fa286a756f4 in _nss_myhostname_gethostbyname4_r ../src/nss-myhostname/nss-myhostname.c:79
testsuite-71.sh[2881]:     #4 0x7fa288f17588 in getaddrinfo (/lib64/libc.so.6+0xf4588)
testsuite-71.sh[2881]:     #5 0x7fa2890a4d93 in __interceptor_getaddrinfo.part.0 (/usr/lib64/libasan.so.8.0.0+0xa4d93)
testsuite-71.sh[2881]:     #6 0x55a54b2b7159 in ahosts_keys_int.part.0 (/usr/bin/getent.orig+0x4159)
testsuite-71.sh[2881]: SUMMARY: AddressSanitizer: 2 byte(s) leaked in 1 allocation(s).
2023-06-28 17:04:31 +02:00
Frantisek Sumsal 0f90d4f0c3 test: add a couple of tests for nss-mymachines 2023-06-28 17:04:31 +02:00
Lennart Poettering 76982d8944 update NEWS 2023-06-28 16:56:53 +02:00
Lennart Poettering 005bfe4e01 NEWS: add pcrs verb 2023-06-28 16:53:30 +02:00
Lennart Poettering f70c90f5ca analyze: add new "pcrs" verb
It shows the PCRs we know about along with their name strings and
current values.
2023-06-28 16:50:50 +02:00
Dmitry V. Levin 51c425dc93 pwquality: remove old built-in cracklib dictionary workaround
The first version of libpwquality with the required change was 1.4.1
released in 2019.
2023-06-28 15:56:38 +02:00
Luca Boccassi b1ee7474f8 NEWS: typos 2023-06-28 14:51:35 +01:00
OMOJOLA JOSHUA e3d4148d50 PID1: detect battery level in initrd and if low refuse continuing to boot, print message and shut down. 2023-06-28 14:48:54 +01:00
Luca Boccassi 198aff7663 NEWS: mention that sd_event_trim_memory can be overridden 2023-06-28 14:43:54 +01:00
Luca Boccassi acf678deca NEWS: mention addon<efi>.efi.stub 2023-06-28 14:42:18 +01:00
Luca Boccassi 02f5a2ffab NEWS: do not make specific promises about future development, keep it vague 2023-06-28 14:34:12 +01:00
Luca Boccassi e6da1e04c6 NEWS: move PrivateUsers= change at the top, as it changes behaviour 2023-06-28 14:33:48 +01:00
Lennart Poettering d7b3c52cb1 NEWS: more updates for future v254 2023-06-28 15:21:49 +02:00
OMOJOLA JOSHUA 67ced44302 Remove battery level check at early boot from TODO 2023-06-28 13:32:38 +01:00
Lennart Poettering 5d97475b27 sysv-generator: deprecate even more
Let's add a comment about the deprecation to the docs, and as comment to
the sources.

Follow-up for: #28179
2023-06-28 10:39:06 +01:00
Frantisek Sumsal 1a36d2672f test: add a couple of tests for nss-myhostname 2023-06-28 11:07:46 +02:00
cunshunxia 556c674d6e mute the memory recursiveprot log if version of kernel is low. 2023-06-28 10:59:00 +02:00
Lennart Poettering 1db8c86196
Merge pull request #28179 from poettering/sysvgendeprecated
make systemd-sysv-generator even more deprecated
2023-06-28 09:37:42 +02:00
Yu Watanabe 16e1e4b3e7 meson: drop doubled empty line 2023-06-27 22:34:25 -06:00
Zbigniew Jędrzejewski-Szmek cb558ab222 string-util: pass ANSI sequences through unchanged
Cutting off in the middle may leave the terminal in a bad state, breaking
further output. But we don't know what a given ANSI sequence does, e.g.
ANSI_NORMAL should not be skipped. But it is also nice to keep various
sequences intact, so that if we had part of the string in blue, and we cut out
the beginning of the blue part, we still want to keep the remainder in color.
So let's just pass them through, stripping out the characters that take up
actual space.

Also, use memcpy_safe as we may end up copying zero bytes when ellipsizing at
the start/end of a string.

Fixes: #24502

This also fixes an ugliness where we would ellipsize string with ANSI
sequences too much, leading to output that was narrower on screen than the
requested length:

  Starting AAAAAAAAAAAAAAAAAAAAA.service
  Starting BBBBBBBBBBBBBBBBBBBBB.service
  Starting LONG…ER.service

Co-authored-by: Jan Janssen <medhefgo@web.de>
2023-06-27 16:55:02 -06:00
Lennart Poettering 7474097d51 NEWS: add comment about SysV script deprecation 2023-06-27 23:22:26 +02:00
Lennart Poettering f4d4ca6e2b sysv-generator: make sysv deprecation message a bit "louder"
Let's add a catalog entry, make the log record structured, and most
importantly, let's add warning emojis.

Just to underline that this stuff should really go away.
2023-06-27 23:21:03 +02:00
Lennart Poettering fba84e121b journalctl: read env vars that override compiled catalog database and source files
This makes it a bit easier to test catalog files without installing
systemd.
2023-06-27 23:20:15 +02:00
Piotr Drąg b6a3fe2666 catalog,po: update Polish translation 2023-06-27 21:53:32 +01:00
Lennart Poettering a3e54ddf49 tpm2: make PcrIndex an anonymous enum
It just gives names for things generally just handled as numeric
indexes, hence drop the type name, and make the enum anonymous. Nothing
is using the type name anyway.
2023-06-27 22:14:09 +02:00