Skip to content

Commit 0d03639

Browse files
authored
CA-418759: Failed to start attach-static-vdis (#6722)
Xapi still uses `/sbin/service` to start `attach-static-vdis` when boots up for HA. It will fail in XS 9 as `/sbin/service` has been removed in XS 9. Replace it with `systemctl`.
2 parents 7fcaaef + bcc7709 commit 0d03639

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

ocaml/xapi/static_vdis.ml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,14 @@ let gc () =
114114
(list ())
115115
)
116116

117-
(** If we just rebooted and failed to attach our static VDIs then this can be called to reattempt the attach:
118-
this is necessary for HA to start. *)
117+
(** If we just rebooted and failed to attach our static VDIs then this can be
118+
called to reattempt the attach: this is necessary for HA to start. *)
119119
let reattempt_on_boot_attach () =
120-
debug "%s" __FUNCTION__ ;
121-
let script = "attach-static-vdis" in
122-
try ignore (Helpers.call_script "/sbin/service" [script; "start"])
120+
debug "%s: Attempt to reattach static VDIs" __FUNCTION__ ;
121+
let service = "attach-static-vdis.service" in
122+
try Xapi_systemctl.start ~wait_until_success:false service
123123
with e ->
124-
warn "Attempt to reattach static VDIs via '%s start' failed: %s" script
124+
warn
125+
"%s: Attempt to reattach static VDIs via 'systemctl start %s' failed: %s"
126+
__FUNCTION__ service
125127
(ExnHelper.string_of_exn e)

0 commit comments

Comments
 (0)