mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 02:03:37 +08:00
core/manager: pass soft-reboot count to generators
soft-reboot allows switching into a different root/installation, i.e. potentially invalidate settings from kernel cmdline and such. Let's hence inform generators about soft-reboots.
This commit is contained in:
parent
de41622bf3
commit
86eb3a8fdd
@ -163,6 +163,15 @@
|
||||
<xi:include href="version-info.xml" xpointer="v251"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>$SYSTEMD_SOFT_REBOOTS_COUNT</varname></term>
|
||||
|
||||
<listitem><para>If the system has soft-rebooted, this variable is set to the count of soft-reboots.
|
||||
This environment variable is only set for system generators.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v257"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>$SYSTEMD_FIRST_BOOT</varname></term>
|
||||
|
||||
|
@ -4081,6 +4081,12 @@ static int build_generator_environment(Manager *m, char ***ret) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (m->soft_reboots_count > 0) {
|
||||
r = strv_env_assignf(&nl, "SYSTEMD_SOFT_REBOOTS_COUNT", "%u", m->soft_reboots_count);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
if (m->first_boot >= 0) {
|
||||
r = strv_env_assign(&nl, "SYSTEMD_FIRST_BOOT", one_zero(m->first_boot));
|
||||
if (r < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user