Skip to content

Commit 3835b9a

Browse files
committed
Revert "core: add IgnoreOnSoftReboot= unit option"
The feature is not ready, postpone it This reverts commit b80fc61.
1 parent acfff02 commit 3835b9a

18 files changed

+52
-166
lines changed

man/org.freedesktop.systemd1.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,8 +1977,6 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
19771977
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
19781978
readonly b DefaultDependencies = ...;
19791979
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
1980-
readonly b IgnoreOnSoftReboot = ...;
1981-
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
19821980
readonly s OnSuccessJobMode = '...';
19831981
@org.freedesktop.DBus.Property.EmitsChangedSignal("const")
19841982
readonly s OnFailureJobMode = '...';
@@ -2093,8 +2091,6 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
20932091

20942092
<!--property CanFreeze is not documented!-->
20952093

2096-
<!--property IgnoreOnSoftReboot is not documented!-->
2097-
20982094
<!--property OnSuccessJobMode is not documented!-->
20992095

21002096
<!--property OnFailureJobMode is not documented!-->
@@ -2307,8 +2303,6 @@ node /org/freedesktop/systemd1/unit/avahi_2ddaemon_2eservice {
23072303

23082304
<variablelist class="dbus-property" generated="True" extra-ref="DefaultDependencies"/>
23092305

2310-
<variablelist class="dbus-property" generated="True" extra-ref="IgnoreOnSoftReboot"/>
2311-
23122306
<variablelist class="dbus-property" generated="True" extra-ref="OnSuccessJobMode"/>
23132307

23142308
<variablelist class="dbus-property" generated="True" extra-ref="OnFailureJobMode"/>

man/systemd-soft-reboot.service.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@
124124
otherwise the old root filesystem will be kept in memory as long as the unit is running.</para>
125125

126126
<para>If units shall be left running until the very end of shutdown during a soft reboot operation, but
127-
shall be terminated regularly during other forms of shutdown, <varname>IgnoreOnSoftReboot=yes</varname>
128-
can be set. This will ensure that soft reboot operations do not affect it, but other types of reboot
129-
or shutdown stop it as expected.</para>
127+
shall be terminated regularly during other forms of shutdown, it's recommended to set
128+
<varname>DefaultDependencies=no</varname> and then place
129+
<varname>Conflicts=</varname>/<varname>Before=</varname> onto <filename>reboot.target</filename>,
130+
<filename>kexec.target</filename>, <filename>poweroff.target</filename> and
131+
<filename>halt.target</filename> (but <emphasis>not</emphasis> onto
132+
<filename>soft-reboot.target</filename>).</para>
130133
</refsect1>
131134

132135
<refsect1>

man/systemd.unit.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -979,16 +979,6 @@
979979
ones.</para></listitem>
980980
</varlistentry>
981981

982-
<varlistentry>
983-
<term><varname>IgnoreOnSoftReboot=</varname></term>
984-
985-
<listitem><para>Takes a boolean argument. Defaults to <option>no</option>. If <option>yes</option>,
986-
the unit will be configured to survive a soft reboot operation (see:
987-
<citerefentry><refentrytitle>systemd-soft-reboot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>).
988-
This will ensure the unit is stopped normally during reboot or shutdown operations, but it survives
989-
a soft reboot by not being stopped on the way down or on the way back up.</para></listitem>
990-
</varlistentry>
991-
992982
<varlistentry>
993983
<term><varname>CollectMode=</varname></term>
994984

src/core/dbus-unit.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,6 @@ const sd_bus_vtable bus_unit_vtable[] = {
921921
SD_BUS_PROPERTY("RefuseManualStop", "b", bus_property_get_bool, offsetof(Unit, refuse_manual_stop), SD_BUS_VTABLE_PROPERTY_CONST),
922922
SD_BUS_PROPERTY("AllowIsolate", "b", bus_property_get_bool, offsetof(Unit, allow_isolate), SD_BUS_VTABLE_PROPERTY_CONST),
923923
SD_BUS_PROPERTY("DefaultDependencies", "b", bus_property_get_bool, offsetof(Unit, default_dependencies), SD_BUS_VTABLE_PROPERTY_CONST),
924-
SD_BUS_PROPERTY("IgnoreOnSoftReboot", "b", bus_property_get_bool, offsetof(Unit, ignore_on_soft_reboot), SD_BUS_VTABLE_PROPERTY_CONST),
925924
SD_BUS_PROPERTY("OnSuccesJobMode", "s", property_get_job_mode, offsetof(Unit, on_success_job_mode), SD_BUS_VTABLE_PROPERTY_CONST|SD_BUS_VTABLE_HIDDEN), /* deprecated */
926925
SD_BUS_PROPERTY("OnSuccessJobMode", "s", property_get_job_mode, offsetof(Unit, on_success_job_mode), SD_BUS_VTABLE_PROPERTY_CONST),
927926
SD_BUS_PROPERTY("OnFailureJobMode", "s", property_get_job_mode, offsetof(Unit, on_failure_job_mode), SD_BUS_VTABLE_PROPERTY_CONST),
@@ -2176,9 +2175,6 @@ static int bus_unit_set_transient_property(
21762175
if (streq(name, "DefaultDependencies"))
21772176
return bus_set_transient_bool(u, name, &u->default_dependencies, message, flags, error);
21782177

2179-
if (streq(name, "IgnoreOnSoftReboot"))
2180-
return bus_set_transient_bool(u, name, &u->ignore_on_soft_reboot, message, flags, error);
2181-
21822178
if (streq(name, "OnSuccessJobMode"))
21832179
return bus_set_transient_job_mode(u, name, &u->on_success_job_mode, message, flags, error);
21842180

src/core/load-fragment-gperf.gperf.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ Unit.RefuseManualStart, config_parse_bool,
312312
Unit.RefuseManualStop, config_parse_bool, 0, offsetof(Unit, refuse_manual_stop)
313313
Unit.AllowIsolate, config_parse_bool, 0, offsetof(Unit, allow_isolate)
314314
Unit.DefaultDependencies, config_parse_bool, 0, offsetof(Unit, default_dependencies)
315-
Unit.IgnoreOnSoftReboot, config_parse_bool, 0, offsetof(Unit, ignore_on_soft_reboot)
316315
Unit.OnSuccessJobMode, config_parse_job_mode, 0, offsetof(Unit, on_success_job_mode)
317316
Unit.OnFailureJobMode, config_parse_job_mode, 0, offsetof(Unit, on_failure_job_mode)
318317
{# The following is a legacy alias name for compatibility #}

src/core/path.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -342,24 +342,12 @@ static int path_add_default_dependencies(Path *p) {
342342
return r;
343343

344344
if (MANAGER_IS_SYSTEM(UNIT(p)->manager)) {
345-
r = unit_add_two_dependencies_by_name(UNIT(p),
346-
UNIT_AFTER,
347-
UNIT(p)->ignore_on_soft_reboot ? -EINVAL : UNIT_REQUIRES,
348-
SPECIAL_SYSINIT_TARGET,
349-
true,
350-
UNIT_DEPENDENCY_DEFAULT);
345+
r = unit_add_two_dependencies_by_name(UNIT(p), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
351346
if (r < 0)
352347
return r;
353348
}
354349

355-
if (!UNIT(p)->ignore_on_soft_reboot)
356-
return unit_add_two_dependencies_by_name(
357-
UNIT(p),
358-
UNIT_BEFORE, UNIT_CONFLICTS,
359-
SPECIAL_SHUTDOWN_TARGET, true,
360-
UNIT_DEPENDENCY_DEFAULT);
361-
362-
return unit_add_dependencies_on_real_shutdown_targets(UNIT(p));
350+
return unit_add_two_dependencies_by_name(UNIT(p), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
363351
}
364352

365353
static int path_add_trigger_dependencies(Path *p) {

src/core/scope.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,22 +131,23 @@ static void scope_set_state(Scope *s, ScopeState state) {
131131
}
132132

133133
static int scope_add_default_dependencies(Scope *s) {
134+
int r;
135+
134136
assert(s);
135137

136138
if (!UNIT(s)->default_dependencies)
137139
return 0;
138140

139141
/* Make sure scopes are unloaded on shutdown */
140-
if (!UNIT(s)->ignore_on_soft_reboot)
141-
return unit_add_two_dependencies_by_name(
142-
UNIT(s),
143-
UNIT_BEFORE, UNIT_CONFLICTS,
144-
SPECIAL_SHUTDOWN_TARGET, true,
145-
UNIT_DEPENDENCY_DEFAULT);
142+
r = unit_add_two_dependencies_by_name(
143+
UNIT(s),
144+
UNIT_BEFORE, UNIT_CONFLICTS,
145+
SPECIAL_SHUTDOWN_TARGET, true,
146+
UNIT_DEPENDENCY_DEFAULT);
147+
if (r < 0)
148+
return r;
146149

147-
/* Unless we are meant to survive soft reboot, in which case we need to conflict with
148-
* non-soft-reboot targets. */
149-
return unit_add_dependencies_on_real_shutdown_targets(UNIT(s));
150+
return 0;
150151
}
151152

152153
static int scope_verify(Scope *s) {

src/core/service.c

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -722,16 +722,11 @@ static int service_add_default_dependencies(Service *s) {
722722
* majority of services. */
723723

724724
if (MANAGER_IS_SYSTEM(UNIT(s)->manager)) {
725-
/* First, pull in the really early boot stuff, and require it, so that we fail if we can't
726-
* acquire it. But only add ordering if this is meant to survive a soft reboot, otherwise
727-
* it will be pulled down. */
728-
729-
r = unit_add_two_dependencies_by_name(UNIT(s),
730-
UNIT_AFTER,
731-
UNIT(s)->ignore_on_soft_reboot ? -EINVAL : UNIT_REQUIRES,
732-
SPECIAL_SYSINIT_TARGET,
733-
true,
734-
UNIT_DEPENDENCY_DEFAULT);
725+
/* First, pull in the really early boot stuff, and
726+
* require it, so that we fail if we can't acquire
727+
* it. */
728+
729+
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
735730
if (r < 0)
736731
return r;
737732
} else {
@@ -752,17 +747,7 @@ static int service_add_default_dependencies(Service *s) {
752747
return r;
753748

754749
/* Third, add us in for normal shutdown. */
755-
if (!UNIT(s)->ignore_on_soft_reboot)
756-
return unit_add_two_dependencies_by_name(UNIT(s),
757-
UNIT_BEFORE,
758-
UNIT_CONFLICTS,
759-
SPECIAL_SHUTDOWN_TARGET,
760-
true,
761-
UNIT_DEPENDENCY_DEFAULT);
762-
763-
/* Unless we are meant to survive soft reboot, in which case we need to conflict with
764-
* non-soft-reboot targets. */
765-
return unit_add_dependencies_on_real_shutdown_targets(UNIT(s));
750+
return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
766751
}
767752

768753
static void service_fix_stdio(Service *s) {

src/core/slice.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,22 @@ static int slice_add_parent_slice(Slice *s) {
6464
}
6565

6666
static int slice_add_default_dependencies(Slice *s) {
67+
int r;
68+
6769
assert(s);
6870

6971
if (!UNIT(s)->default_dependencies)
7072
return 0;
7173

7274
/* Make sure slices are unloaded on shutdown */
73-
if (!UNIT(s)->ignore_on_soft_reboot)
74-
return unit_add_two_dependencies_by_name(
75-
UNIT(s),
76-
UNIT_BEFORE, UNIT_CONFLICTS,
77-
SPECIAL_SHUTDOWN_TARGET, true,
78-
UNIT_DEPENDENCY_DEFAULT);
79-
80-
/* Unless we are meant to survive soft reboot, in which case we need to conflict with
81-
* non-soft-reboot targets. */
82-
return unit_add_dependencies_on_real_shutdown_targets(UNIT(s));
75+
r = unit_add_two_dependencies_by_name(
76+
UNIT(s),
77+
UNIT_BEFORE, UNIT_CONFLICTS,
78+
SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
79+
if (r < 0)
80+
return r;
81+
82+
return 0;
8383
}
8484

8585
static int slice_verify(Slice *s) {

src/core/socket.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -278,24 +278,12 @@ static int socket_add_default_dependencies(Socket *s) {
278278
return r;
279279

280280
if (MANAGER_IS_SYSTEM(UNIT(s)->manager)) {
281-
r = unit_add_two_dependencies_by_name(UNIT(s),
282-
UNIT_AFTER,
283-
UNIT(s)->ignore_on_soft_reboot ? -EINVAL : UNIT_REQUIRES,
284-
SPECIAL_SYSINIT_TARGET,
285-
true,
286-
UNIT_DEPENDENCY_DEFAULT);
281+
r = unit_add_two_dependencies_by_name(UNIT(s), UNIT_AFTER, UNIT_REQUIRES, SPECIAL_SYSINIT_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
287282
if (r < 0)
288283
return r;
289284
}
290285

291-
if (!UNIT(s)->ignore_on_soft_reboot)
292-
return unit_add_two_dependencies_by_name(
293-
UNIT(s),
294-
UNIT_BEFORE, UNIT_CONFLICTS,
295-
SPECIAL_SHUTDOWN_TARGET, true,
296-
UNIT_DEPENDENCY_DEFAULT);
297-
298-
return unit_add_dependencies_on_real_shutdown_targets(UNIT(s));
286+
return unit_add_two_dependencies_by_name(UNIT(s), UNIT_BEFORE, UNIT_CONFLICTS, SPECIAL_SHUTDOWN_TARGET, true, UNIT_DEPENDENCY_DEFAULT);
299287
}
300288

301289
_pure_ static bool socket_has_exec(Socket *s) {

0 commit comments

Comments
 (0)