Commit 48a051c
committed
ssh-agent: exit 0 from SIGTERM under systemd socket-activation
When the ssh-agent service is configured to be launched under systemd
socket-activation, the user can inspect the status of the agent with
something like:
systemctl --user status ssh-agent.service
If the user does:
systemctl --user stop ssh-agent.service
it causes the `systemd --user` supervisor to send a SIGTERM to the
agent, which terminates while leaving the systemd-managed socket in
place. That's good, and as expected. (If the user wants to close the
socket, they can do "systemctl --user stop ssh-agent.socket" instead)
But because ssh-agent exits with code 2 in response to a SIGTERM, the
supervisor marks the service as "failed", even though the state of the
supervised service is exactly the same as during session startup (not
running, ready to launch when a client connects to the socket).
This change makes ssh-agent exit cleanly (code 0) in response to a
SIGTERM when launched under socket activation. This aligns the systemd
supervisor's understanding of the state of supervised ssh-agent with
reality.
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>1 parent 849c2fd commit 48a051c
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2238 | 2238 | | |
2239 | 2239 | | |
2240 | 2240 | | |
| 2241 | + | |
2241 | 2242 | | |
2242 | 2243 | | |
2243 | 2244 | | |
| |||
2389 | 2390 | | |
2390 | 2391 | | |
2391 | 2392 | | |
| 2393 | + | |
2392 | 2394 | | |
2393 | 2395 | | |
2394 | 2396 | | |
| |||
2522 | 2524 | | |
2523 | 2525 | | |
2524 | 2526 | | |
2525 | | - | |
| 2527 | + | |
2526 | 2528 | | |
2527 | 2529 | | |
2528 | 2530 | | |
| |||
0 commit comments