job: Don't discard propagated restart jobs when unit is activating
When a service unit Requires= a socket, and the socket is restarted while the service is in state=activating, the propagated restart is being discarded. This is contrary to the documentation for Requires=, which states "this unit will be stopped (or restarted) if one of the other units is explicitly stopped (or restarted)".
This commit is contained in:
@@ -50,6 +50,15 @@ systemctl stop hello.service sleep.service hello-after-sleep.target
|
||||
|
||||
# TODO: add more job queueing/merging tests here.
|
||||
|
||||
# Test that restart propagates to activating units
|
||||
systemctl -T --no-block start always-activating.service
|
||||
systemctl list-jobs | grep 'always-activating.service'
|
||||
ACTIVATING_ID_PRE=$(systemctl show -P InvocationID always-activating.service)
|
||||
systemctl -T start always-activating.socket # Wait for the socket to come up
|
||||
systemctl -T restart always-activating.socket
|
||||
ACTIVATING_ID_POST=$(systemctl show -P InvocationID always-activating.service)
|
||||
[ "$ACTIVATING_ID_PRE" != "$ACTIVATING_ID_POST" ] || exit 1
|
||||
|
||||
# Test for irreversible jobs
|
||||
systemctl start unstoppable.service
|
||||
|
||||
|
||||
Reference in New Issue
Block a user