-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CP-49775 convert SMGC to systemd service #692
CP-49775 convert SMGC to systemd service #692
Conversation
578b389
to
0134203
Compare
2f4c150
to
1b905ac
Compare
Add a templated oneshot service and use systemctl to start it. The systemctl command is invoked with "--no-wait" so that it returns immediately because the "oneshot" nature of the service would otherwise wait until the command completes. Note that because the service is a oneshot with RemainAfterExit=no (so we can multiply start it), it will go from "activating" to "dead" without ever appearing to be "running". Signed-off-by: Tim Smith <[email protected]>
1b905ac
to
ba43133
Compare
state = result.stdout.decode('utf-8').rstrip() | ||
if state == "activating" or state == "running": | ||
return True | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, do we need to consider the case where systemd
is not being used? I'm inclined to say not as I think all consumers of this code are now using systemd
@@ -3206,6 +3206,10 @@ def gc(session, srUuid, inBackground, dryRun=False): | |||
|
|||
|
|||
def start_gc(session, sr_uuid): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this code being retained? I don't see any callers, and the implementation of get_state implies that we only expect the systemd version to be called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly to make it easy for someone who wants to revert to a non-systemd method of doing things to do so
(yes, they'd have to reimplement get-state but the original method of doing so has lock-ordering issues, so leaving it would not have been a service)
Add a templated oneshot service and use systemctl to start it. The systemctl command is invoked with "--no-wait" so that it returns immediately because the "oneshot" nature of the service would otherwise wait until the command completes.
Note that because the service is a oneshot with RemainAfterExit=no (so we can multiply start it), it will go from "activating" to "dead" without ever appearing to be "running".