summaryrefslogtreecommitdiff
path: root/src/socket.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/socket.c
parentb9975629f03a43d4c6b14fdb42eb8dd5a30af28f (diff)
systemctl: introduce reset-maintenance command
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/socket.c b/src/socket.c
index 4cf21cf0b1..2c9d693918 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -1698,6 +1698,17 @@ void socket_connection_unref(Socket *s) {
log_debug("%s: One connection closed, %u left.", s->meta.id, s->n_connections);
}
+static void socket_reset_maintenance(Unit *u) {
+ Socket *s = SOCKET(u);
+
+ assert(s);
+
+ if (s->state == SOCKET_MAINTENANCE)
+ socket_set_state(s, SOCKET_DEAD);
+
+ s->failure = false;
+}
+
static const char* const socket_state_table[_SOCKET_STATE_MAX] = {
[SOCKET_DEAD] = "dead",
[SOCKET_START_PRE] = "start-pre",
@@ -1750,5 +1761,7 @@ const UnitVTable socket_vtable = {
.sigchld_event = socket_sigchld_event,
.timer_event = socket_timer_event,
+ .reset_maintenance = socket_reset_maintenance,
+
.bus_message_handler = bus_socket_message_handler
};