18 lines
746 B
OCaml
18 lines
746 B
OCaml
include (val Xlog.logs __FUNCTION__)
|
|
|
|
open Eio.Std
|
|
|
|
let () = Systemd_main.run ~min_level:Xlog.DEBUG ~ready_status:(Some "meow meow") ~shutdown:(fun env _ctx -> Eio.Time.sleep env#clock 10.0) @@ fun env notify ->
|
|
let clock = Eio.Stdenv.clock env in
|
|
Switch.run @@ fun sw ->
|
|
info (fun m -> m "meow meow meow");
|
|
|
|
let fds = Systemd.Fdstore.listen_fds ~sw in
|
|
List.iter (fun (name, fd) -> Stdlib.Format.printf "got fd %a=%a\n%!" (Fmt.option ~none:(Fmt.any "<none>") Fmt.string) name Eio_unix.Fd.pp fd; Eio_linux.Low_level.writev fd [Cstruct.of_string "meow"]) fds;
|
|
|
|
info (fun m -> m "performing barrier");
|
|
Systemd.Notify.barrier notify;
|
|
info (fun m -> m "done");
|
|
Eio.Time.sleep clock 10.0;
|
|
info (fun m -> m "done 2")
|