]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoservice: fix for RestartMode=direct option 27584/head
Richard Phibel [Thu, 6 Jul 2023 12:03:35 +0000 (14:03 +0200)] 
service: fix for RestartMode=direct option

With the fix done in PR28215, the unit restart job is created with type JOB_START.
Because of that, it is not properly merged anymore with the old one: the
merged job has state JOB_RUNNING. It should have state JOB_WAITING.

I think that the old job is not cleaned up because we don't go through the failed state.

With this fix, the merged job is properly created with state JOB_WAITING.

2 years agoservice: add new RestartMode option
Richard Phibel [Thu, 6 Jul 2023 12:33:52 +0000 (14:33 +0200)] 
service: add new RestartMode option

When this option is set to direct, the service restarts without entering a failed
state. Dependent units are not notified of transitory failure.

This is useful for the following use case:

We have a target with Requires=my-service, After=my-service.
my-service.service is a oneshot service and has Restart=on-failure in
its definition.

my-service.service can get stuck for various reasons and time out, in
which case it is restarted. Currently, when it fails the first time, the
target fails, even though my-service is restarted.

The behavior we're looking for is that until my-service is not restarted
anymore, the target stays pending waiting for my-service.service to
start successfully or fail without being restarted anymore.

2 years agotreewide: fix "an" before consonant U sounds
Joerg Behrmann [Thu, 6 Jul 2023 09:54:02 +0000 (11:54 +0200)] 
treewide: fix "an" before consonant U sounds

The article "a" goes before consonant sounds and "an" goes before vowel
sounds. This commit changes an to a for UKI, UDP, UTF-8, URL, UUID, U-Label, UI
and USB, since they start with the sound /ˌjuː/.

2 years agoHwdb: Add Sanwa Direct 400-MA128 external trackpad (#28272)
Andrew Baxter [Thu, 6 Jul 2023 10:42:33 +0000 (19:42 +0900)] 
Hwdb: Add Sanwa Direct 400-MA128 external trackpad (#28272)

* Hwdb: Add Sanwa Direct 400-MA128 external trackpad

```
$ udevadm info /dev/input/by-path/pci-0000:28:00.3-usb-0:1.4.4.1:1.1-event-mouse
P: /devices/pci0000:00/0000:00:07.1/0000:28:00.3/usb5/5-1/5-1.4/5-1.4.4/5-1.4.4.1/5-1.4.4.1:1.1/0003:258A:0501.0097/input/input256/event15
M: event15
R: 15
U: input
D: c 13:79
N: input/event15
L: 0
S: input/by-id/usb-SINO_WEALTH_USB_TOUCHPAD-if01-event-mouse
S: input/by-path/pci-0000:28:00.3-usb-0:1.4.4.1:1.1-event-mouse
E: DEVPATH=/devices/pci0000:00/0000:00:07.1/0000:28:00.3/usb5/5-1/5-1.4/5-1.4.4/5-1.4.4.1/5-1.4.4.1:1.1/0003:258A:0501.0097/input/input256/event15
E: DEVNAME=/dev/input/event15
E: MAJOR=13
E: MINOR=79
E: SUBSYSTEM=input
E: USEC_INITIALIZED=3436890430330
E: ID_INPUT=1
E: ID_INPUT_TOUCHPAD=1
E: ID_INPUT_WIDTH_MM=106
E: ID_INPUT_HEIGHT_MM=77
E: ID_BUS=usb
E: ID_MODEL=USB_TOUCHPAD
E: ID_MODEL_ENC=USB\x20TOUCHPAD
E: ID_MODEL_ID=0501
E: ID_SERIAL=SINO_WEALTH_USB_TOUCHPAD
E: ID_VENDOR=SINO_WEALTH
E: ID_VENDOR_ENC=SINO\x20WEALTH
E: ID_VENDOR_ID=258a
E: ID_REVISION=0521
E: ID_TYPE=hid
E: ID_USB_MODEL=USB_TOUCHPAD
E: ID_USB_MODEL_ENC=USB\x20TOUCHPAD
E: ID_USB_MODEL_ID=0501
E: ID_USB_SERIAL=SINO_WEALTH_USB_TOUCHPAD
E: ID_USB_VENDOR=SINO_WEALTH
E: ID_USB_VENDOR_ENC=SINO\x20WEALTH
E: ID_USB_VENDOR_ID=258a
E: ID_USB_REVISION=0521
E: ID_USB_TYPE=hid
E: ID_USB_INTERFACES=:030101:030000:
E: ID_USB_INTERFACE_NUM=01
E: ID_USB_DRIVER=usbhid
E: ID_PATH=pci-0000:28:00.3-usb-0:1.4.4.1:1.1
E: ID_PATH_TAG=pci-0000_28_00_3-usb-0_1_4_4_1_1_1
E: ID_INPUT_TOUCHPAD_INTEGRATION=internal
E: LIBINPUT_DEVICE_GROUP=3/258a/501:usb-0000:28:00.3-1.4.4
E: DEVLINKS=/dev/input/by-id/usb-SINO_WEALTH_USB_TOUCHPAD-if01-event-mouse /dev/input/by-path/pci-0000:28:00.3-usb-0:1.4.4.1:1.1-event-mouse
```
Link to product: https://www.amazon.co.jp/gp/product/B07Z5HCMFP

2 years agohwdb: add support for Archos 101 Cesium to 60-sensor.hwdb (#28270)
Thomas Genty [Thu, 6 Jul 2023 10:39:28 +0000 (12:39 +0200)] 
hwdb: add support for Archos 101 Cesium to 60-sensor.hwdb (#28270)

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
2 years agotpm2-util: remove unnecessary semicolon
Antonio Alvarez Feijoo [Thu, 6 Jul 2023 08:54:32 +0000 (10:54 +0200)] 
tpm2-util: remove unnecessary semicolon

2 years agonetwork/json: introduce PreferredLifetimeUSec and ValidLifetimeUSec
Yu Watanabe [Thu, 6 Jul 2023 04:26:03 +0000 (13:26 +0900)] 
network/json: introduce PreferredLifetimeUSec and ValidLifetimeUSec

2 years agoMerge pull request #28265 from yuwata/network-captive-portal-follow-ups
Lennart Poettering [Thu, 6 Jul 2023 09:39:24 +0000 (11:39 +0200)] 
Merge pull request #28265 from yuwata/network-captive-portal-follow-ups

network: several follow-ups for captive portal support

2 years agoservice: explicitly cast float to usec_t
Lennart Poettering [Thu, 6 Jul 2023 09:21:32 +0000 (11:21 +0200)] 
service: explicitly cast float to usec_t

Let's cast these floats explicitly to usec_t, since implicit
float-to-integer casts are dangerous business, and we should underline
that there's a cast happening here.

2 years agocore/service: make restart delay increase more smoothly
Yu Watanabe [Thu, 6 Jul 2023 03:48:49 +0000 (12:48 +0900)] 
core/service: make restart delay increase more smoothly

Suggested in https://github.com/systemd/systemd/pull/26902#issuecomment-1620400583.

2 years agoNEWS: more preparation for 254-rc1
Lennart Poettering [Thu, 6 Jul 2023 09:16:16 +0000 (11:16 +0200)] 
NEWS: more preparation for 254-rc1

2 years agoMerge pull request #27713 from ddstreet/tpm2_replace_make_primary
Lennart Poettering [Thu, 6 Jul 2023 08:22:12 +0000 (10:22 +0200)] 
Merge pull request #27713 from ddstreet/tpm2_replace_make_primary

Tpm2 replace make primary

2 years agoMerge pull request #28243 from bluca/sbat_initrd
Lennart Poettering [Thu, 6 Jul 2023 08:21:44 +0000 (10:21 +0200)] 
Merge pull request #28243 from bluca/sbat_initrd

ukify: enable --sbat for UKIs too

2 years agonetworkctl: urlify captive portal entry 28265/head
Yu Watanabe [Thu, 6 Jul 2023 02:48:43 +0000 (11:48 +0900)] 
networkctl: urlify captive portal entry

2 years agotest-network: drop ExecReload= in networkd.service and udevd.service
Yu Watanabe [Thu, 6 Jul 2023 02:33:44 +0000 (11:33 +0900)] 
test-network: drop ExecReload= in networkd.service and udevd.service

Follow-up for 0e07cdb0e77d0322bc866b5e13abbe38e988059d and
f84331539deae28fbeb42d45ad0c8d583b3372a3.

2 years agonetwork/ndisc: downgrade log level
Yu Watanabe [Thu, 6 Jul 2023 02:22:21 +0000 (11:22 +0900)] 
network/ndisc: downgrade log level

The failures may be critical for per-link operation, but not critical
for the service.

2 years agonetwork: handle captive portal with multiple routers
Yu Watanabe [Thu, 6 Jul 2023 02:12:19 +0000 (11:12 +0900)] 
network: handle captive portal with multiple routers

Before this patch, if a network has multiple routers and one of them
provides a captive portal, then the portal was overwritten or cleared
when another RA from another router is received.

This makes captive portals managed in the similar way as DNS servers or
DNS domains. So now captive portal can safely handled even if a network
has multiple routers.

2 years agonetwork: update comment
Yu Watanabe [Thu, 6 Jul 2023 01:34:24 +0000 (10:34 +0900)] 
network: update comment

2 years agonetwork: introduce link_get_captive_portal()
Yu Watanabe [Thu, 6 Jul 2023 01:31:01 +0000 (10:31 +0900)] 
network: introduce link_get_captive_portal()

Then, downgrade log level of the message about mis-match of captive
portals in different protocols.

2 years agoMerge pull request #28262 from YHNdnzj/transaction-followup
Yu Watanabe [Thu, 6 Jul 2023 03:55:25 +0000 (12:55 +0900)] 
Merge pull request #28262 from YHNdnzj/transaction-followup

Follow-ups for PropagatesStopTo= fix

2 years agotpm2: remove tpm2_make_primary() 27713/head
Dan Streetman [Thu, 8 Jun 2023 10:55:45 +0000 (06:55 -0400)] 
tpm2: remove tpm2_make_primary()

Replace use of tpm2_make_primary() with tpm2_create_loaded()

2 years agotpm2: move local vars in tpm2_unseal() to point of use
Dan Streetman [Wed, 14 Jun 2023 16:09:35 +0000 (12:09 -0400)] 
tpm2: move local vars in tpm2_unseal() to point of use

No functional change; cosmetic only.

2 years agotpm2: add tpm2_get_or_create_srk()
Dan Streetman [Wed, 14 Jun 2023 19:49:33 +0000 (15:49 -0400)] 
tpm2: add tpm2_get_or_create_srk()

Add function to simplify getting the TPM SRK; if one exists, it is provided,
otherwise one is created and then the new SRK provided.

This also add tpm2_create_loaded() and updates tpm2_seal() to use the new
functions instead of tpm2_make_primary().

2 years agotpm2: add tpm2_persist_handle()
Dan Streetman [Mon, 2 Jan 2023 04:42:09 +0000 (23:42 -0500)] 
tpm2: add tpm2_persist_handle()

Add function to convert a transient handle in the TPM into a persistent handle
in the TPM.

2 years agotpm2: cache TPM algorithms
Dan Streetman [Wed, 14 Jun 2023 17:17:21 +0000 (13:17 -0400)] 
tpm2: cache TPM algorithms

Cache the supported algorithms when creating a new context.

2 years agotpm2: cache the TPM supported commands, add tpm2_supports_command()
Dan Streetman [Fri, 17 Feb 2023 17:59:18 +0000 (12:59 -0500)] 
tpm2: cache the TPM supported commands, add tpm2_supports_command()

Cache the TPM's supported commands and provide a function to check if a command
is supported.

2 years agobasic/alloc-util: add greedy_realloc_append()
Dan Streetman [Fri, 17 Feb 2023 17:59:18 +0000 (12:59 -0500)] 
basic/alloc-util: add greedy_realloc_append()

Add function to perform greedy realloc as well as copying the new data into the
newly allocated space.

2 years agotpm2: replace tpm2_capability_pcrs() macro with direct c->capaiblity_pcrs use
Dan Streetman [Thu, 8 Jun 2023 17:41:33 +0000 (13:41 -0400)] 
tpm2: replace tpm2_capability_pcrs() macro with direct c->capaiblity_pcrs use

2 years agotpm2: add tpm2_create()
Dan Streetman [Mon, 12 Dec 2022 14:46:04 +0000 (09:46 -0500)] 
tpm2: add tpm2_create()

This allows creating a new object (e.g. sealed secret) or key using the TPM.

Note that the new object/key is not loaded in the TPM after creation.

2 years agotpm2: replace magic number in hmac_sensitive initialization
Dan Streetman [Thu, 8 Jun 2023 18:06:46 +0000 (14:06 -0400)] 
tpm2: replace magic number in hmac_sensitive initialization

Instead of setting hmac_sensitive.sensitive.data.size to '32' use the actual
hash size as set in the hmac_template.

2 years agotpm2: move local vars in tpm2_seal() to point of use
Dan Streetman [Mon, 12 Dec 2022 14:46:04 +0000 (09:46 -0500)] 
tpm2: move local vars in tpm2_seal() to point of use

No functional change; cosmetic only.

2 years agotpm2: add tpm2_load_external()
Dan Streetman [Mon, 19 Dec 2022 13:26:32 +0000 (08:26 -0500)] 
tpm2: add tpm2_load_external()

This allows loading an external object/key (e.g. an openssl public key) into
the TPM.

2 years agotpm2: add tpm2_load()
Dan Streetman [Mon, 19 Dec 2022 13:26:32 +0000 (08:26 -0500)] 
tpm2: add tpm2_load()

This function allows loading an object (e.g. a sealed secret) or key into the
TPM.

2 years agoupdate syscall tables for upcoming v254
Lennart Poettering [Wed, 5 Jul 2023 21:16:48 +0000 (23:16 +0200)] 
update syscall tables for upcoming v254

2 years agoupdate hwdb autosuspend data for v254
Lennart Poettering [Wed, 5 Jul 2023 21:15:09 +0000 (23:15 +0200)] 
update hwdb autosuspend data for v254

2 years agomeson: run forgotten 'update-man-rules'
Lennart Poettering [Wed, 5 Jul 2023 21:14:22 +0000 (23:14 +0200)] 
meson: run forgotten 'update-man-rules'

2 years agoTEST-03-JOBS: test indirect PropagatesStopTo= 28262/head
Mike Yuan [Wed, 5 Jul 2023 18:40:01 +0000 (02:40 +0800)] 
TEST-03-JOBS: test indirect PropagatesStopTo=

2 years agocore/transaction: correctly skip unneeded operations for PropagatesStopTo=
Mike Yuan [Wed, 5 Jul 2023 18:17:36 +0000 (02:17 +0800)] 
core/transaction: correctly skip unneeded operations for PropagatesStopTo=

Follow-up for 48cb073db81fa73f64bc5aa9a1b81ebf627235fa

Break out from LIST_FOREACH correctly if nt == JOB_NOP.
Shouldn't have functional changes, just optimization.

2 years agoMerge pull request #28258 from poettering/boot-feature-catchup
Luca Boccassi [Wed, 5 Jul 2023 20:40:43 +0000 (21:40 +0100)] 
Merge pull request #28258 from poettering/boot-feature-catchup

sd-boot/sd-stub boot feature flag catchup

2 years agoMerge pull request #28255 from yuwata/sd-device-fix-clone
Luca Boccassi [Wed, 5 Jul 2023 20:38:52 +0000 (21:38 +0100)] 
Merge pull request #28255 from yuwata/sd-device-fix-clone

sd-device: fix device_clone_with_db()

2 years agotest: replace readfp() with read_file()
Frantisek Sumsal [Wed, 5 Jul 2023 17:43:43 +0000 (19:43 +0200)] 
test: replace readfp() with read_file()

ConfigParser.readfp() has been deprecated since Python 3.2 and was
dropped completely in Python 3.11.

2 years agoukify: measure sbat section too 28243/head
Luca Boccassi [Tue, 4 Jul 2023 14:55:20 +0000 (15:55 +0100)] 
ukify: measure sbat section too

2 years agoukify: enable --sbat for UKIs too
Luca Boccassi [Mon, 3 Jul 2023 17:33:07 +0000 (18:33 +0100)] 
ukify: enable --sbat for UKIs too

For confidential computing they want to be able to revoke initrds too, so allow
passing a specific --sbat section when building a UKI too, not just an addon.
Merge it with the stub and kernel sections.

2 years agohwdb update for v246-rc1
Lennart Poettering [Wed, 5 Jul 2023 20:00:19 +0000 (22:00 +0200)] 
hwdb update for v246-rc1

2 years agohostname-setup: don't pass "true" to a flags parameter
Lennart Poettering [Wed, 5 Jul 2023 16:02:52 +0000 (18:02 +0200)] 
hostname-setup: don't pass "true" to a flags parameter

2 years agoMerge pull request #28252 from yuwata/journal-open-machine
Mike Yuan [Wed, 5 Jul 2023 19:08:18 +0000 (03:08 +0800)] 
Merge pull request #28252 from yuwata/journal-open-machine

journal: introduce journal_open_machine()

2 years agoboot: make LoaderType enum less special 28258/head
Lennart Poettering [Wed, 5 Jul 2023 13:42:30 +0000 (15:42 +0200)] 
boot: make LoaderType enum less special

Usually (but not always) we use uppercase type naming, and do a typedef
for enums like this. Do so here too.

2 years agoboot: rename entry_count → n_entries
Lennart Poettering [Wed, 5 Jul 2023 13:41:26 +0000 (15:41 +0200)] 
boot: rename entry_count → n_entries

While we don't strictly follow the rule, most of our userspace names
these fields that count entries in some array n_xyz, hence let's do so
in the EFI boot code too, to make things less special.

2 years agoefi: add a bunch of reported EFI loader/stub feature flags
Lennart Poettering [Wed, 5 Jul 2023 13:38:38 +0000 (15:38 +0200)] 
efi: add a bunch of reported EFI loader/stub feature flags

We gained a bunch of new features that deserve reporting to userspace,
hence add matching flags for each.

This allows userspace to determine if installing addons in the ESP even
makes sense.

This is inspired by a similar changes in #28057

2 years agojournal-upload: add missing assertion 28252/head
Yu Watanabe [Wed, 5 Jul 2023 00:59:51 +0000 (09:59 +0900)] 
journal-upload: add missing assertion

2 years agojournal-upload: replace deprecated sd_journal_open_container()
Yu Watanabe [Wed, 5 Jul 2023 00:58:57 +0000 (09:58 +0900)] 
journal-upload: replace deprecated sd_journal_open_container()

2 years agojournal-util: extract journal_open_machine() from journalctl
Yu Watanabe [Wed, 5 Jul 2023 00:53:44 +0000 (09:53 +0900)] 
journal-util: extract journal_open_machine() from journalctl

2 years agosd-journal: introduce SD_JOURNAL_TAKE_DIRECTORY_FD flag for sd_journal_open_directory...
Yu Watanabe [Wed, 5 Jul 2023 00:49:45 +0000 (09:49 +0900)] 
sd-journal: introduce SD_JOURNAL_TAKE_DIRECTORY_FD flag for sd_journal_open_directory_fd()

If it is called with the flag, then the provided file descriptor will be
owned by the sd_journal object, and will be closed in sd_journal_close().

2 years agotest: change partition label to test if the outdated devlinks are removed 28255/head
Yu Watanabe [Wed, 5 Jul 2023 03:05:45 +0000 (12:05 +0900)] 
test: change partition label to test if the outdated devlinks are removed

The change is intended to reproduce the issue #27983, though the
original issue is highly racy, and the test does not reproduce it
reliably. But, anyway, it is better to change the partition label to
test the devlink removal.

2 years agosd-device: do not read uevent file in device_clone_with_db()
Yu Watanabe [Wed, 5 Jul 2023 02:44:00 +0000 (11:44 +0900)] 
sd-device: do not read uevent file in device_clone_with_db()

Follow-up for 381f6d4ba5551898e7ff19189485072b94879281.

When the function is called, the device may be already removed, and
another device has the same syspath. Such situation can occur when a
partition removed and another is created. In that case, the sysfs paths
of the removed and newly created partitions can be same, but their
devnums are different, and thus the database files corresponding to the
devices are also different.

Fixes #27981.

2 years agoMerge pull request #26844 from YHNdnzj/propagate-stop-fixup
Lennart Poettering [Wed, 5 Jul 2023 13:56:21 +0000 (15:56 +0200)] 
Merge pull request #26844 from YHNdnzj/propagate-stop-fixup

core: introduce UNIT_ATOM_PROPAGATE_STOP_GRACEFUL for PropagatesStopTo=

2 years agoMerge pull request #28207 from poettering/initrd-creds
Luca Boccassi [Wed, 5 Jul 2023 09:29:33 +0000 (10:29 +0100)] 
Merge pull request #28207 from poettering/initrd-creds

various credential improvements (including initrd creds, creds in generators, fstab + getty creds)

2 years agoMerge pull request #28253 from yuwata/hwdb-follow-up
Lennart Poettering [Wed, 5 Jul 2023 08:40:44 +0000 (10:40 +0200)] 
Merge pull request #28253 from yuwata/hwdb-follow-up

hwdb: several cleanups

2 years agoMerge pull request #28228 from yuwata/repart-free-area
Yu Watanabe [Wed, 5 Jul 2023 07:36:16 +0000 (16:36 +0900)] 
Merge pull request #28228 from yuwata/repart-free-area

repart: fix free area calculation

2 years agounit: also condition out systemd-backlight in initrd
Yu Watanabe [Wed, 5 Jul 2023 02:00:23 +0000 (11:00 +0900)] 
unit: also condition out systemd-backlight in initrd

Follow-up for 9173d31dfea5c2b05ff08480972c499cb7aac940.

The systemd-backlight@.service also save/restore state but the data
is in /var/.

2 years agounits: condition out a few services in the initrd
Lennart Poettering [Tue, 4 Jul 2023 20:31:11 +0000 (22:31 +0200)] 
units: condition out a few services in the initrd

Let's make our units more robust to being added to an initrd:

1. systemd-boot-update only makes sense if sd-boot is available in /usr/
   to copy into the ESP. This is generally not the case in initrds, and
   even if it was, we shouldn't update the ESP from the initrd, but from
   the host instead.

2. The rfkill services save/restore rfkill state, but that information
   is only available once /var/ is mounted, which generally happens
   after the initrd transition.

3. utmp management is partly in /var/, and legacy anyway, hence don't
   bother with it in the initrd.

2 years agotest: update test for free area calculation in repart 28228/head
Yu Watanabe [Mon, 3 Jul 2023 06:15:27 +0000 (15:15 +0900)] 
test: update test for free area calculation in repart

2 years agorepart: fix free area calculation
Yu Watanabe [Mon, 3 Jul 2023 06:14:14 +0000 (15:14 +0900)] 
repart: fix free area calculation

Like fdisk_get_last_lba(), fdisk_partition_get_end() return the last
sector in the partition.

Fixes #28225.

2 years agotest: add reproducer for issue #28225
Yu Watanabe [Mon, 3 Jul 2023 03:11:50 +0000 (12:11 +0900)] 
test: add reproducer for issue #28225

2 years agohwdb: make matching modalias for Archos 101 Cesium Educ more strict 28253/head
Yu Watanabe [Wed, 5 Jul 2023 01:17:59 +0000 (10:17 +0900)] 
hwdb: make matching modalias for Archos 101 Cesium Educ more strict

Follow-up for 41f34dcf3bc7004aaa9b251480d56bcfe144346d.

2 years agohwdb: merge multiple keyboard entries with same setting
Yu Watanabe [Wed, 5 Jul 2023 01:28:42 +0000 (10:28 +0900)] 
hwdb: merge multiple keyboard entries with same setting

Follow-up for 123c0e24dd3af4c7168ee77dad841cc730b5db60.

Note, the entry was originally added for IdeaPad Flex 5 in
21b589a15504cdbd309a82abb566ef4e36957f92.
Then, a bug introduced by 19db450f3a243fcaf0949beebafc3025f8e3a98e.
But, when it was fixed by 738a195bd59dc2e85c15382d17d391c1781aaa4e,
the glob becomes too stricter, and another variant was added by
123c0e24dd3af4c7168ee77dad841cc730b5db60.

2 years agohwdb: drop trailing white space
Yu Watanabe [Wed, 5 Jul 2023 01:16:56 +0000 (10:16 +0900)] 
hwdb: drop trailing white space

Follow-up for 4687f001e689fd482f530a8d1d0adc93e01d74ea.

2 years agojournal-upload: make --namespace=* work
Yu Watanabe [Wed, 5 Jul 2023 00:19:16 +0000 (09:19 +0900)] 
journal-upload: make --namespace=* work

Follow-up for 9f6e0bd417fa287dd1e7b541bfe0c60f04cc29e4.

Note that sd_journal_open() is a simple wrapper of sd_journal_open_namespace(),
hence we can merge the two branch.

2 years agotest: add test cases for issue #26839 in TEST-03-JOBS 26844/head
Mike Yuan [Thu, 16 Mar 2023 08:23:17 +0000 (16:23 +0800)] 
test: add test cases for issue #26839 in TEST-03-JOBS

2 years agocore: introduce UNIT_ATOM_PROPAGATE_STOP_GRACEFUL for PropagatesStopTo=
Mike Yuan [Mon, 3 Jul 2023 23:28:33 +0000 (07:28 +0800)] 
core: introduce UNIT_ATOM_PROPAGATE_STOP_GRACEFUL for PropagatesStopTo=

Follow-up for 017a7ba4f406adcf69d6b3ec15b9f2d9ed5ad853

Before this commit, when a unit that is restarting propagates stop
to other units, it can also depend on them, which results in
job type conflict and thus failure to pull in the dependencies.

So, let's introduce a new dependency atom UNIT_ATOM_PROPAGATE_STOP_GRACEFUL,
and use it for PropagatesStopTo=. It will enqueue a restart job if
there's already a start job, which meets the ultimate goal and avoids
job type conflict.

Fixes #26839

2 years agocore/transaction: return early when appropriate to reduce nesting
Mike Yuan [Mon, 3 Jul 2023 22:55:55 +0000 (06:55 +0800)] 
core/transaction: return early when appropriate to reduce nesting

2 years agoman/systemctl: document --job-mode=restart-dependencies
Mike Yuan [Wed, 5 Jul 2023 00:14:27 +0000 (08:14 +0800)] 
man/systemctl: document --job-mode=restart-dependencies

Follow-up for 09d04ad325473e05e23e6ba8382d7de1dd819bda

2 years agoupdate TODO 28207/head
Lennart Poettering [Fri, 23 Jun 2023 20:50:02 +0000 (22:50 +0200)] 
update TODO

2 years agoimport-creds: add support for binary credentials specified on the kernel cmdline
Lennart Poettering [Tue, 4 Jul 2023 09:46:37 +0000 (11:46 +0200)] 
import-creds: add support for binary credentials specified on the kernel cmdline

2 years agoman: document where PID 1 imports credentials from
Lennart Poettering [Fri, 30 Jun 2023 09:46:16 +0000 (11:46 +0200)] 
man: document where PID 1 imports credentials from

2 years agoman: document how credentials are passed into generators
Lennart Poettering [Fri, 30 Jun 2023 09:45:59 +0000 (11:45 +0200)] 
man: document how credentials are passed into generators

2 years agodoc: document inird credentials + and how to consume credentials in generators
Lennart Poettering [Fri, 30 Jun 2023 09:44:46 +0000 (11:44 +0200)] 
doc: document inird credentials + and how to consume credentials in generators

(as well as various other fixes)

2 years agogenerator: run various generators only run on the host, not in initrd
Lennart Poettering [Fri, 30 Jun 2023 08:23:10 +0000 (10:23 +0200)] 
generator: run various generators only run on the host, not in initrd

These 5 generators only make sense on the host,not in the initrd, hence
if they end up in the initrd anyway, make them exit quickly.

2 years agotest: verify that the getty generator with creds works
Lennart Poettering [Thu, 29 Jun 2023 20:53:26 +0000 (22:53 +0200)] 
test: verify that the getty generator with creds works

2 years agogetty-generator: minor modernizations
Lennart Poettering [Fri, 23 Jun 2023 20:50:55 +0000 (22:50 +0200)] 
getty-generator: minor modernizations

2 years agogetty-generator: allow configuring additional gettys via credentials
Lennart Poettering [Fri, 23 Jun 2023 20:50:34 +0000 (22:50 +0200)] 
getty-generator: allow configuring additional gettys via credentials

2 years agotest: add simple fstab credential test
Lennart Poettering [Thu, 29 Jun 2023 19:52:57 +0000 (21:52 +0200)] 
test: add simple fstab credential test

2 years agofstab-generator: add more parameter name comments
Lennart Poettering [Fri, 23 Jun 2023 20:49:55 +0000 (22:49 +0200)] 
fstab-generator: add more parameter name comments

2 years agofstab-generator: optional read addtional fstab lines from credentials
Lennart Poettering [Fri, 23 Jun 2023 19:51:12 +0000 (21:51 +0200)] 
fstab-generator: optional read addtional fstab lines from credentials

Fixes: #27260
2 years agotest: add test for initrd credentials
Lennart Poettering [Thu, 29 Jun 2023 17:03:08 +0000 (19:03 +0200)] 
test: add test for initrd credentials

This extends the test framework a bit, and allows adding additional
initrds to the qemu invocation, which we use here to place credentials
in the new /run/systemd/@initrd/ credentials dir which are then passed
to the host.

2 years agoimport-creds: unify acquire_credential_directory() + acquire_encrypted_credential_dir...
Lennart Poettering [Thu, 29 Jun 2023 10:53:23 +0000 (12:53 +0200)] 
import-creds: unify acquire_credential_directory() + acquire_encrypted_credential_directory()

Let's unify these very similar functions, and port them to the new
mount_credentials_fs() call.

While we are at it, if we detect that the credentials dir already is a
mount point, remount it writable so that we can actually write to it.

2 years agoexecute: split out mounting of credentials fs
Lennart Poettering [Thu, 29 Jun 2023 10:32:44 +0000 (12:32 +0200)] 
execute: split out mounting of credentials fs

Let's add two new helpers: mount_credentials_fs() and
credentials_fs_mount_flags(). The former mounts a file system suitable
for storing of unencrypted credentials at runtime (i.e. a ramfs or
tmpfs). The latter determines the right mount flags to use for such a
mount.

Both functions mostly just take code from execute.c, but make two
changes:

1. If the kernel supports it we'll use a tmpfs with the new "noswap"
   mount option instead of ramfs. Was added in kernel 6.4, hence is very
   recent, but tmpfs is so much less crappy than ramfs, hence worth it.

2. We'll set MS_NOSYMFOLLOW on the mounts if supported. These file
   systems should only contain regulra files, hence no need to allow
   symlinks.

2 years agoimport-creds: show list of imported credentials during initialization of PID 1
Lennart Poettering [Wed, 28 Jun 2023 20:58:07 +0000 (22:58 +0200)] 
import-creds: show list of imported credentials during initialization of PID 1

Let's make things easier to debug: provide an overview what has been
passed, during boot.

2 years agocore: consult credentials for machine ID to use for host
Lennart Poettering [Wed, 28 Jun 2023 16:11:15 +0000 (18:11 +0200)] 
core: consult credentials for machine ID to use for host

Let's hook up one more thing with credentials: the machine ID to use
when none is initialized yet.

This requires some reordering of initialization steps in PID 1: we need
to import credentials first, and only then initialize the machine ID.

2 years agoimport-creds: pick up vmm.notify_socket also from encrypted credentials
Lennart Poettering [Wed, 28 Jun 2023 16:10:40 +0000 (18:10 +0200)] 
import-creds: pick up vmm.notify_socket also from encrypted credentials

Now that we have the infra in place, make PID 1 pick up encrypted
credentials too.

(While we are at it, split this out into its own helper)

2 years agocreds-util: add new helper read_credential_with_decryption()
Lennart Poettering [Fri, 23 Jun 2023 19:48:15 +0000 (21:48 +0200)] 
creds-util: add new helper read_credential_with_decryption()

This is just like read_credential() but also looks into the encrypted
credential directory, not just the regular one.

Normally, we decrypt credentials at the moment we pass them to services.
From service PoV all credentials are hence decrypted credentials.

However, when we want to access credentials in a generator this logic
does not apply: here we have the regular and the encrypted credentials
directory. So far we didn't attempt to make use of credentials in
generators hence.

Let's address and add helper that looks into both directories, and talks
to the TPM if necessary to decrypt the credentials.

2 years agoimport-creds: define a new dir where initrd configurators can pass credentials to...
Lennart Poettering [Fri, 23 Jun 2023 15:49:44 +0000 (17:49 +0200)] 
import-creds: define a new dir where initrd configurators can pass credentials to host

2 years agoexecute: fix credential dir handling for fs which support ACLs
Lennart Poettering [Tue, 4 Jul 2023 20:26:52 +0000 (22:26 +0200)] 
execute: fix credential dir handling for fs which support ACLs

When the credential dir is backed by an fs that supports ACLs we must be
more careful with adjusting the 'x' bit of the directory, as any chmod()
call on the dir will reset the mask entry of the ACL entirely which we
don't want. Hence, do a manual set of ACL changes, that only add/drop
the 'x' bit but otherwise leave the ACL as it is.

This matters if we use tmpfs rather than ramfs to store credentials.

2 years agoman: make sure credentials properly show up in directives index
Lennart Poettering [Fri, 30 Jun 2023 08:22:35 +0000 (10:22 +0200)] 
man: make sure credentials properly show up in directives index

2 years agojournal-remote: upload journals from namespace
Igor Tsiglyar [Mon, 3 Jul 2023 13:51:32 +0000 (16:51 +0300)] 
journal-remote: upload journals from namespace

2 years agohwdb : add support for Archos 101 Cesium Educ to 60-sensor.hwdb
Thomas Genty [Tue, 4 Jul 2023 13:41:57 +0000 (15:41 +0200)] 
hwdb : add support for Archos 101 Cesium Educ to 60-sensor.hwdb

2 years agoNEWS/--help: correct/be clearer on bootclt -R vs. -RR
Lennart Poettering [Tue, 4 Jul 2023 11:04:56 +0000 (13:04 +0200)] 
NEWS/--help: correct/be clearer on bootclt -R vs. -RR

The NEWS file was simply wrong. Let's also improve the --help text on
this.

Fixes: #28221
2 years agohibernate-resume-generator: downgrade 'noresume' log message
Lennart Poettering [Tue, 4 Jul 2023 09:47:19 +0000 (11:47 +0200)] 
hibernate-resume-generator: downgrade 'noresume' log message

This log message is shown pretty regular at boot in various scenarios
(such as CI builds), and it's not a reason for any concern, it's just the
immediate effect of explicit configuration. Hence let's downgrade from
LOG_NOTICE to LOG_INFO so that it is still usually in the boot output,
but not particularly highlighted, since there's really no reason to.

2 years agosystemctl: implement a new "whoami" verb, that just returns unit of caller/PID
Lennart Poettering [Mon, 3 Jul 2023 12:36:14 +0000 (14:36 +0200)] 
systemctl: implement a new "whoami" verb, that just returns unit of caller/PID

2 years agotest: wait for the interface to become routable after reconfiguring
Frantisek Sumsal [Mon, 3 Jul 2023 19:38:42 +0000 (21:38 +0200)] 
test: wait for the interface to become routable after reconfiguring

Since 6e8477edd3 TEST-75 started failing with:

[  571.468298] testsuite-75.sh[46]: + for addr in "${DNS_ADDRESSES[@]}"
[  571.468298] testsuite-75.sh[46]: + run delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.468899] testsuite-75.sh[562]: + tee /tmp/tmp.qKlHPbCCJZ
[  571.469317] testsuite-75.sh[561]: + delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.501381] testsuite-75.sh[562]: ;; network unreachable resolving 'mail.signed.test/A/IN': fd00:dead:beef:cafe::1#53
[  571.501564] testsuite-75.sh[562]: ;; resolution failed: SERVFAIL
[  571.515457] testsuite-75.sh[46]: + grep -qF '; fully validated' /tmp/tmp.qKlHPbCCJZ

Let's wait for the dns0 interface to become routable again after
re-enabling IPv6 to, hopefully, mitigate this.