From: Lennart Poettering Date: Wed, 24 Apr 2024 07:47:29 +0000 (+0200) Subject: socket: hookup handoff timestamps with processes forked off by socket units X-Git-Tag: v256-rc1~14^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f41b10ee06ba908658007f906f5e2693164af21;p=thirdparty%2Fsystemd.git socket: hookup handoff timestamps with processes forked off by socket units --- diff --git a/src/core/socket.c b/src/core/socket.c index 4c8428d1a9a..41147d4bf74 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -3378,6 +3378,22 @@ static void socket_trigger_notify(Unit *u, Unit *other) { socket_set_state(s, SOCKET_RUNNING); } +static void socket_handoff_timestamp( + Unit *u, + const struct ucred *ucred, + const dual_timestamp *ts) { + + Socket *s = ASSERT_PTR(SOCKET(u)); + + assert(ucred); + assert(ts); + + if (s->control_pid.pid == ucred->pid && s->control_command) { + exec_status_handoff(&s->control_command->exec_status, ucred, ts); + unit_add_to_dbus_queue(u); + } +} + static int socket_get_timeout(Unit *u, usec_t *timeout) { Socket *s = ASSERT_PTR(SOCKET(u)); usec_t t; @@ -3580,6 +3596,8 @@ const UnitVTable socket_vtable = { .reset_failed = socket_reset_failed, + .notify_handoff_timestamp = socket_handoff_timestamp, + .control_pid = socket_control_pid, .bus_set_property = bus_socket_set_property,