" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
" </method>\n" \
- " <method name=\"ResetMaintenanceUnit\">\n" \
+ " <method name=\"ResetFailedUnit\">\n" \
" <arg name=\"name\" type=\"s\" direction=\"in\"/>\n" \
" </method>\n" \
" <method name=\"GetJob\">\n" \
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
" </method>\n" \
" <method name=\"ClearJobs\"/>\n" \
- " <method name=\"ResetMaintenance\"/>\n" \
+ " <method name=\"ResetFailed\"/>\n" \
" <method name=\"ListUnits\">\n" \
" <arg name=\"units\" type=\"a(ssssssouso)\" direction=\"out\"/>\n" \
" </method>\n" \
if (!(reply = dbus_message_new_method_return(message)))
goto oom;
- } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ResetMaintenance")) {
+ } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ResetFailed")) {
- manager_reset_maintenance(m);
+ manager_reset_failed(m);
if (!(reply = dbus_message_new_method_return(message)))
goto oom;
- } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ResetMaintenanceUnit")) {
+ } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Manager", "ResetFailedUnit")) {
const char *name;
Unit *u;
return bus_send_error_reply(m, connection, message, &error, -ENOENT);
}
- unit_reset_maintenance(u);
+ unit_reset_failed(u);
if (!(reply = dbus_message_new_method_return(message)))
goto oom;
} else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Unit", "ReloadOrTryRestart")) {
reload_if_possible = true;
job_type = JOB_TRY_RESTART;
- } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Unit", "ResetMaintenance")) {
+ } else if (dbus_message_is_method_call(message, "org.freedesktop.systemd1.Unit", "ResetFailed")) {
- unit_reset_maintenance(u);
+ unit_reset_failed(u);
if (!(reply = dbus_message_new_method_return(message)))
goto oom;
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n" \
" <arg name=\"job\" type=\"o\" direction=\"out\"/>\n" \
" </method>\n" \
- " <method name=\"ResetMaintenance\"/>\n" \
+ " <method name=\"ResetFailed\"/>\n" \
" <property name=\"Id\" type=\"s\" access=\"read\"/>\n" \
" <property name=\"Names\" type=\"as\" access=\"read\"/>\n" \
" <property name=\"Following\" type=\"s\" access=\"read\"/>\n" \
case JOB_STOP:
return
b == UNIT_INACTIVE ||
- b == UNIT_MAINTENANCE;
+ b == UNIT_FAILED;
case JOB_VERIFY_ACTIVE:
return
case JOB_RESTART: {
UnitActiveState t = unit_active_state(j->unit);
- if (t == UNIT_INACTIVE || t == UNIT_MAINTENANCE || t == UNIT_ACTIVATING) {
+ if (t == UNIT_INACTIVE || t == UNIT_FAILED || t == UNIT_ACTIVATING) {
j->type = JOB_START;
r = unit_start(j->unit);
} else
case JOB_TRY_RESTART: {
UnitActiveState t = unit_active_state(j->unit);
- if (t == UNIT_INACTIVE || t == UNIT_MAINTENANCE || t == UNIT_DEACTIVATING)
+ if (t == UNIT_INACTIVE || t == UNIT_FAILED || t == UNIT_DEACTIVATING)
r = -ENOEXEC;
else if (t == UNIT_ACTIVATING) {
j->type = JOB_START;
assert(type < _JOB_TYPE_MAX);
assert(unit);
- if (unit->meta.load_state != UNIT_LOADED && unit->meta.load_state != UNIT_FAILED) {
+ if (unit->meta.load_state != UNIT_LOADED && unit->meta.load_state != UNIT_ERROR) {
dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s is not loaded properly.", unit->meta.id);
return -EINVAL;
}
- if (type != JOB_STOP && unit->meta.load_state == UNIT_FAILED) {
+ if (type != JOB_STOP && unit->meta.load_state == UNIT_ERROR) {
dbus_set_error(e, BUS_ERROR_LOAD_FAILED, "Unit %s failed to load: %s. You might find more information in the logs.",
unit->meta.id,
strerror(-unit->meta.load_error));
continue;
/* No need to stop inactive jobs */
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(unit_active_state(u)))
+ if (UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(u)))
continue;
/* Is there already something listed for this? */
return false;
}
-void manager_reset_maintenance(Manager *m) {
+void manager_reset_failed(Manager *m) {
Unit *u;
Iterator i;
assert(m);
HASHMAP_FOREACH(u, m->units, i)
- unit_reset_maintenance(u);
+ unit_reset_failed(u);
}
int manager_set_console(Manager *m, const char *console) {
bool manager_is_booting_or_shutting_down(Manager *m);
-void manager_reset_maintenance(Manager *m);
+void manager_reset_failed(Manager *m);
void manager_send_unit_audit(Manager *m, Unit *u, int type, bool success);
[MOUNT_REMOUNTING_SIGKILL] = UNIT_RELOADING,
[MOUNT_UNMOUNTING_SIGTERM] = UNIT_DEACTIVATING,
[MOUNT_UNMOUNTING_SIGKILL] = UNIT_DEACTIVATING,
- [MOUNT_MAINTENANCE] = UNIT_MAINTENANCE
+ [MOUNT_FAILED] = UNIT_FAILED
};
static void mount_init(Unit *u) {
state == MOUNT_REMOUNTING_SIGKILL ||
state == MOUNT_UNMOUNTING_SIGTERM ||
state == MOUNT_UNMOUNTING_SIGKILL ||
- state == MOUNT_MAINTENANCE)
+ state == MOUNT_FAILED)
mount_notify_automount(m, -ENODEV);
if (state != old_state)
if (!success)
m->failure = true;
- mount_set_state(m, m->failure ? MOUNT_MAINTENANCE : MOUNT_DEAD);
+ mount_set_state(m, m->failure ? MOUNT_FAILED : MOUNT_DEAD);
}
static void mount_enter_mounted(Mount *m, bool success) {
m->state == MOUNT_MOUNTING_SIGKILL)
return 0;
- assert(m->state == MOUNT_DEAD || m->state == MOUNT_MAINTENANCE);
+ assert(m->state == MOUNT_DEAD || m->state == MOUNT_FAILED);
m->failure = false;
mount_enter_mounting(m);
switch (mount->state) {
case MOUNT_DEAD:
- case MOUNT_MAINTENANCE:
+ case MOUNT_FAILED:
mount_enter_mounted(mount, true);
break;
}
}
-static void mount_reset_maintenance(Unit *u) {
+static void mount_reset_failed(Unit *u) {
Mount *m = MOUNT(u);
assert(m);
- if (m->state == MOUNT_MAINTENANCE)
+ if (m->state == MOUNT_FAILED)
mount_set_state(m, MOUNT_DEAD);
m->failure = false;
[MOUNT_REMOUNTING_SIGKILL] = "remounting-sigkill",
[MOUNT_UNMOUNTING_SIGTERM] = "unmounting-sigterm",
[MOUNT_UNMOUNTING_SIGKILL] = "unmounting-sigkill",
- [MOUNT_MAINTENANCE] = "maintenance"
+ [MOUNT_FAILED] = "failed"
};
DEFINE_STRING_TABLE_LOOKUP(mount_state, MountState);
.sigchld_event = mount_sigchld_event,
.timer_event = mount_timer_event,
- .reset_maintenance = mount_reset_maintenance,
+ .reset_failed = mount_reset_failed,
.bus_interface = "org.freedesktop.systemd1.Mount",
.bus_message_handler = bus_mount_message_handler,
MOUNT_REMOUNTING_SIGKILL,
MOUNT_UNMOUNTING_SIGTERM,
MOUNT_UNMOUNTING_SIGKILL,
- MOUNT_MAINTENANCE,
+ MOUNT_FAILED,
_MOUNT_STATE_MAX,
_MOUNT_STATE_INVALID = -1
} MountState;
[PATH_DEAD] = UNIT_INACTIVE,
[PATH_WAITING] = UNIT_ACTIVE,
[PATH_RUNNING] = UNIT_ACTIVE,
- [PATH_MAINTENANCE] = UNIT_MAINTENANCE
+ [PATH_FAILED] = UNIT_FAILED
};
static void path_done(Unit *u) {
if (!success)
p->failure = true;
- path_set_state(p, p->failure ? PATH_MAINTENANCE : PATH_DEAD);
+ path_set_state(p, p->failure ? PATH_FAILED : PATH_DEAD);
}
static void path_enter_running(Path *p) {
Path *p = PATH(u);
assert(p);
- assert(p->state == PATH_DEAD || p->state == PATH_MAINTENANCE);
+ assert(p->state == PATH_DEAD || p->state == PATH_FAILED);
if (p->unit->meta.load_state != UNIT_LOADED)
return -ENOENT;
log_error("Failed find path unit: %s", strerror(-r));
}
-static void path_reset_maintenance(Unit *u) {
+static void path_reset_failed(Unit *u) {
Path *p = PATH(u);
assert(p);
- if (p->state == PATH_MAINTENANCE)
+ if (p->state == PATH_FAILED)
path_set_state(p, PATH_DEAD);
p->failure = false;
[PATH_DEAD] = "dead",
[PATH_WAITING] = "waiting",
[PATH_RUNNING] = "running",
- [PATH_MAINTENANCE] = "maintenance"
+ [PATH_FAILED] = "failed"
};
DEFINE_STRING_TABLE_LOOKUP(path_state, PathState);
.fd_event = path_fd_event,
- .reset_maintenance = path_reset_maintenance,
+ .reset_failed = path_reset_failed,
.bus_interface = "org.freedesktop.systemd1.Path",
.bus_message_handler = bus_path_message_handler
PATH_DEAD,
PATH_WAITING,
PATH_RUNNING,
- PATH_MAINTENANCE,
+ PATH_FAILED,
_PATH_STATE_MAX,
_PATH_STATE_INVALID = -1
} PathState;
[SERVICE_STOP_POST] = UNIT_DEACTIVATING,
[SERVICE_FINAL_SIGTERM] = UNIT_DEACTIVATING,
[SERVICE_FINAL_SIGKILL] = UNIT_DEACTIVATING,
- [SERVICE_MAINTENANCE] = UNIT_MAINTENANCE,
+ [SERVICE_FAILED] = UNIT_FAILED,
[SERVICE_AUTO_RESTART] = UNIT_ACTIVATING
};
state == SERVICE_STOP_POST ||
state == SERVICE_FINAL_SIGTERM ||
state == SERVICE_FINAL_SIGKILL ||
- state == SERVICE_MAINTENANCE ||
+ state == SERVICE_FAILED ||
state == SERVICE_AUTO_RESTART)
service_notify_sockets_dead(s);
service_set_state(s, SERVICE_AUTO_RESTART);
} else
- service_set_state(s, s->failure ? SERVICE_MAINTENANCE : SERVICE_DEAD);
+ service_set_state(s, s->failure ? SERVICE_FAILED : SERVICE_DEAD);
s->forbid_restart = false;
s->state == SERVICE_START_POST)
return 0;
- assert(s->state == SERVICE_DEAD || s->state == SERVICE_MAINTENANCE || s->state == SERVICE_AUTO_RESTART);
+ assert(s->state == SERVICE_DEAD || s->state == SERVICE_FAILED || s->state == SERVICE_AUTO_RESTART);
/* Make sure we don't enter a busy loop of some kind. */
if (!ratelimit_test(&s->ratelimit)) {
break;
case SERVICE_FINAL_SIGKILL:
- log_warning("%s still around after SIGKILL (2). Entering maintenance mode.", u->meta.id);
+ log_warning("%s still around after SIGKILL (2). Entering failed mode.", u->meta.id);
service_enter_dead(s, false, true);
break;
return 0;
}
-static void service_reset_maintenance(Unit *u) {
+static void service_reset_failed(Unit *u) {
Service *s = SERVICE(u);
assert(s);
- if (s->state == SERVICE_MAINTENANCE)
+ if (s->state == SERVICE_FAILED)
service_set_state(s, SERVICE_DEAD);
s->failure = false;
[SERVICE_STOP_POST] = "stop-post",
[SERVICE_FINAL_SIGTERM] = "final-sigterm",
[SERVICE_FINAL_SIGKILL] = "final-sigkill",
- [SERVICE_MAINTENANCE] = "maintenance",
+ [SERVICE_FAILED] = "failed",
[SERVICE_AUTO_RESTART] = "auto-restart",
};
.sigchld_event = service_sigchld_event,
.timer_event = service_timer_event,
- .reset_maintenance = service_reset_maintenance,
+ .reset_failed = service_reset_failed,
.cgroup_notify_empty = service_cgroup_notify_event,
.notify_message = service_notify_message,
SERVICE_STOP_POST,
SERVICE_FINAL_SIGTERM, /* In case the STOP_POST executable hangs, we shoot that down, too */
SERVICE_FINAL_SIGKILL,
- SERVICE_MAINTENANCE,
+ SERVICE_FAILED,
SERVICE_AUTO_RESTART,
_SERVICE_STATE_MAX,
_SERVICE_STATE_INVALID = -1
[SOCKET_STOP_POST] = UNIT_DEACTIVATING,
[SOCKET_FINAL_SIGTERM] = UNIT_DEACTIVATING,
[SOCKET_FINAL_SIGKILL] = UNIT_DEACTIVATING,
- [SOCKET_MAINTENANCE] = UNIT_MAINTENANCE
+ [SOCKET_FAILED] = UNIT_FAILED
};
static void socket_init(Unit *u) {
if (!success)
s->failure = true;
- socket_set_state(s, s->failure ? SOCKET_MAINTENANCE : SOCKET_DEAD);
+ socket_set_state(s, s->failure ? SOCKET_FAILED : SOCKET_DEAD);
}
static void socket_enter_signal(Socket *s, SocketState state, bool success);
/* If the service is alredy actvie we cannot start the
* socket */
if (s->service->state != SERVICE_DEAD &&
- s->service->state != SERVICE_MAINTENANCE &&
+ s->service->state != SERVICE_FAILED &&
s->service->state != SERVICE_AUTO_RESTART)
return -EBUSY;
}
- assert(s->state == SOCKET_DEAD || s->state == SOCKET_MAINTENANCE);
+ assert(s->state == SOCKET_DEAD || s->state == SOCKET_FAILED);
s->failure = false;
socket_enter_start_pre(s);
break;
case SOCKET_FINAL_SIGKILL:
- log_warning("%s still around after SIGKILL (2). Entering maintenance mode.", u->meta.id);
+ log_warning("%s still around after SIGKILL (2). Entering failed mode.", u->meta.id);
socket_enter_dead(s, false);
break;
log_debug("%s: One connection closed, %u left.", s->meta.id, s->n_connections);
}
-static void socket_reset_maintenance(Unit *u) {
+static void socket_reset_failed(Unit *u) {
Socket *s = SOCKET(u);
assert(s);
- if (s->state == SOCKET_MAINTENANCE)
+ if (s->state == SOCKET_FAILED)
socket_set_state(s, SOCKET_DEAD);
s->failure = false;
[SOCKET_STOP_POST] = "stop-post",
[SOCKET_FINAL_SIGTERM] = "final-sigterm",
[SOCKET_FINAL_SIGKILL] = "final-sigkill",
- [SOCKET_MAINTENANCE] = "maintenance"
+ [SOCKET_FAILED] = "failed"
};
DEFINE_STRING_TABLE_LOOKUP(socket_state, SocketState);
.sigchld_event = socket_sigchld_event,
.timer_event = socket_timer_event,
- .reset_maintenance = socket_reset_maintenance,
+ .reset_failed = socket_reset_failed,
.bus_interface = "org.freedesktop.systemd1.Socket",
.bus_message_handler = bus_socket_message_handler,
SOCKET_STOP_POST,
SOCKET_FINAL_SIGTERM,
SOCKET_FINAL_SIGKILL,
- SOCKET_MAINTENANCE,
+ SOCKET_FAILED,
_SOCKET_STATE_MAX,
_SOCKET_STATE_INVALID = -1
} SocketState;
static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
[SWAP_DEAD] = UNIT_INACTIVE,
[SWAP_ACTIVE] = UNIT_ACTIVE,
- [SWAP_MAINTENANCE] = UNIT_MAINTENANCE
+ [SWAP_FAILED] = UNIT_FAILED
};
static void swap_init(Unit *u) {
static void swap_enter_dead(Swap *s, bool success) {
assert(s);
- swap_set_state(s, success ? SWAP_DEAD : SWAP_MAINTENANCE);
+ swap_set_state(s, success ? SWAP_DEAD : SWAP_FAILED);
}
static int swap_start(Unit *u) {
int r;
assert(s);
- assert(s->state == SWAP_DEAD || s->state == SWAP_MAINTENANCE);
+ assert(s->state == SWAP_DEAD || s->state == SWAP_FAILED);
if (s->from_fragment)
priority = s->parameters_fragment.priority;
return r;
}
-static void swap_reset_maintenance(Unit *u) {
+static void swap_reset_failed(Unit *u) {
Swap *s = SWAP(u);
assert(s);
- if (s->state == SWAP_MAINTENANCE)
+ if (s->state == SWAP_FAILED)
swap_set_state(s, SWAP_DEAD);
}
static const char* const swap_state_table[_SWAP_STATE_MAX] = {
[SWAP_DEAD] = "dead",
[SWAP_ACTIVE] = "active",
- [SWAP_MAINTENANCE] = "maintenance"
+ [SWAP_FAILED] = "failed"
};
DEFINE_STRING_TABLE_LOOKUP(swap_state, SwapState);
.bus_message_handler = bus_swap_message_handler,
.bus_invalidating_properties = bus_swap_invalidating_properties,
- .reset_maintenance = swap_reset_maintenance,
+ .reset_failed = swap_reset_failed,
.enumerate = swap_enumerate,
.shutdown = swap_shutdown
typedef enum SwapState {
SWAP_DEAD,
SWAP_ACTIVE,
- SWAP_MAINTENANCE,
+ SWAP_FAILED,
_SWAP_STATE_MAX,
_SWAP_STATE_INVALID = -1
} SwapState;
int a = 0, b = 0;
const char *on, *off;
- if (streq(u->active_state, "maintenance")) {
+ if (streq(u->active_state, "failed")) {
on = ansi_highlight(true);
off = ansi_highlight(false);
} else
ss = streq_ptr(i->active_state, i->sub_state) ? NULL : i->sub_state;
- if (streq_ptr(i->active_state, "maintenance")) {
+ if (streq_ptr(i->active_state, "failed")) {
on = ansi_highlight(true);
off = ansi_highlight(false);
} else if (streq_ptr(i->active_state, "active") || streq_ptr(i->active_state, "reloading")) {
timestamp = (streq_ptr(i->active_state, "active") ||
streq_ptr(i->active_state, "reloading")) ? i->active_enter_timestamp :
(streq_ptr(i->active_state, "inactive") ||
- streq_ptr(i->active_state, "maintenance")) ? i->inactive_enter_timestamp :
+ streq_ptr(i->active_state, "failed")) ? i->inactive_enter_timestamp :
streq_ptr(i->active_state, "activating") ? i->inactive_exit_timestamp :
i->active_exit_timestamp;
streq(args[0], "clear-jobs") ||
streq(args[0], "cancel") ? "ClearJobs" :
streq(args[0], "daemon-reexec") ? "Reexecute" :
- streq(args[0], "reset-maintenance") ? "ResetMaintenance" :
+ streq(args[0], "reset-failed") ? "ResetFailed" :
streq(args[0], "daemon-exit") ? "Exit" :
"Reload";
}
return r;
}
-static int reset_maintenance(DBusConnection *bus, char **args, unsigned n) {
+static int reset_failed(DBusConnection *bus, char **args, unsigned n) {
DBusMessage *m = NULL, *reply = NULL;
unsigned i;
int r;
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager",
- "ResetMaintenanceUnit"))) {
+ "ResetFailedUnit"))) {
log_error("Could not allocate message.");
r = -ENOMEM;
goto finish;
" status [NAME...|PID...] Show runtime status of one or more units\n"
" show [NAME...|JOB...] Show properties of one or more\n"
" units/jobs or the manager\n"
- " reset-maintenance [NAME...] Reset maintenance state for all, one,\n"
- " or more units\n"
+ " reset-failed [NAME...] Reset failed state for all, one, or more\n"
+ " units\n"
" enable [NAME...] Enable one or more unit files\n"
" disable [NAME...] Disable one or more unit files\n"
" is-enabled [NAME...] Check whether unit files are enabled\n"
{ "default", EQUAL, 1, start_special },
{ "rescue", EQUAL, 1, start_special },
{ "emergency", EQUAL, 1, start_special },
- { "reset-maintenance", MORE, 1, reset_maintenance },
+ { "reset-failed", MORE, 1, reset_failed },
{ "enable", MORE, 2, enable_unit },
{ "disable", MORE, 2, enable_unit },
{ "is-enabled", MORE, 2, enable_unit }
public abstract ObjectPath reload_or_restart_unit(string name, string mode = "replace") throws DBus.Error;
public abstract ObjectPath reload_or_try_restart_unit(string name, string mode = "replace") throws DBus.Error;
- public abstract void reset_maintenance_unit(string name = "") throws DBus.Error;
+ public abstract void reset_failed_unit(string name = "") throws DBus.Error;
public abstract void clear_jobs() throws DBus.Error;
public abstract ObjectPath reload_or_restart(string mode = "replace") throws DBus.Error;
public abstract ObjectPath reload_or_try_restart(string mode = "replace") throws DBus.Error;
- public abstract void reset_maintenance() throws DBus.Error;
+ public abstract void reset_failed() throws DBus.Error;
}
[DBus (name = "org.freedesktop.systemd1.Job")]
[TIMER_WAITING] = UNIT_ACTIVE,
[TIMER_RUNNING] = UNIT_ACTIVE,
[TIMER_ELAPSED] = UNIT_ACTIVE,
- [TIMER_MAINTENANCE] = UNIT_MAINTENANCE
+ [TIMER_FAILED] = UNIT_FAILED
};
static void timer_init(Unit *u) {
if (!success)
t->failure = true;
- timer_set_state(t, t->failure ? TIMER_MAINTENANCE : TIMER_DEAD);
+ timer_set_state(t, t->failure ? TIMER_FAILED : TIMER_DEAD);
}
static void timer_enter_waiting(Timer *t, bool initial) {
Timer *t = TIMER(u);
assert(t);
- assert(t->state == TIMER_DEAD || t->state == TIMER_MAINTENANCE);
+ assert(t->state == TIMER_DEAD || t->state == TIMER_FAILED);
if (t->unit->meta.load_state != UNIT_LOADED)
return -ENOENT;
case TIMER_RUNNING:
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(new_state)) {
+ if (UNIT_IS_INACTIVE_OR_FAILED(new_state)) {
log_debug("%s got notified about unit deactivation.", t->meta.id);
timer_enter_waiting(t, false);
}
break;
case TIMER_DEAD:
- case TIMER_MAINTENANCE:
+ case TIMER_FAILED:
;
default:
log_error("Failed find timer unit: %s", strerror(-r));
}
-static void timer_reset_maintenance(Unit *u) {
+static void timer_reset_failed(Unit *u) {
Timer *t = TIMER(u);
assert(t);
- if (t->state == TIMER_MAINTENANCE)
+ if (t->state == TIMER_FAILED)
timer_set_state(t, TIMER_DEAD);
t->failure = false;
[TIMER_WAITING] = "waiting",
[TIMER_RUNNING] = "running",
[TIMER_ELAPSED] = "elapsed",
- [TIMER_MAINTENANCE] = "maintenance"
+ [TIMER_FAILED] = "failed"
};
DEFINE_STRING_TABLE_LOOKUP(timer_state, TimerState);
.timer_event = timer_timer_event,
- .reset_maintenance = timer_reset_maintenance,
+ .reset_failed = timer_reset_failed,
.bus_interface = "org.freedesktop.systemd1.Timer",
.bus_message_handler = bus_timer_message_handler,
TIMER_WAITING,
TIMER_RUNNING,
TIMER_ELAPSED,
- TIMER_MAINTENANCE,
+ TIMER_FAILED,
_TIMER_STATE_MAX,
_TIMER_STATE_INVALID = -1
} TimerState;
/* After a reload it might happen that a unit is not correctly
* loaded but still has a process around. That's why we won't
- * shortcut failed loading to UNIT_INACTIVE_MAINTENANCE. */
+ * shortcut failed loading to UNIT_INACTIVE_FAILED. */
return UNIT_VTABLE(u)->active_state(u);
}
return -EINVAL;
if (other->meta.load_state != UNIT_STUB &&
- other->meta.load_state != UNIT_FAILED)
+ other->meta.load_state != UNIT_ERROR)
return -EEXIST;
if (other->meta.job)
return -EEXIST;
- if (!UNIT_IS_INACTIVE_OR_MAINTENANCE(unit_active_state(other)))
+ if (!UNIT_IS_INACTIVE_OR_FAILED(unit_active_state(other)))
return -EEXIST;
/* Merge names */
fprintf(f,
"%s\tMerged into: %s\n",
prefix, u->meta.merged_into->meta.id);
- else if (u->meta.load_state == UNIT_FAILED)
+ else if (u->meta.load_state == UNIT_ERROR)
fprintf(f, "%s\tLoad Error Code: %s\n", prefix, strerror(-u->meta.load_error));
return 0;
fail:
- u->meta.load_state = UNIT_FAILED;
+ u->meta.load_state = UNIT_ERROR;
u->meta.load_error = r;
unit_add_to_dbus_queue(u);
assert(u);
state = unit_active_state(u);
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(state))
+ if (UNIT_IS_INACTIVE_OR_FAILED(state))
return -EALREADY;
if (!UNIT_VTABLE(u)->stop)
dual_timestamp_get(&ts);
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(os) && !UNIT_IS_INACTIVE_OR_MAINTENANCE(ns))
+ if (UNIT_IS_INACTIVE_OR_FAILED(os) && !UNIT_IS_INACTIVE_OR_FAILED(ns))
u->meta.inactive_exit_timestamp = ts;
- else if (!UNIT_IS_INACTIVE_OR_MAINTENANCE(os) && UNIT_IS_INACTIVE_OR_MAINTENANCE(ns))
+ else if (!UNIT_IS_INACTIVE_OR_FAILED(os) && UNIT_IS_INACTIVE_OR_FAILED(ns))
u->meta.inactive_enter_timestamp = ts;
if (!UNIT_IS_ACTIVE_OR_RELOADING(os) && UNIT_IS_ACTIVE_OR_RELOADING(ns))
else if (UNIT_IS_ACTIVE_OR_RELOADING(os) && !UNIT_IS_ACTIVE_OR_RELOADING(ns))
u->meta.active_exit_timestamp = ts;
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(ns))
+ if (UNIT_IS_INACTIVE_OR_FAILED(ns))
cgroup_bonding_trim_list(u->meta.cgroup_bondings, true);
timer_unit_notify(u, ns);
else if (u->meta.job->state == JOB_RUNNING && ns != UNIT_ACTIVATING) {
unexpected = true;
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(ns))
- job_finish_and_invalidate(u->meta.job, ns != UNIT_MAINTENANCE);
+ if (UNIT_IS_INACTIVE_OR_FAILED(ns))
+ job_finish_and_invalidate(u->meta.job, ns != UNIT_FAILED);
}
break;
else if (ns != UNIT_ACTIVATING && ns != UNIT_RELOADING) {
unexpected = true;
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(ns))
- job_finish_and_invalidate(u->meta.job, ns != UNIT_MAINTENANCE);
+ if (UNIT_IS_INACTIVE_OR_FAILED(ns))
+ job_finish_and_invalidate(u->meta.job, ns != UNIT_FAILED);
}
}
case JOB_RESTART:
case JOB_TRY_RESTART:
- if (UNIT_IS_INACTIVE_OR_MAINTENANCE(ns))
+ if (UNIT_IS_INACTIVE_OR_FAILED(ns))
job_finish_and_invalidate(u->meta.job, true);
else if (u->meta.job->state == JOB_RUNNING && ns != UNIT_DEACTIVATING) {
unexpected = true;
retroactively_stop_dependencies(u);
}
- if (ns != os && ns == UNIT_MAINTENANCE) {
+ if (ns != os && ns == UNIT_FAILED) {
Iterator i;
Unit *other;
SET_FOREACH(other, u->meta.dependencies[UNIT_ON_FAILURE], i)
manager_add_job(u->meta.manager, JOB_START, other, JOB_REPLACE, true, NULL, NULL);
- log_notice("Unit %s entered maintenance state.", u->meta.id);
+ log_notice("Unit %s entered failed state.", u->meta.id);
}
/* Some names are special */
* asynchronous notification for it anyway. */
if (u->meta.type == UNIT_SERVICE &&
- UNIT_IS_INACTIVE_OR_MAINTENANCE(ns) &&
- !UNIT_IS_INACTIVE_OR_MAINTENANCE(os)) {
+ UNIT_IS_INACTIVE_OR_FAILED(ns) &&
+ !UNIT_IS_INACTIVE_OR_FAILED(os)) {
/* Hmm, if there was no start record written
* write it now, so that we always have a nice
timespec_load(&st.st_mtim) != u->meta.fragment_mtime;
}
-void unit_reset_maintenance(Unit *u) {
+void unit_reset_failed(Unit *u) {
assert(u);
- if (UNIT_VTABLE(u)->reset_maintenance)
- UNIT_VTABLE(u)->reset_maintenance(u);
+ if (UNIT_VTABLE(u)->reset_failed)
+ UNIT_VTABLE(u)->reset_failed(u);
}
Unit *unit_following(Unit *u) {
static const char* const unit_load_state_table[_UNIT_LOAD_STATE_MAX] = {
[UNIT_STUB] = "stub",
[UNIT_LOADED] = "loaded",
- [UNIT_FAILED] = "failed",
+ [UNIT_ERROR] = "error",
[UNIT_MERGED] = "merged"
};
[UNIT_ACTIVE] = "active",
[UNIT_RELOADING] = "reloading",
[UNIT_INACTIVE] = "inactive",
- [UNIT_MAINTENANCE] = "maintenance",
+ [UNIT_FAILED] = "failed",
[UNIT_ACTIVATING] = "activating",
[UNIT_DEACTIVATING] = "deactivating"
};
enum UnitLoadState {
UNIT_STUB,
UNIT_LOADED,
- UNIT_FAILED,
+ UNIT_ERROR,
UNIT_MERGED,
_UNIT_LOAD_STATE_MAX,
_UNIT_LOAD_STATE_INVALID = -1
UNIT_ACTIVE,
UNIT_RELOADING,
UNIT_INACTIVE,
- UNIT_MAINTENANCE,
+ UNIT_FAILED,
UNIT_ACTIVATING,
UNIT_DEACTIVATING,
_UNIT_ACTIVE_STATE_MAX,
}
static inline bool UNIT_IS_INACTIVE_OR_DEACTIVATING(UnitActiveState t) {
- return t == UNIT_INACTIVE || t == UNIT_MAINTENANCE || t == UNIT_DEACTIVATING;
+ return t == UNIT_INACTIVE || t == UNIT_FAILED || t == UNIT_DEACTIVATING;
}
-static inline bool UNIT_IS_INACTIVE_OR_MAINTENANCE(UnitActiveState t) {
- return t == UNIT_INACTIVE || t == UNIT_MAINTENANCE;
+static inline bool UNIT_IS_INACTIVE_OR_FAILED(UnitActiveState t) {
+ return t == UNIT_INACTIVE || t == UNIT_FAILED;
}
enum UnitDependency {
void (*sigchld_event)(Unit *u, pid_t pid, int code, int status);
void (*timer_event)(Unit *u, uint64_t n_elapsed, Watch *w);
- /* Reset maintenance state if we are in maintainance state */
- void (*reset_maintenance)(Unit *u);
+ /* Reset failed state if we are in failed state */
+ void (*reset_failed)(Unit *u);
/* Called whenever any of the cgroups this unit watches for
* ran empty */
bool unit_need_daemon_reload(Unit *u);
-void unit_reset_maintenance(Unit *u);
+void unit_reset_failed(Unit *u);
Unit *unit_following(Unit *u);