Compare commits

...

22 Commits

Author SHA1 Message Date
Yu Watanabe 0ce8a9d6e5
Merge pull request #16939 from Rahix/robust-first-boot-machine-id
Make ConditionFirstBoot safe against power failures
2020-10-20 14:01:41 +09:00
Yu Watanabe 1586d324bd
Merge pull request #17352 from msekletar/ens-names-fix
udev/net_id: don't generate slot based names if multiple devices might claim the same slot
2020-10-20 13:49:29 +09:00
Felix Riemann 1eee15c388 update-done: Do not fail with read-only /etc or /var
With the switch from log_debug() to log_debug_errno() in commit c413bb28df
systemd-update-done would fail without any error message if /etc
or /var were read-only. This restores the previous behaviour to
silently ignore these directories again.
2020-10-20 13:46:36 +09:00
Yu Watanabe 4b28e50f9e
Merge pull request #17390 from keszybz/logind-notifications-and-links
Fix sd_notify() usage in various daemons and update some documentation links
2020-10-20 13:44:52 +09:00
Michal Sekletár 2c8ec0095e udev/net_id: don't generate slot based names if multiple devices might claim the same slot 2020-10-19 17:55:44 +02:00
Harald Seiler a48627ef87 man: Document new machine-id and first boot behavior 2020-10-19 16:28:22 +02:00
Harald Seiler 3af54f9bbe units: order systemd-random-seed.service before first-boot-complete.target
Ensure that systemd-random-seed.service has completed before marking
a first boot as completed to guarantee that a saved seed will only be
used after it has been initialized at least once.
2020-10-19 16:28:22 +02:00
Harald Seiler a1e3787148 units: order systemd-firstboot.service before first-boot-complete.target
Make sure systemd-firstboot completes before reaching first-boot-complete.target
and thus marking the first boot as completed.  This way, it is
guaranteed that systemd-firstboot has a chance to complete provisioning
at least once, even in cases of the first boot getting aborted early.
2020-10-19 16:28:22 +02:00
Harald Seiler f4466bdbf9 units: add first-boot-complete.target for first boot ordering
Add a new target for synchronizing units that wish to run once during
the first boot of the system.  The machine-id will be committed to disk
only after the target has been reached, thus ensuring that all units
ordered before it had a chance to complete.
2020-10-19 16:28:22 +02:00
Harald Seiler c261a5d014 machine-id-setup: sync before committing machine-id
sync() before committing a transient machine-id to disk.  This will
ensure that any filesystem changes made by first-boot units will have
been persisted before the first boot is marked as completed.
2020-10-19 16:28:22 +02:00
Harald Seiler 3023f2fead core: keep machine-id transient until first boot completes
Currently, a loss of power after the machine-id was written but before
all units with ConditionFirstBoot=yes ran would lead to the next boot
finding a valid machine-id, thus not being marked first boot and not
re-running these units.

To make the first boot mechanism more robust, instead of writing
/etc/machine-id very early, fill it with a marker value "uninitialized"
and overmount it with a transiently provisioned machine-id.  Then, after
the first boots completes (when systemd-machine-id-commit.service runs),
write the real machine-id to disk.

This mechanism is of course only invoked on first boot.  If a first boot
is not detected, the machine-id is handled as previously.

Fixes: #4511
2020-10-19 16:28:22 +02:00
Harald Seiler ab763cb2be dissect-image: support "uninitialized" machine-id
If the first boot was aborted, /etc/machine-id might read as
"uninitialized" in some cases.  Add a separate case for this
instead of printing a confusing error message.
2020-10-19 16:28:22 +02:00
Harald Seiler 448b782cb2 repart: correctly handle "uninitialized" machine-id
When systemd-repart runs from initramfs, it reads out /etc/machine-id
from the rootfs as a seed for partition UUIDs.  However, the machine-id
could be in an "uninitialized" state from a previous failed first boot.
In this situation the -ENOMEDIUM code-path (no machine-id set) should be
taken.
2020-10-19 16:28:21 +02:00
Harald Seiler c5fbeedb0c nspawn: robustly deal with "uninitialized" machine-id
When nspawn starts an image, this image could be in any state, including
an aborted first boot.  For this case, it needs to correctly handle the
situation like there was no machine-id at all.
2020-10-19 16:28:21 +02:00
Harald Seiler 8085114828 id128: add format which treats "uninitialized" like an empty id
Add a new ID128_PLAIN_OR_UNINIT format which treats the string
"uninitialized" like the file was empty and return -ENOMEDIUM.  This
format should be used when reading an /etc/machine-id file from an image
that is not currently running.
2020-10-19 16:28:21 +02:00
Zbigniew Jędrzejewski-Szmek 515736d0f3 tree-wide: update web link to logind description
https://www.freedesktop.org/wiki/Software/systemd/multiseat/ says that it
is obsoleted by sd-login(3), so it doesn't make much sense to link to the former.
2020-10-19 15:23:37 +02:00
Zbigniew Jędrzejewski-Szmek 6c75e31703 logind: minor indentation adjustments 2020-10-19 15:23:37 +02:00
Zbigniew Jędrzejewski-Szmek 21fe744cfb logind: use notify_start/notify_on_cleanup
Logging about the pid is dropped, pid1 does that better.
2020-10-19 15:23:37 +02:00
Zbigniew Jędrzejewski-Szmek 297fc20dc4 shared/daemon-util: fix notify_on_cleanup()
p itself is never null. Because of this, we would always
call sd_notify() in cleanup, even though the intention was to only
call it if notify_start() was executed.
2020-10-19 15:23:37 +02:00
Harald Seiler 583cef3b73 core: treat "uninitialized" in /etc/machine-id as first boot as well
When /etc/machine-id contains the string "uninitialized" instead of
a valid machine-id, treat this like the file was missing and mark this
boot as the first (-> units with ConditionFirstBoot=yes will run).
2020-10-19 12:33:39 +02:00
Harald Seiler 7139e9d9a3 preset: don't enable proc-sys-fs-binfmt_misc.mount
The proc-sys-fs-binfmt_misc.mount unit should not be enabled by
preset-all because it should only be used as fallback in case
proc-sys-fs-binfmt_misc.automount cannot be used on a system.  In these
cases it should be enabled manually by an administrator.
2020-10-19 12:33:39 +02:00
Michal Sekletár 3e545ae5ab udev/net_id: parse _SUN ACPI index as a signed integer
Negative value means there is no match between a PCI device and any of
the slots. In the following commit we will extend this and value of 0
will indicate that there is a match between some slot and PCI device,
but that device is a PCI bridge.
2020-10-19 12:18:03 +02:00
50 changed files with 326 additions and 171 deletions

View File

@ -78,7 +78,7 @@ Documentation: man:core(5)
Subject: Новая сесія № @SESSION_ID@ створана для карыстальніка @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Новая сесія з № @SESSION_ID@ створана для карыстальніка @USER_ID@.
@ -88,7 +88,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Сесія № @SESSION_ID@ спынена
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Сесія № @SESSION_ID@ спынена.
@ -96,7 +96,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Даступна новае працоўнае месца № @SEAT_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Новае працоўнае месца № @SEAT_ID@ наладжана і даступна для выкарыстання.
@ -104,7 +104,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Працоўнае месца № @SEAT_ID@ выдалена
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Працоўнае месца № @SEAT_ID@ выдалена і больш не даступна.

View File

@ -79,7 +79,7 @@ Rekamiendujecca paviedamić ab hetym raspracoŭnikam.
Subject: Novaja siesija № @SESSION_ID@ stvorana dlia karystaĺnika @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Novaja siesija z № @SESSION_ID@ stvorana dlia karystaĺnika @USER_ID@.
@ -89,7 +89,7 @@ Lidar hetaj siesii pad № @LEADER@.
Subject: Siesija № @SESSION_ID@ spyniena
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Siesija № @SESSION_ID@ spyniena.
@ -97,7 +97,7 @@ Siesija № @SESSION_ID@ spyniena.
Subject: Dastupna novaje pracoŭnaje miesca № @SEAT_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Novaje pracoŭnaje miesca № @SEAT_ID@ naladžana i dastupna dlia
vykarystannia.
@ -106,7 +106,7 @@ vykarystannia.
Subject: Pracoŭnaje miesca № @SEAT_ID@ vydaliena
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Pracoŭnaje miesca № @SEAT_ID@ vydaliena i boĺš nie dastupna.

View File

@ -81,7 +81,7 @@ Documentation: man:core(5)
Subject: Създадена е нова сесия № @SESSION_ID@ за потребителя „@USER_ID@“
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
За потребителя „@USER_ID@“ е създадена нова сесия № @SESSION_ID@.
@ -91,7 +91,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Сесия № @SESSION_ID@ приключи
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Сесия № @SESSION_ID@ приключи работа.
@ -99,7 +99,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Налично е ново работно място № @SEAT_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Новото работно място № @SEAT_ID@ е настроено и готово за работа.
@ -107,7 +107,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Работното място № @SEAT_ID@ е премахнато
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Работното място № @SEAT_ID@ вече не е налично.

View File

@ -89,7 +89,7 @@ about the file being truncated.
Subject: A new session @SESSION_ID@ has been created for user @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
A new session with the ID @SESSION_ID@ has been created for the user @USER_ID@.
@ -99,7 +99,7 @@ The leading process of the session is @LEADER@.
Subject: Session @SESSION_ID@ has been terminated
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
A session with the ID @SESSION_ID@ has been terminated.
@ -107,7 +107,7 @@ A session with the ID @SESSION_ID@ has been terminated.
Subject: A new seat @SEAT_ID@ is now available
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
A new seat @SEAT_ID@ has been configured and is now available.
@ -115,7 +115,7 @@ A new seat @SEAT_ID@ has been configured and is now available.
Subject: Seat @SEAT_ID@ has now been removed
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
A seat @SEAT_ID@ has been removed and is no longer available.

View File

@ -64,7 +64,7 @@ og burde blive reporteret som en bug til folkene bag
Subject: En ny session @SESSION_ID@ er blevet lavet for bruger @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
En ny session med ID @SESSION_ID@ er blevet lavet for brugeren @USER_ID@.
@ -74,7 +74,7 @@ Den ledende process for sessionen er @LEADER@.
Subject: Session @SESSION_ID@ er blevet lukket ned
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
En session med ID @SESSION_ID@ er blevet lukket ned.
@ -82,7 +82,7 @@ En session med ID @SESSION_ID@ er blevet lukket ned.
Subject: En ny arbejdsstation $SEAT_ID@ er nu tilgængelig
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
En ny arbejdsstation @SEAT_ID@ er blevet konfigureret og er nu tilgængelig.
@ -90,7 +90,7 @@ En ny arbejdsstation @SEAT_ID@ er blevet konfigureret og er nu tilgængelig.
Subject: Arbejdsstation @SEAT_ID@ er nu blevet fjernet
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
En arbejdsstation @SEAT_ID@ er blevet fjernet og er ikke længere tilgængelig.

View File

@ -82,7 +82,7 @@ incriminé, et cela devrait être notifié à son concepteur comme un défaut (b
Subject: Une nouvelle session @SESSION_ID@ a été créée pour l'utilisateur @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Une nouvelle session a été créée pour l'utilisateur @USER_ID@ avec
l'identifiant (ID) @SESSION_ID@.
@ -93,7 +93,7 @@ Le processus maître de la session est @LEADER@.
Subject: La session @SESSION_ID@ s'est terminée
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
La session d'identifiant (ID) @SESSION_ID@ s'est terminée.
@ -101,7 +101,7 @@ La session d'identifiant (ID) @SESSION_ID@ s'est terminée.
Subject: Un nouveau poste (seat) @SEAT_ID@ est disponible
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Un nouveau poste (seat) @SEAT_ID@ a été configuré et est maintenant
disponible.
@ -110,7 +110,7 @@ disponible.
Subject: Le poste (seat) @SEAT_ID@ a été retiré
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Le poste (seat) @SEAT_ID@ a été retiré et n'est plus disponible.

View File

@ -78,7 +78,7 @@ trebalo bi se prijaviti razvijatelju kao greška.
Subject: Nova sesija @SESSION_ID@ je stvorena za korisnika @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Nova sesija sa ID @SESSION_ID@ je stvorena za korisnika @USER_ID@.
@ -88,7 +88,7 @@ Glavni proces sesije je @LEADER@.
Subject: Sesija @SESSION_ID@ je prekinuta
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Sesija sa ID @SESSION_ID@ je prekinuta.
@ -96,7 +96,7 @@ Sesija sa ID @SESSION_ID@ je prekinuta.
Subject: Novo sjedište @SEAT_ID@ je sada dostupno
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Novo sjedište @SEAT_ID@ je podešeno i sada je dostupno.
@ -104,7 +104,7 @@ Novo sjedište @SEAT_ID@ je podešeno i sada je dostupno.
Subject: Sjedište @SEAT_ID@ je sada uklonjeno
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Sjedište @SEAT_ID@ je uklonjeno i više nije dostupno.

View File

@ -64,7 +64,7 @@ a szállítója felé kell bejelenteni.
Subject: Új munkamenet (@SESSION_ID@) létrehozva, felhasználója: @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Létrejött egy új munkamenet @SESSION_ID@ azonosítóval ezen felhasználóhoz:
@USER_ID@.
@ -75,7 +75,7 @@ A munkamenet vezető folyamata: @LEADER@.
Subject: Munkamenet (@SESSION_ID@) befejezve
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
A következő azonosítójú munkamenet befejeződött: @SESSION_ID@.
@ -83,7 +83,7 @@ A következő azonosítójú munkamenet befejeződött: @SESSION_ID@.
Subject: Elérhető egy új munkaállomás: @SEAT_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Beállításra kerül és használható egy új munkaállomás: @SEAT_ID@.
@ -91,7 +91,7 @@ Beállításra kerül és használható egy új munkaállomás: @SEAT_ID@.
Subject: A munkaállomás eltávolítva: @SEAT_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
A munkaállomás el lett távolítva, és már nem érhető el: @SEAT_ID@

View File

@ -97,7 +97,7 @@ segnalare la troncatura.
Subject: La nuova sessione @SESSION_ID@ è stata creata per l'utente @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Una nuova sessione con ID @SESSION_ID@ è stata creata per l'utente @USER_ID@.
@ -108,7 +108,7 @@ Il processo primario della sessione è @LEADER@.
Subject: La sessione @SESSION_ID@ è terminata
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
La sessione con ID @SESSION_ID@ è terminata.
@ -117,7 +117,7 @@ La sessione con ID @SESSION_ID@ è terminata.
Subject: La nuova postazione @SEAT_ID@ è ora disponibile
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
La nuova postazione @SEAT_ID@ è stata configurata ed è ora disponibile.
@ -126,7 +126,7 @@ La nuova postazione @SEAT_ID@ è stata configurata ed è ora disponibile.
Subject: La postazione @SEAT_ID@ è stata rimossa
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
La postazione @SEAT_ID@ è stata rimossa e non è più disponibile.

View File

@ -86,7 +86,7 @@ Documentation: man:core(5)
Subject: @USER_ID@ 사용자의 새 @SESSION_ID@ 세션 만듦
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
@USER_ID@ 사용자의 새 @SESSION_ID@ 세션을 만들었습니다.
@ -96,7 +96,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: @SESSION_ID@ 세션 마침
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
@SESSION_ID@ 세션을 끝냈습니다.
@ -104,7 +104,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: 새 @SEAT_ID@ 시트 사용할 수 있음
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
새 @SEAT_ID@ 시트를 설정했고 사용할 수 있습니다.
@ -112,7 +112,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: @SEAT_ID@ 시트 제거함
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
@SEAT_ID@ 시트를 제거했으며 더이상 사용할 수 없습니다.

View File

@ -92,7 +92,7 @@ gdb(1) będą ostrzegały o skróceniu pliku.
Subject: Utworzono nową sesję @SESSION_ID@ dla użytkownika @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Nowa sesja o identyfikatorze @SESSION_ID@ została utworzona dla użytkownika
@USER_ID@.
@ -103,7 +103,7 @@ Proces prowadzący sesji: @LEADER@.
Subject: Zakończono sesję @SESSION_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Sesja o identyfikatorze @SESSION_ID@ została zakończona.
@ -111,7 +111,7 @@ Sesja o identyfikatorze @SESSION_ID@ została zakończona.
Subject: Dostępne jest nowe stanowisko @SEAT_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Nowe stanowisko @SEAT_ID@ zostało skonfigurowane i jest teraz dostępne.
@ -119,7 +119,7 @@ Nowe stanowisko @SEAT_ID@ zostało skonfigurowane i jest teraz dostępne.
Subject: Usunięto stanowisko @SEAT_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Stanowisko @SEAT_ID@ zostało usunięte i nie jest już dostępne.

View File

@ -65,7 +65,7 @@ deveria ser relatado para seu fabricante como um erro.
Subject: A nova sessão @SESSION_ID@ foi criada para usuário o @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Uma nova sessão com o ID @SESSION_ID@ foi criada para o usuário @USER_ID@.
@ -75,7 +75,7 @@ O processo originador da sessão é @LEADER@.
Subject: Sessão @SESSION_ID@ foi terminada
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Um sessão com o ID @SESSION_ID@ foi terminada.
@ -83,7 +83,7 @@ Um sessão com o ID @SESSION_ID@ foi terminada.
Subject: Um novo seat @SEAT_ID@ está disponível
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Um novo seat @SEAT_ID@ foi configurado e está disponível.
@ -91,7 +91,7 @@ Um novo seat @SEAT_ID@ foi configurado e está disponível.
Subject: Seat @SEAT_ID@ foi removido agora
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Um seat @SEAT_ID@ foi removido e não está mais disponível.

View File

@ -105,7 +105,7 @@ Documentation: man:coredump.conf(5)
Subject: Для пользователя @USER_ID@ создан новый сеанс @SESSION_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Для пользователя @USER_ID@ создан новый сеанс с идентификатором @SESSION_ID@.
@ -116,7 +116,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Сеанс @SESSION_ID@ завершен
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Сеанс с идентификатором @SESSION_ID@ завершился.
@ -125,7 +125,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Добавлено новое рабочее место @SEAT_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Новое рабочее место (seat) @SEAT_ID@ полностью настроено и готово к
использованию.
@ -135,7 +135,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Рабочее место @SEAT_ID@ отключено
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Рабочее место (seat) @SEAT_ID@ было отключено.

View File

@ -63,7 +63,7 @@ Documentation: man:core(5)
Subject: Нова сесија @SESSION_ID@ је направљена за корисника @USER_ID@
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Нова сесија са ИБ-ом @SESSION_ID@ је направљена за корисника @USER_ID@.
@ -73,7 +73,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Сесија @SESSION_ID@ је окончана
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Сесија са ИБ-ом @SESSION_ID@ је окончана.
@ -81,7 +81,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Ново седиште @SEAT_ID@ је сада доступно
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Ново седиште @SEAT_ID@ је исподешавано и сада је доступно.
@ -89,7 +89,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: Седиште @SEAT_ID@ је сада уклоњено
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Седиште @SEAT_ID@ је сада уклоњено и више није доступно.

View File

@ -62,7 +62,7 @@ Documentation: man:core(5)
Subject: 一个新会话 @SESSION_ID@ 已为用户 @USER_ID@ 建立
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
一个 ID 为 @SESSION_ID@ 的新会话已为用户 @USER_ID@ 建立。
@ -72,7 +72,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: 会话 @SESSION_ID@ 已终止
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
一个 ID 为 @SESSION_ID@ 的会话已终止。
@ -80,7 +80,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: 一个新的座位 @SEAT_ID@ 可用
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
一个新的座位 @SEAT_ID@ 已被配置并已可用。
@ -88,7 +88,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: 座位 @SEAT_ID@ 已被移除
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
座位 @SEAT_ID@ 已被移除并不再可用。

View File

@ -65,7 +65,7 @@ Documentation: man:core(5)
Subject: 新的工作階段 @SESSION_ID@ 已為使用者 @USER_ID@ 建立
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
一個新的工作階段ID @SESSION_ID@ 已為使用者 @USER_ID@ 建立。
@ -75,7 +75,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: 工作階段 @SESSION_ID@ 已結束
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
一個工作階段ID @SESSION_ID@ 已結束。
@ -83,7 +83,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: 新的座位 @SEAT_ID@ 可用
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
一個新的座位 @SEAT_ID@ 已被設定且現在可用。
@ -91,7 +91,7 @@ Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Subject: 座位 @SEAT_ID@ 已被移除
Defined-By: systemd
Support: %SUPPORT_URL%
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
座位 @SEAT_ID@ 已被移除且不再可用。

View File

@ -102,7 +102,7 @@ And now, here's the list of (hopefully) all APIs that we have introduced with sy
| [Journal Export Format](https://www.freedesktop.org/wiki/Software/systemd/export) | File format | yes | yes | - | yes | - | no |
| [Cooperation in cgroup tree](https://www.freedesktop.org/wiki/Software/systemd/PaxControlGroups) | Treaty | yes | yes | libvirt | yes | libvirt | no |
| [Password Agents](https://systemd.io/PASSWORD_AGENTS/) | Socket+Files | yes | yes | - | yes | - | no |
| [udev multi-seat properties](https://www.freedesktop.org/wiki/Software/systemd/multiseat) | udev Property | yes | yes | X11, gdm | no | - | no |
| [udev multi-seat properties](https://www.freedesktop.org/software/systemd/man/sd-login.html) | udev Property | yes | yes | X11, gdm | no | - | no |
| udev session switch ACL properties | udev Property | no | no | - | no | - | no |
| [CLI of systemctl,...](https://www.freedesktop.org/software/systemd/man/systemctl.html) | CLI | yes | yes | numerous | no | - | no |
| [tmpfiles.d](https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html) | File format | yes | yes | numerous | yes | ArchLinux | partially |

View File

@ -82,10 +82,11 @@
<para>For operating system images which are created once and used on multiple
machines, for example for containers or in the cloud,
<filename>/etc/machine-id</filename> should be an empty file in the generic file
system image. An ID will be generated during boot and saved to this file if
possible. Having an empty file in place is useful because it allows a temporary file
to be bind-mounted over the real file, in case the image is used read-only.</para>
<filename>/etc/machine-id</filename> should be either missing or an empty file in the generic file
system image (the difference between the two options is described under "First Boot Semantics" below). An
ID will be generated during boot and saved to this file if possible. Having an empty file in place is
useful because it allows a temporary file to be bind-mounted over the real file, in case the image is
used read-only.</para>
<para><citerefentry><refentrytitle>systemd-firstboot</refentrytitle><manvolnum>1</manvolnum></citerefentry>
may be used to initialize <filename>/etc/machine-id</filename> on mounted (but not
@ -115,6 +116,34 @@
early boot but become writable later on.</para>
</refsect1>
<refsect1>
<title>First Boot Semantics</title>
<para><filename>/etc/machine-id</filename> is used to decide whether a boot is the first one. The rules
are as follows:</para>
<orderedlist>
<listitem><para>If <filename>/etc/machine-id</filename> does not exist, this is a first boot. During
early boot, <command>systemd</command> will write <literal>unitialized\n</literal> to this file and overmount
a temporary file which contains the actual machine ID. Later (after <filename>first-boot-complete.target</filename>
has been reached), the real machine ID will be written to disk.</para></listitem>
<listitem><para>If <filename>/etc/machine-id</filename> contains the string <literal>uninitialized</literal>,
a boot is also considered the first boot. The same mechanism as above applies.</para></listitem>
<listitem><para>If <filename>/etc/machine-id</filename> exists and is empty, a boot is
<emphasis>not</emphasis> considered the first boot. <command>systemd</command> will still bind-mount a file
containing the actual machine-id over it and later try to commit it to disk (if <filename>/etc/</filename> is
writable).</para></listitem>
<listitem><para>If <filename>/etc/machine-id</filename> already contains a valid machine-id, this is
not a first boot.</para></listitem>
</orderedlist>
<para>If by any of the above rules, a first boot is detected, units with <varname>ConditionFirstBoot=yes</varname>
will be run.</para>
</refsect1>
<refsect1>
<title>Relation to OSF UUIDs</title>

View File

@ -509,8 +509,7 @@ node /org/freedesktop/login1 {
and a boolean for controlling polkit interactivity (see below). Device assignments are persistently
stored on disk. To create a new seat, simply specify a previously unused seat id. For more information
about the seat assignment logic see
<ulink url="https://www.freedesktop.org/wiki/Software/systemd/multiseat">Multi-Seat for Linux</ulink>.
</para>
<citerefentry><refentrytitle>sd-login</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
<para><function>FlushDevices()</function> removes all explicit seat assignments for devices, resetting
all assignments to the automatic defaults. The only argument it takes is the polkit interactivity

View File

@ -241,8 +241,7 @@
<para>
<ulink url="https://www.freedesktop.org/wiki/Software/systemd/multiseat">Multi-Seat on Linux</ulink>
for an introduction to multi-seat support on Linux and the background for this set of APIs.
may also be of historical interest.
</para>
</refsect1>
</refentry>

View File

@ -192,6 +192,9 @@
<para>SR-IOV virtual devices are named based on the name of the parent interface, with a suffix of
<constant>v</constant> and the virtual device number, with any leading zeros removed. The bus
number is ignored.</para>
<para>In some configurations a parent PCI bridge of a given network controller may be associated
with a slot. In such case we don't generate this device property to avoid possible naming conflicts.</para>
</listitem>
</varlistentry>
@ -354,6 +357,17 @@
multiple similarly named containers (who only differ in container name suffix) should be less
likely (but still possible, since the 24bit hash value is very small).</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>v246</constant></term>
<listitem><para>If the PCI slot is assocated with PCI bridge and that has multiple child network
controllers then all of them might derive the same value of <varname>ID_NET_NAME_SLOT</varname>
property. That could cause naming conflict if the property is selected as a device name. Now, we detect the
situation, slot - bridge relation, and we don't produce the <varname>ID_NET_NAME_SLOT</varname> property to
avoid possible naming conflict.</para></listitem>
</varlistentry>
</variablelist>
<para>Note that <constant>latest</constant> may be used to denote the latest scheme known (to this

View File

@ -32,6 +32,7 @@
<filename>emergency.target</filename>,
<filename>exit.target</filename>,
<filename>final.target</filename>,
<filename>first-boot-complete.target</filename>,
<filename>getty.target</filename>,
<filename>getty-pre.target</filename>,
<filename>graphical.target</filename>,
@ -878,6 +879,17 @@
stopped.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>first-boot-complete.target</filename></term>
<listitem>
<para>This passive target is intended as a synchronization point for units that need to run once
during the first boot. Only after all units ordered before this target have finished, will the
<citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>
be committed to disk, marking the first boot as completed. If the boot is aborted at any time
before that, the next boot will re-run any units with <varname>ConditionFirstBoot=yes</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><filename>getty-pre.target</filename></term>
<listitem>

View File

@ -1315,10 +1315,16 @@
<term><varname>ConditionFirstBoot=</varname></term>
<listitem><para>Takes a boolean argument. This condition may be used to conditionalize units on
whether the system is booting up with an unpopulated <filename>/etc/</filename> directory
(specifically: an <filename>/etc/</filename> with no <filename>/etc/machine-id</filename>). This may
be used to populate <filename>/etc/</filename> on the first boot after factory reset, or when a new
system instance boots up for the first time.</para>
whether the system is booting up for the first time. This roughly means that <filename>/etc/</filename>
is unpopulated (for details, see "First Boot Semantics" in
<citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
This may be used to populate <filename>/etc/</filename> on the first boot after factory reset, or
when a new system instance boots up for the first time.</para>
<para>For robustness, units with <varname>ConditionFirstBoot=yes</varname> should order themselves
before <filename>first-boot-complete.target</filename> and pull in this passive target with
<varname>Wants=</varname>. This ensures that in a case of an aborted first boot, these units will
be re-run during the next system startup.</para>
<para>If the <varname>systemd.condition-first-boot=</varname> option is specified on the kernel
command line (taking a boolean), it will override the result of this condition check, taking

View File

@ -86,7 +86,7 @@ msgstr "Der kræves godkendelse for at fjerne en brugers hjemmeområde."
msgid "Check credentials of a home area"
msgstr "Tjek loginoplysninger for et hjemmeområde"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/home/org.freedesktop.home1.policy:34
msgid ""
"Authentication is required to check credentials against a user's home area."
@ -98,7 +98,7 @@ msgstr ""
msgid "Update a home area"
msgstr "Opdater et hjemmeområde"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/home/org.freedesktop.home1.policy:44
msgid "Authentication is required to update a user's home area."
msgstr "Der kræves godkendelse for at opdatere en brugers hjemmeområde."
@ -116,7 +116,7 @@ msgstr ""
msgid "Change password of a home area"
msgstr "Skift adgangskode for et hjemmeområde"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/home/org.freedesktop.home1.policy:64
msgid ""
"Authentication is required to change the password of a user's home area."
@ -315,22 +315,22 @@ msgstr ""
"Der kræves godkendelse for at brugere, som ikke er logget ind, kan køre "
"programmer."
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:137
msgid "Allow attaching devices to seats"
msgstr "Tillad at montere af enheder til arbejdsstationer"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:138
msgid "Authentication is required to attach a device to a seat."
msgstr "Der kræves godkendelse for at montere en enhed til en arbejdsstation."
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:148
msgid "Flush device to seat attachments"
msgstr "Nulstil enhed monteret til en arbejdsstation"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:149
msgid "Authentication is required to reset how devices are attached to seats."
msgstr ""
@ -502,7 +502,7 @@ msgstr ""
msgid "Manage active sessions, users and seats"
msgstr "Håndter aktive sessioner, brugere og arbejdsstationer"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:322
msgid "Authentication is required to manage active sessions, users and seats."
msgstr ""
@ -802,7 +802,7 @@ msgstr ""
msgid "Attach or detach a portable service image"
msgstr "Tilslut eller frakobl et transportabel tjeneste-aftryk"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/portable/org.freedesktop.portable1.policy:24
msgid ""
"Authentication is required to attach or detach a portable service image."

View File

@ -94,7 +94,7 @@ msgstr "Legitimierung ist zum erneuten Laden des systemd-Zustands notwendig."
msgid "Check credentials of a home area"
msgstr ""
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/home/org.freedesktop.home1.policy:34
#, fuzzy
#| msgid ""
@ -109,7 +109,7 @@ msgstr ""
msgid "Update a home area"
msgstr ""
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/home/org.freedesktop.home1.policy:44
#, fuzzy
#| msgid "Authentication is required to attach a device to a seat."
@ -132,7 +132,7 @@ msgstr "Legitimierung ist zum Einstellen einer Nachricht an alle notwendig"
msgid "Change password of a home area"
msgstr ""
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/home/org.freedesktop.home1.policy:64
#, fuzzy
#| msgid ""
@ -364,24 +364,24 @@ msgstr ""
"Legitimierung ist erforderlich, damit nicht angemeldete Benutzer Programme "
"ausführen dürfen."
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:137
msgid "Allow attaching devices to seats"
msgstr "Das Anschließen von Geräten an Arbeitsstationen erlauben"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:138
msgid "Authentication is required to attach a device to a seat."
msgstr ""
"Legitimierung ist zum Anschließen eines Geräts an eine Arbeitsstation "
"notwendig."
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:148
msgid "Flush device to seat attachments"
msgstr "Zurücksetzen der an eine Arbeitsstation angeschlossenen Geräte"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:149
msgid "Authentication is required to reset how devices are attached to seats."
msgstr ""
@ -584,7 +584,7 @@ msgstr ""
msgid "Manage active sessions, users and seats"
msgstr "Aktive Sitzungen, Benutzer und Arbeitsstationen verwalten"
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/login/org.freedesktop.login1.policy:322
msgid "Authentication is required to manage active sessions, users and seats."
msgstr ""
@ -941,7 +941,7 @@ msgstr ""
msgid "Attach or detach a portable service image"
msgstr ""
# www.freedesktop.org/wiki/Software/systemd/multiseat/
# https://www.freedesktop.org/software/systemd/man/sd-login.html
#: src/portable/org.freedesktop.portable1.policy:24
#, fuzzy
#| msgid "Authentication is required to attach a device to a seat."

View File

@ -37,6 +37,7 @@ disable systemd-networkd-wait-online.service
disable systemd-time-wait-sync.service
disable systemd-boot-check-no-failures.service
disable systemd-network-generator.service
disable proc-sys-fs-binfmt_misc.mount
disable syslog.socket

View File

@ -11,6 +11,7 @@
#include "fd-util.h"
#include "fs-util.h"
#include "id128-util.h"
#include "io-util.h"
#include "log.h"
#include "machine-id-setup.h"
#include "macro.h"
@ -86,7 +87,7 @@ static int generate_machine_id(const char *root, sd_id128_t *ret) {
return 0;
}
int machine_id_setup(const char *root, sd_id128_t machine_id, sd_id128_t *ret) {
int machine_id_setup(const char *root, bool force_transient, sd_id128_t machine_id, sd_id128_t *ret) {
const char *etc_machine_id, *run_machine_id;
_cleanup_close_ int fd = -1;
bool writable;
@ -143,13 +144,31 @@ int machine_id_setup(const char *root, sd_id128_t machine_id, sd_id128_t *ret) {
if (ftruncate(fd, 0) < 0)
return log_error_errno(errno, "Failed to truncate %s: %m", etc_machine_id);
if (id128_write_fd(fd, ID128_PLAIN, machine_id, true) >= 0)
/* If the caller requested a transient machine-id, write the string "uninitialized\n" to
* disk and overmount it with a transient file.
*
* Otherwise write the machine-id directly to disk. */
if (force_transient) {
r = loop_write(fd, "uninitialized\n", strlen("uninitialized\n"), false);
if (r < 0)
return log_error_errno(r, "Failed to write uninitialized %s: %m", etc_machine_id);
r = fsync_full(fd);
if (r < 0)
return log_error_errno(r, "Failed to sync %s: %m", etc_machine_id);
} else {
r = id128_write_fd(fd, ID128_PLAIN, machine_id, true);
if (r < 0)
return log_error_errno(r, "Failed to write %s: %m", etc_machine_id);
else
goto finish;
}
}
fd = safe_close(fd);
/* Hmm, we couldn't write it? So let's write it to /run/machine-id as a replacement */
/* Hmm, we couldn't or shouldn't write the machine-id to /etc?
* So let's write it to /run/machine-id as a replacement */
run_machine_id = prefix_roota(root, "/run/machine-id");
@ -167,7 +186,7 @@ int machine_id_setup(const char *root, sd_id128_t machine_id, sd_id128_t *ret) {
return r;
}
log_info("Installed transient %s file.", etc_machine_id);
log_full(force_transient ? LOG_DEBUG : LOG_INFO, "Installed transient %s file.", etc_machine_id);
/* Mark the mount read-only */
r = mount_follow_verbose(LOG_WARNING, NULL, etc_machine_id, NULL, MS_BIND|MS_RDONLY|MS_REMOUNT, NULL);
@ -183,10 +202,22 @@ finish:
int machine_id_commit(const char *root) {
_cleanup_close_ int fd = -1, initial_mntns_fd = -1;
const char *etc_machine_id;
const char *etc_machine_id, *sync_path;
sd_id128_t id;
int r;
/* Before doing anything, sync everything to ensure any changes by first-boot units are persisted.
*
* First, explicitly sync the file systems we care about and check if it worked. */
FOREACH_STRING(sync_path, "/etc/", "/var/") {
r = syncfs_path(AT_FDCWD, sync_path);
if (r < 0)
return log_error_errno(r, "Cannot sync %s: %m", sync_path);
}
/* Afterwards, sync() the rest too, but we can't check the return value for these. */
sync();
/* Replaces a tmpfs bind mount of /etc/machine-id by a proper file, atomically. For this, the umount is removed
* in a mount namespace, a new file is created at the right place. Afterwards the mount is also removed in the
* original mount namespace, thus revealing the file that was just created. */

View File

@ -1,5 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <stdbool.h>
int machine_id_commit(const char *root);
int machine_id_setup(const char *root, sd_id128_t requested, sd_id128_t *ret);
int machine_id_setup(const char *root, bool force_transient, sd_id128_t requested, sd_id128_t *ret);

View File

@ -2001,15 +2001,26 @@ static void log_execution_mode(bool *ret_first_boot) {
*ret_first_boot = false;
log_info("Running in initial RAM disk.");
} else {
/* Let's check whether we are in first boot, i.e. whether /etc is still unpopulated. We use
* /etc/machine-id as flag file, for this: if it exists we assume /etc is populated, if it
* doesn't it's unpopulated. This allows container managers and installers to provision a
* couple of files already. If the container manager wants to provision the machine ID itself
* it should pass $container_uuid to PID 1. */
int r;
_cleanup_free_ char *id_text = NULL;
*ret_first_boot = access("/etc/machine-id", F_OK) < 0;
if (*ret_first_boot)
log_info("Running with unpopulated /etc.");
/* Let's check whether we are in first boot. We use /etc/machine-id as flag file
* for this: If it is missing or contains the value "uninitialized", this is the
* first boot. In any other case, it is not. This allows container managers and
* installers to provision a couple of files already. If the container manager
* wants to provision the machine ID itself it should pass $container_uuid to PID 1. */
r = read_one_line_file("/etc/machine-id", &id_text);
if (r < 0 || streq(id_text, "uninitialized")) {
if (r < 0 && r != -ENOENT)
log_warning_errno(r, "Unexpected error while reading /etc/machine-id, ignoring: %m");
*ret_first_boot = true;
log_info("Detected first boot.");
} else {
*ret_first_boot = false;
log_debug("Detected initialized system, this is not the first boot.");
}
}
} else {
if (DEBUG_LOGGING) {
@ -2026,6 +2037,7 @@ static void log_execution_mode(bool *ret_first_boot) {
static int initialize_runtime(
bool skip_setup,
bool first_boot,
struct rlimit *saved_rlimit_nofile,
struct rlimit *saved_rlimit_memlock,
const char **ret_error_message) {
@ -2059,7 +2071,8 @@ static int initialize_runtime(
status_welcome();
hostname_setup();
machine_id_setup(NULL, arg_machine_id, NULL);
/* Force transient machine-id on first boot. */
machine_id_setup(NULL, first_boot, arg_machine_id, NULL);
(void) loopback_setup();
bump_unix_max_dgram_qlen();
bump_file_max_and_nr_open();
@ -2787,6 +2800,7 @@ int main(int argc, char *argv[]) {
log_execution_mode(&first_boot);
r = initialize_runtime(skip_setup,
first_boot,
&saved_rlimit_nofile,
&saved_rlimit_memlock,
&error_message);

View File

@ -3798,7 +3798,6 @@ _public_ int sd_event_loop(sd_event *e) {
}
_public_ int sd_event_get_fd(sd_event *e) {
assert_return(e, -EINVAL);
assert_return(e = event_resolve(e), -ENOPKG);
assert_return(!event_pid_changed(e), -ECHILD);

View File

@ -10,6 +10,7 @@
#include "id128-util.h"
#include "io-util.h"
#include "stdio-util.h"
#include "string-util.h"
char *id128_to_uuid_string(sd_id128_t id, char s[static ID128_UUID_STRING_MAX]) {
unsigned n, k = 0;
@ -97,6 +98,11 @@ int id128_read_fd(int fd, Id128Format f, sd_id128_t *ret) {
switch (l) {
case 13:
case 14:
/* Treat an "uninitialized" id file like an empty one */
return f == ID128_PLAIN_OR_UNINIT && strneq(buffer, "uninitialized\n", l) ? -ENOMEDIUM : -EINVAL;
case 33: /* plain UUID with trailing newline */
if (buffer[32] != '\n')
return -EINVAL;
@ -115,7 +121,7 @@ int id128_read_fd(int fd, Id128Format f, sd_id128_t *ret) {
_fallthrough_;
case 36: /* RFC UUID without trailing newline */
if (f == ID128_PLAIN)
if (IN_SET(f, ID128_PLAIN, ID128_PLAIN_OR_UNINIT))
return -EINVAL;
buffer[36] = 0;

View File

@ -17,6 +17,10 @@ bool id128_is_valid(const char *s) _pure_;
typedef enum Id128Format {
ID128_ANY,
ID128_PLAIN, /* formatted as 32 hex chars as-is */
ID128_PLAIN_OR_UNINIT, /* formatted as 32 hex chars as-is; allow special "uninitialized"
* value when reading from file (id128_read() and id128_read_fd()).
*
* This format should be used when reading a machine-id file. */
ID128_UUID, /* formatted as 36 character uuid string */
_ID128_FORMAT_MAX,
} Id128Format;

View File

@ -1089,8 +1089,8 @@ int session_create_fifo(Session *s) {
if (r < 0)
return r;
/* Let's make sure we noticed dead sessions before we process new bus requests (which might create new
* sessions). */
/* Let's make sure we noticed dead sessions before we process new bus requests (which might
* create new sessions). */
r = sd_event_source_set_priority(s->fifo_event_source, SD_EVENT_PRIORITY_NORMAL-10);
if (r < 0)
return r;
@ -1331,9 +1331,8 @@ static void session_release_controller(Session *s, bool notify) {
name = s->controller;
/* By resetting the controller before releasing the devices, we won't
* send notification signals. This avoids sending useless notifications
* if the controller is released on disconnects. */
/* By resetting the controller before releasing the devices, we won't send notification signals.
* This avoids sending useless notifications if the controller is released on disconnects. */
if (!notify)
s->controller = NULL;
@ -1421,7 +1420,7 @@ static const char* const session_state_table[_SESSION_STATE_MAX] = {
[SESSION_OPENING] = "opening",
[SESSION_ONLINE] = "online",
[SESSION_ACTIVE] = "active",
[SESSION_CLOSING] = "closing"
[SESSION_CLOSING] = "closing",
};
DEFINE_STRING_TABLE_LOOKUP(session_state, SessionState);
@ -1441,14 +1440,14 @@ static const char* const session_class_table[_SESSION_CLASS_MAX] = {
[SESSION_USER] = "user",
[SESSION_GREETER] = "greeter",
[SESSION_LOCK_SCREEN] = "lock-screen",
[SESSION_BACKGROUND] = "background"
[SESSION_BACKGROUND] = "background",
};
DEFINE_STRING_TABLE_LOOKUP(session_class, SessionClass);
static const char* const kill_who_table[_KILL_WHO_MAX] = {
[KILL_LEADER] = "leader",
[KILL_ALL] = "all"
[KILL_ALL] = "all",
};
DEFINE_STRING_TABLE_LOOKUP(kill_who, KillWho);

View File

@ -14,6 +14,7 @@
#include "bus-log-control-api.h"
#include "bus-polkit.h"
#include "cgroup-util.h"
#include "daemon-util.h"
#include "def.h"
#include "device-util.h"
#include "dirent-util.h"
@ -921,14 +922,13 @@ static void manager_gc(Manager *m, bool drop_not_started) {
LIST_REMOVE(gc_queue, m->session_gc_queue, session);
session->in_gc_queue = false;
/* First, if we are not closing yet, initiate stopping */
/* First, if we are not closing yet, initiate stopping. */
if (session_may_gc(session, drop_not_started) &&
session_get_state(session) != SESSION_CLOSING)
(void) session_stop(session, /* force = */ false);
/* Normally, this should make the session referenced
* again, if it doesn't then let's get rid of it
* immediately */
/* Normally, this should make the session referenced again, if it doesn't then let's get rid
* of it immediately. */
if (session_may_gc(session, drop_not_started)) {
(void) session_finalize(session);
session_free(session);
@ -1156,6 +1156,7 @@ static int manager_run(Manager *m) {
static int run(int argc, char *argv[]) {
_cleanup_(manager_unrefp) Manager *m = NULL;
_cleanup_(notify_on_cleanup) const char *notify_message = NULL;
int r;
log_set_facility(LOG_AUTH);
@ -1175,9 +1176,9 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return r;
/* Always create the directories people can create inotify watches in. Note that some applications might check
* for the existence of /run/systemd/seats/ to determine whether logind is available, so please always make
* sure these directories are created early on and unconditionally. */
/* Always create the directories people can create inotify watches in. Note that some applications
* might check for the existence of /run/systemd/seats/ to determine whether logind is available, so
* please always make sure these directories are created early on and unconditionally. */
(void) mkdir_label("/run/systemd/seats", 0755);
(void) mkdir_label("/run/systemd/users", 0755);
(void) mkdir_label("/run/systemd/sessions", 0755);
@ -1194,19 +1195,8 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return log_error_errno(r, "Failed to fully start up daemon: %m");
log_debug("systemd-logind running as pid "PID_FMT, getpid_cached());
(void) sd_notify(false,
"READY=1\n"
"STATUS=Processing requests...");
r = manager_run(m);
log_debug("systemd-logind stopped as pid "PID_FMT, getpid_cached());
(void) sd_notify(false,
"STOPPING=1\n"
"STATUS=Shutting down...");
return r;
notify_message = notify_start(NOTIFY_READY, NOTIFY_STOPPING);
return manager_run(m);
}
DEFINE_MAIN_FUNCTION(run);

View File

@ -128,7 +128,7 @@ static int run(int argc, char *argv[]) {
if (r < 0)
return log_error_errno(r, "Failed to read machine ID back: %m");
} else {
r = machine_id_setup(arg_root, SD_ID128_NULL, &id);
r = machine_id_setup(arg_root, false, SD_ID128_NULL, &id);
if (r < 0)
return r;
}

View File

@ -2726,7 +2726,7 @@ static int setup_machine_id(const char *directory) {
etc_machine_id = prefix_roota(directory, "/etc/machine-id");
r = id128_read(etc_machine_id, ID128_PLAIN, &id);
r = id128_read(etc_machine_id, ID128_PLAIN_OR_UNINIT, &id);
if (r < 0) {
if (!IN_SET(r, -ENOENT, -ENOMEDIUM)) /* If the file is missing or empty, we don't mind */
return log_error_errno(r, "Failed to read machine ID from container image: %m");

View File

@ -3245,7 +3245,7 @@ static int context_read_seed(Context *context, const char *root) {
else if (fd < 0)
return log_error_errno(fd, "Failed to determine machine ID of image: %m");
else {
r = id128_read_fd(fd, ID128_PLAIN, &context->seed);
r = id128_read_fd(fd, ID128_PLAIN_OR_UNINIT, &context->seed);
if (r == -ENOMEDIUM)
log_info("No machine ID set, using randomized partition UUIDs.");
else if (r < 0)

View File

@ -17,6 +17,6 @@ static inline const char *notify_start(const char *start, const char *stop) {
/* This is intended to be used with _cleanup_ attribute. */
static inline void notify_on_cleanup(const char **p) {
if (p)
if (*p)
(void) sd_notify(false, *p);
}

View File

@ -2148,6 +2148,8 @@ int dissected_image_acquire_metadata(DissectedImage *m) {
log_debug_errno(r, "Image contains invalid /etc/machine-id: %s", line);
} else if (r == 0)
log_debug("/etc/machine-id file is empty.");
else if (streq(line, "uninitialized"))
log_debug("/etc/machine-id file is uninitialized (likely aborted first boot).");
else
log_debug("/etc/machine-id has unexpected length %i.", r);

View File

@ -12,6 +12,7 @@ static const NamingScheme naming_schemes[] = {
{ "v241", NAMING_V241 },
{ "v243", NAMING_V243 },
{ "v245", NAMING_V245 },
{ "v246", NAMING_V246 },
/* … add more schemes here, as the logic to name devices is updated … */
};

View File

@ -31,6 +31,7 @@ typedef enum NamingSchemeFlags {
NAMING_NETDEVSIM = 1 << 6, /* Generate names for netdevsim devices, see eaa9d507d855 */
NAMING_LABEL_NOPREFIX = 1 << 7, /* Don't prepend ID_NET_LABEL_ONBOARD with interface type prefix */
NAMING_NSPAWN_LONG_HASH = 1 << 8, /* Shorten nspawn interfaces by including 24bit hash, instead of simple truncation */
NAMING_BRIDGE_NO_SLOT = 1 << 9, /* Don't use PCI hotplug slot information if the corresponding device is a PCI bridge */
/* And now the masks that combine the features above */
NAMING_V238 = 0,
@ -39,6 +40,7 @@ typedef enum NamingSchemeFlags {
NAMING_V241 = NAMING_V240 | NAMING_STABLE_VIRTUAL_MACS,
NAMING_V243 = NAMING_V241 | NAMING_NETDEVSIM | NAMING_LABEL_NOPREFIX,
NAMING_V245 = NAMING_V243 | NAMING_NSPAWN_LONG_HASH,
NAMING_V246 = NAMING_V245 | NAMING_BRIDGE_NO_SLOT,
_NAMING_SCHEME_FLAGS_INVALID = -1,
} NamingSchemeFlags;

View File

@ -243,9 +243,29 @@ static bool is_pci_ari_enabled(sd_device *dev) {
return streq(a, "1");
}
static bool is_pci_bridge(sd_device *dev) {
const char *v, *p;
if (sd_device_get_sysattr_value(dev, "modalias", &v) < 0)
return false;
if (!startswith(v, "pci:"))
return false;
p = strrchr(v, 's');
if (!p)
return false;
if (p[1] != 'c')
return false;
/* PCI device subclass 04 corresponds to PCI bridge */
return strneq(p + 2, "04", 2);
}
static int dev_pci_slot(sd_device *dev, struct netnames *names) {
unsigned long dev_port = 0;
unsigned domain, bus, slot, func, hotplug_slot = 0;
unsigned domain, bus, slot, func;
int hotplug_slot = -1;
size_t l;
char *s;
const char *sysname, *attr, *port_name = NULL, *syspath;
@ -326,14 +346,14 @@ static int dev_pci_slot(sd_device *dev, struct netnames *names) {
continue;
FOREACH_DIRENT_ALL(dent, dir, break) {
unsigned i;
int i;
char str[PATH_MAX];
_cleanup_free_ char *address = NULL;
if (dot_or_dot_dot(dent->d_name))
continue;
r = safe_atou_full(dent->d_name, 10, &i);
r = safe_atoi(dent->d_name, &i);
if (r < 0 || i <= 0)
continue;
@ -342,10 +362,18 @@ static int dev_pci_slot(sd_device *dev, struct netnames *names) {
read_one_line_file(str, &address) >= 0 &&
startswith(sysname, address)) {
hotplug_slot = i;
/* We found the match between PCI device and slot. However, we won't use the
* slot index if the device is a PCI bridge, because it can have other child
* devices that will try to claim the same index and that would create name
* collision. */
if (naming_scheme_has(NAMING_BRIDGE_NO_SLOT) && is_pci_bridge(hotplug_slot_dev))
hotplug_slot = 0;
break;
}
}
if (hotplug_slot > 0)
if (hotplug_slot >= 0)
break;
if (sd_device_get_parent_with_subsystem_devtype(hotplug_slot_dev, "pci", NULL, &hotplug_slot_dev) < 0)
break;

View File

@ -31,8 +31,8 @@ static int apply_timestamp(const char *path, struct timespec *ts) {
r = write_string_file_atomic_label_ts(path, message, ts);
if (r == -EROFS)
return log_debug_errno(r, "Cannot create \"%s\", file system is read-only.", path);
if (r < 0)
log_debug_errno(r, "Cannot create \"%s\", file system is read-only.", path);
else if (r < 0)
return log_error_errno(r, "Failed to write \"%s\": %m", path);
return 0;
}

View File

@ -92,7 +92,7 @@ gdb(1) będą ostrzegały o skróceniu pliku.
Subject: Utworzono nową sesję @SESSION_ID@ dla użytkownika @USER_ID@
Defined-By: systemd
Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Nowa sesja o identyfikatorze @SESSION_ID@ została utworzona dla użytkownika
@USER_ID@.
@ -103,7 +103,7 @@ Proces prowadzący sesji: @LEADER@.
Subject: Zakończono sesję @SESSION_ID@
Defined-By: systemd
Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Sesja o identyfikatorze @SESSION_ID@ została zakończona.
@ -111,7 +111,7 @@ Sesja o identyfikatorze @SESSION_ID@ została zakończona.
Subject: Dostępne jest nowe stanowisko @SEAT_ID@
Defined-By: systemd
Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Nowe stanowisko @SEAT_ID@ zostało skonfigurowane i jest teraz dostępne.
@ -119,7 +119,7 @@ Nowe stanowisko @SEAT_ID@ zostało skonfigurowane i jest teraz dostępne.
Subject: Usunięto stanowisko @SEAT_ID@
Defined-By: systemd
Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
Documentation: https://www.freedesktop.org/wiki/Software/systemd/multiseat
Documentation: sd-login(3)
Stanowisko @SEAT_ID@ zostało usunięte i nie jest już dostępne.

View File

@ -0,0 +1,14 @@
# SPDX-License-Identifier: LGPL-2.1+
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=First Boot Complete
Documentation=man:systemd.special(7)
RefuseManualStart=yes
ConditionFirstBoot=yes

View File

@ -17,6 +17,7 @@ units = [
['emergency.target', ''],
['exit.target', ''],
['final.target', ''],
['first-boot-complete.target', ''],
['getty.target', '',
'multi-user.target.wants/'],
['getty-pre.target', ''],

View File

@ -13,7 +13,8 @@ Documentation=man:systemd-firstboot(1)
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=systemd-sysusers.service sysinit.target shutdown.target
Before=systemd-sysusers.service sysinit.target first-boot-complete.target shutdown.target
Wants=first-boot-complete.target
ConditionPathIsReadWrite=/etc
ConditionFirstBoot=yes

View File

@ -9,10 +9,10 @@
[Unit]
Description=User Login Management
Documentation=man:sd-login(3)
Documentation=man:systemd-logind.service(8)
Documentation=man:logind.conf(5)
Documentation=man:org.freedesktop.login1(5)
Documentation=https://www.freedesktop.org/wiki/Software/systemd/multiseat
Wants=user.slice modprobe@drm.service
After=nss-user-lookup.target user.slice modprobe@drm.service

View File

@ -12,8 +12,8 @@ Description=Commit a transient machine-id on disk
Documentation=man:systemd-machine-id-commit.service(8)
DefaultDependencies=no
Conflicts=shutdown.target
Before=sysinit.target shutdown.target
After=local-fs.target
Before=shutdown.target
After=local-fs.target first-boot-complete.target
ConditionPathIsReadWrite=/etc
ConditionPathIsMountPoint=/etc/machine-id

View File

@ -14,7 +14,8 @@ DefaultDependencies=no
RequiresMountsFor=@RANDOM_SEED@
Conflicts=shutdown.target
After=systemd-remount-fs.service
Before=shutdown.target
Before=first-boot-complete.target shutdown.target
Wants=first-boot-complete.target
ConditionVirtualization=!container
[Service]