execute: send handoff timestamps from executor to service manager
authorLennart Poettering <lennart@poettering.net>
Tue, 23 Apr 2024 21:22:07 +0000 (23:22 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 25 Apr 2024 11:33:03 +0000 (13:33 +0200)
commit12001b1bf067339db089d52e08fd0b4c6a9945df
tree0bdceb55aa46f59c10b601d016274f0852b1515c
parent817062e6211e7559ff91bcb7bb5dc4e472fc1646
execute: send handoff timestamps from executor to service manager

This changes the executor to systematically send handoff timestamps to
the service manager if a socket for that is supplied. This drops the
code that did this via Type=exec messages, and reverts that part to the
old behaviour before 93cb78aee2cff8109a5a70128287732f03d7a062.

Benefits of this approach:

1. We can collect the handoff for any command we fork off, regardless
   if it's ExecStart= something else, regardless whether it's Type=exec,
   Type=simple or some any other service type, regardless of the unit
   type.

2. We collect both CLOCK_REALTIME and CLOCK_MONOTONIC, as we do for the
   other process timestamps.

3. It's entirely backwards compatible, as this doesn't change the
   protocol between service manager and executor, but just extends it.
src/core/exec-invoke.c
src/core/execute-serialize.c
src/core/execute.h
src/core/service.c
src/core/unit.c