summaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-07-18 04:58:01 +0200
committerLennart Poettering <lennart@poettering.net>2010-07-19 04:08:07 +0200
commit5632e3743db350a67478acc107d76cdf648a1f99 (patch)
treee7efad268223470ca3053db650a2c7b3ad9c90c4 /src/service.c
parentb9975629f03a43d4c6b14fdb42eb8dd5a30af28f (diff)
systemctl: introduce reset-maintenance command
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c
index a5d1ebd84b..6b786d1bb1 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2734,6 +2734,17 @@ int service_set_socket_fd(Service *s, int fd, Socket *sock) {
return 0;
}
+static void service_reset_maintenance(Unit *u) {
+ Service *s = SERVICE(u);
+
+ assert(s);
+
+ if (s->state == SERVICE_MAINTENANCE)
+ service_set_state(s, SERVICE_DEAD);
+
+ s->failure = false;
+}
+
static const char* const service_state_table[_SERVICE_STATE_MAX] = {
[SERVICE_DEAD] = "dead",
[SERVICE_START_PRE] = "start-pre",
@@ -2821,6 +2832,8 @@ const UnitVTable service_vtable = {
.sigchld_event = service_sigchld_event,
.timer_event = service_timer_event,
+ .reset_maintenance = service_reset_maintenance,
+
.cgroup_notify_empty = service_cgroup_notify_event,
.notify_message = service_notify_message,