diff --git a/dune-project b/dune-project index 47242645809..87ebda7a964 100644 --- a/dune-project +++ b/dune-project @@ -181,7 +181,6 @@ mtime ppx_deriving_rpc rpclib - systemd (ezxenstore (= :version)) (uuid (= :version)) xapi-backtrace diff --git a/ocaml/forkexecd/src/dune b/ocaml/forkexecd/src/dune index 27555180e97..77c396de6bd 100644 --- a/ocaml/forkexecd/src/dune +++ b/ocaml/forkexecd/src/dune @@ -5,7 +5,6 @@ astring fd-send-recv forkexec - systemd uuid xapi-log xapi-stdext-unix diff --git a/ocaml/forkexecd/src/fe_main.ml b/ocaml/forkexecd/src/fe_main.ml index f691aedf246..26701335a7d 100644 --- a/ocaml/forkexecd/src/fe_main.ml +++ b/ocaml/forkexecd/src/fe_main.ml @@ -46,8 +46,6 @@ let setup sock cmdargs id_to_fd_map syslog_stdout redirect_stderr_to_stdout env Some {Fe.fd_sock_path} ) -let systemd_managed () = try Daemon.booted () with Unix.Unix_error _ -> false - let _ = Sys.set_signal Sys.sigpipe Sys.Signal_ignore ; @@ -63,8 +61,12 @@ let _ = in Xapi_stdext_unix.Unixext.mkdir_rec Forkhelpers.temp_dir_server 0o755 ; - if systemd_managed () then - Daemon.notify Daemon.State.Ready |> ignore ; + let module Daemon = Xapi_stdext_unix.Unixext.Daemon in + if Daemon.systemd_booted () then + if Daemon.systemd_notify Daemon.State.Ready then + () + else + warn "Sending systemd notification failed at %s" __LOC__ ; (* At this point the init.d script should return and we are listening on our socket. *) while true do diff --git a/ocaml/networkd/bin/dune b/ocaml/networkd/bin/dune index fd105560611..7f154a0db5c 100644 --- a/ocaml/networkd/bin/dune +++ b/ocaml/networkd/bin/dune @@ -26,7 +26,6 @@ rpclib.json result rresult - systemd threads.posix xapi-client xapi-consts diff --git a/ocaml/networkd/bin/networkd.ml b/ocaml/networkd/bin/networkd.ml index e36113580db..74209fd7867 100644 --- a/ocaml/networkd/bin/networkd.ml +++ b/ocaml/networkd/bin/networkd.ml @@ -233,7 +233,11 @@ let () = Debug.with_thread_associated "main" start server ) () ; - ignore (Daemon.notify Daemon.State.Ready) ; + let module Daemon = Xapi_stdext_unix.Unixext.Daemon in + if Daemon.systemd_notify Daemon.State.Ready then + () + else + D.warn "Sending systemd notification failed at %s" __LOC__ ; while true do Thread.delay 300. ; Network_server.on_timer () done diff --git a/ocaml/networkd/lib/dune b/ocaml/networkd/lib/dune index 6ab41259703..eb2f2de53cd 100644 --- a/ocaml/networkd/lib/dune +++ b/ocaml/networkd/lib/dune @@ -11,7 +11,6 @@ rpclib.core rpclib.json rresult - systemd threads.posix uri xapi-stdext-pervasives diff --git a/ocaml/xcp-rrdd/bin/rrdd/dune b/ocaml/xcp-rrdd/bin/rrdd/dune index c38e712f74b..6450c363847 100644 --- a/ocaml/xcp-rrdd/bin/rrdd/dune +++ b/ocaml/xcp-rrdd/bin/rrdd/dune @@ -17,7 +17,6 @@ rrd-transport rrd-transport.lib stunnel - systemd threads.posix uuid xapi-backtrace @@ -55,7 +54,6 @@ rpclib.xml rrdd_libs_internal rrd-transport - systemd threads.posix uuid xapi-backtrace diff --git a/ocaml/xcp-rrdd/bin/rrdd/xcp_rrdd.ml b/ocaml/xcp-rrdd/bin/rrdd/xcp_rrdd.ml index faa2c7f0076..fede0f4b0d7 100644 --- a/ocaml/xcp-rrdd/bin/rrdd/xcp_rrdd.ml +++ b/ocaml/xcp-rrdd/bin/rrdd/xcp_rrdd.ml @@ -1133,7 +1133,12 @@ let _ = try Watcher.create_watcher_thread () with _ -> error "xenstore-watching thread has failed" in - ignore (Daemon.notify Daemon.State.Ready) ; + let module Daemon = Xapi_stdext_unix.Unixext.Daemon in + if Daemon.systemd_booted () then + if Daemon.systemd_notify Daemon.State.Ready then + () + else + warn "Sending systemd notification failed at %s" __LOC__ ; debug "Creating monitoring loop thread .." ; let () = try Debug.with_thread_associated "main" monitor_write_loop writers diff --git a/xapi-rrdd.opam b/xapi-rrdd.opam index 1d46ca776da..0782309fe06 100644 --- a/xapi-rrdd.opam +++ b/xapi-rrdd.opam @@ -21,7 +21,6 @@ depends: [ "mtime" "ppx_deriving_rpc" "rpclib" - "systemd" "ezxenstore" {= version} "uuid" {= version} "xapi-backtrace"