From 5632e3743db350a67478acc107d76cdf648a1f99 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 18 Jul 2010 04:58:01 +0200 Subject: systemctl: introduce reset-maintenance command --- src/socket.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/socket.c') 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 }; -- cgit v1.2.3-54-g00ecf