-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CP-49775 convert SMGC to systemd 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". Signed-off-by: Tim Smith <[email protected]>
- Loading branch information
Tim Smith
committed
Jun 14, 2024
1 parent
2b6bac9
commit 1b905ac
Showing
6 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -167,6 +167,8 @@ install: precheck | |
$(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) | ||
install -m 644 systemd/sr_health_check.timer \ | ||
$(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) | ||
install -m 644 systemd/[email protected] \ | ||
$(SM_STAGING)/$(SYSTEMD_SERVICE_DIR) | ||
for i in $(UDEV_RULES); do \ | ||
install -m 644 udev/$$i.rules \ | ||
$(SM_STAGING)$(UDEV_RULES_DIR); done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,6 +212,7 @@ tests/run_python_unittests.sh | |
%{_unitdir}/usb-scan.socket | ||
%{_unitdir}/mpathcount.service | ||
%{_unitdir}/mpathcount.socket | ||
%{_unitdir}/[email protected] | ||
%config /etc/udev/rules.d/65-multipath.rules | ||
%config /etc/udev/rules.d/55-xs-mpath-scsidev.rules | ||
%config /etc/udev/rules.d/58-xapi.rules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Garbage Collector for SR %I | ||
DefaultDependencies=no | ||
|
||
[Service] | ||
Type=oneshot | ||
Restart=no | ||
ExecStart=/opt/xensource/sm/cleanup.py -g -u %I | ||
# This is the default, but just to make it clear we may run this | ||
# service multiple times. When running, it will show as "activating"; | ||
# when not running, it will show as "dead" | ||
RemainAfterExit=no |