manager: rename 'maintenance' state to 'failed' to avoid user confusion

https://bugzilla.redhat.com/show_bug.cgi?id=614619
This commit is contained in:
Matthew Miller 2010-08-31 00:17:56 +02:00 committed by Lennart Poettering
parent c88e7f4e57
commit 74ac3cbd50
6 changed files with 38 additions and 35 deletions

2
fixme
View File

@ -50,7 +50,7 @@
* io priority during initialization * io priority during initialization
* if a service fails too often, make the service enter maintenance mode, and the socket, too. * if a service fails too often, make the service enter failed mode, and the socket, too.
* systemctl: warning wenn [Install] leer ist bei enable * systemctl: warning wenn [Install] leer ist bei enable

View File

@ -399,18 +399,19 @@
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><command>reset-maintenance [NAME...]</command></term> <term><command>reset-failed [NAME...]</command></term>
<listitem><para>Reset maintenance <listitem><para>Reset the
state of the specified units, or if no '<literal>failed</literal>' state of the
unit name is passed of all units. When specified units, or if no unit name is
a unit fails in some way (i.e. process passed of all units. When a unit fails
exiting with non-zero error code, in some way (i.e. process exiting with
terminating abnormally or timing out) non-zero error code, terminating
it will automatically enter abnormally or timing out) it will
maintenance state and its exit codes automatically enter the
and status is recorded for '<literal>failed</literal>' state and
introspection by the administrator its exit code and status is recorded
for introspection by the administrator
until the service is restarted or until the service is restarted or
reset with this reset with this
command.</para></listitem> command.</para></listitem>

View File

@ -418,8 +418,9 @@
<listitem><para>Lists one or more <listitem><para>Lists one or more
units that are activated when this units that are activated when this
unit fails (i.e. enters maintenance unit enters the
state).</para></listitem> '<literal>failed</literal>'
state.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
@ -552,22 +553,23 @@
time. If this time limit is reached time. If this time limit is reached
the job will be cancelled, the unit the job will be cancelled, the unit
however will not change state or even however will not change state or even
enter maintenance mode. This value enter the '<literal>failed</literal>'
defaults to 0 (job timeouts disabled), mode. This value defaults to 0 (job
except for device units. NB: this timeouts disabled), except for device
timeout is independent from any units. NB: this timeout is independent
unit-specific timeout (for example, from any unit-specific timeout (for
the timeout set with example, the timeout set with
<varname>Timeout=</varname> in service <varname>Timeout=</varname> in service
units) as the job timeout has no effect units) as the job timeout has no
on the unit itself, only on the job effect on the unit itself, only on the
that might be pending for it. Or in job that might be pending for it. Or
other words: unit-specific timeouts in other words: unit-specific timeouts
are useful to abort unit state are useful to abort unit state
changes, and revert them. The job changes, and revert them. The job
timeout set with this option however timeout set with this option however
is useful to abort only the job waiting is useful to abort only the job
for the unit state to change.</para></listitem> waiting for the unit state to
change.</para></listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>

View File

@ -256,7 +256,7 @@
as well as in the process of being activated or as well as in the process of being activated or
deactivated, i.e. between the two states (these states deactivated, i.e. between the two states (these states
are called 'activating', 'deactivating'). A special are called 'activating', 'deactivating'). A special
'maintenance' state is available as well which is very 'failed' state is available as well which is very
similar to 'inactive' and is entered when the service similar to 'inactive' and is entered when the service
failed in some way (process returned error code on failed in some way (process returned error code on
exit, or crashed, or an operation timed out). If this exit, or crashed, or an operation timed out). If this

View File

@ -43,7 +43,7 @@ static const UnitActiveState state_translation_table[_AUTOMOUNT_STATE_MAX] = {
[AUTOMOUNT_DEAD] = UNIT_INACTIVE, [AUTOMOUNT_DEAD] = UNIT_INACTIVE,
[AUTOMOUNT_WAITING] = UNIT_ACTIVE, [AUTOMOUNT_WAITING] = UNIT_ACTIVE,
[AUTOMOUNT_RUNNING] = UNIT_ACTIVE, [AUTOMOUNT_RUNNING] = UNIT_ACTIVE,
[AUTOMOUNT_MAINTENANCE] = UNIT_MAINTENANCE [AUTOMOUNT_FAILED] = UNIT_FAILED
}; };
static int open_dev_autofs(Manager *m); static int open_dev_autofs(Manager *m);
@ -294,7 +294,7 @@ static void automount_enter_dead(Automount *a, bool success) {
if (!success) if (!success)
a->failure = true; a->failure = true;
automount_set_state(a, a->failure ? AUTOMOUNT_MAINTENANCE : AUTOMOUNT_DEAD); automount_set_state(a, a->failure ? AUTOMOUNT_FAILED : AUTOMOUNT_DEAD);
} }
static int open_dev_autofs(Manager *m) { static int open_dev_autofs(Manager *m) {
@ -606,7 +606,7 @@ static int automount_start(Unit *u) {
assert(a); assert(a);
assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_MAINTENANCE); assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_FAILED);
if (path_is_mount_point(a->where)) { if (path_is_mount_point(a->where)) {
log_error("Path %s is already a mount point, refusing start for %s", a->where, u->meta.id); log_error("Path %s is already a mount point, refusing start for %s", a->where, u->meta.id);
@ -794,12 +794,12 @@ static void automount_shutdown(Manager *m) {
close_nointr_nofail(m->dev_autofs_fd); close_nointr_nofail(m->dev_autofs_fd);
} }
static void automount_reset_maintenance(Unit *u) { static void automount_reset_failed(Unit *u) {
Automount *a = AUTOMOUNT(u); Automount *a = AUTOMOUNT(u);
assert(a); assert(a);
if (a->state == AUTOMOUNT_MAINTENANCE) if (a->state == AUTOMOUNT_FAILED)
automount_set_state(a, AUTOMOUNT_DEAD); automount_set_state(a, AUTOMOUNT_DEAD);
a->failure = false; a->failure = false;
@ -809,7 +809,7 @@ static const char* const automount_state_table[_AUTOMOUNT_STATE_MAX] = {
[AUTOMOUNT_DEAD] = "dead", [AUTOMOUNT_DEAD] = "dead",
[AUTOMOUNT_WAITING] = "waiting", [AUTOMOUNT_WAITING] = "waiting",
[AUTOMOUNT_RUNNING] = "running", [AUTOMOUNT_RUNNING] = "running",
[AUTOMOUNT_MAINTENANCE] = "maintenance" [AUTOMOUNT_FAILED] = "failed"
}; };
DEFINE_STRING_TABLE_LOOKUP(automount_state, AutomountState); DEFINE_STRING_TABLE_LOOKUP(automount_state, AutomountState);
@ -841,7 +841,7 @@ const UnitVTable automount_vtable = {
.fd_event = automount_fd_event, .fd_event = automount_fd_event,
.reset_maintenance = automount_reset_maintenance, .reset_failed = automount_reset_failed,
.bus_interface = "org.freedesktop.systemd1.Automount", .bus_interface = "org.freedesktop.systemd1.Automount",
.bus_message_handler = bus_automount_message_handler, .bus_message_handler = bus_automount_message_handler,

View File

@ -30,7 +30,7 @@ typedef enum AutomountState {
AUTOMOUNT_DEAD, AUTOMOUNT_DEAD,
AUTOMOUNT_WAITING, AUTOMOUNT_WAITING,
AUTOMOUNT_RUNNING, AUTOMOUNT_RUNNING,
AUTOMOUNT_MAINTENANCE, AUTOMOUNT_FAILED,
_AUTOMOUNT_STATE_MAX, _AUTOMOUNT_STATE_MAX,
_AUTOMOUNT_STATE_INVALID = -1 _AUTOMOUNT_STATE_INVALID = -1
} AutomountState; } AutomountState;