diff --git a/bin/dune b/bin/dune index a9afd5f..36fb6f9 100644 --- a/bin/dune +++ b/bin/dune @@ -1,5 +1,5 @@ (executable - (public_name ocaml-systemd) + (public_name systemd-ml-test) (name main) (modes byte exe) - (libraries systemd systemd.xlog systemd.main eio_main fmt xlog)) + (libraries systemd-ml systemd-ml.xlog systemd-ml.main eio_main fmt xlog)) diff --git a/dune-project b/dune-project index 2098be2..dbdf588 100644 --- a/dune-project +++ b/dune-project @@ -1,18 +1,18 @@ (lang dune 3.15) -(name systemd) +(name systemd-ml) (version 0.0.1) (generate_opam_files true) (package - (name systemd) + (name systemd-ml) (synopsis "libsystemd-like functionality for native ocaml") (description "utilities for interacting with systemd when running as a service") (license "unfree") - (homepage "https://git.lain.faith/haskal/ocaml-systemd") + (homepage "https://git.lain.faith/haskal/systemd-ml") (authors "xenia ") - (source (uri "https://git.lain.faith/haskal/ocaml-systemd.git")) + (source (uri "https://git.lain.faith/haskal/systemd-ml.git")) (tags (meow)) diff --git a/lib/dune b/lib/dune index e924e9f..b7d0a8b 100644 --- a/lib/dune +++ b/lib/dune @@ -1,6 +1,6 @@ (library (name systemd) - (public_name systemd) + (public_name systemd-ml) (preprocess (pps ppx_unicode)) (libraries cstruct eio eio_linux unix) (foreign_stubs diff --git a/lib_main/dune b/lib_main/dune index dfbec41..b0e55a5 100644 --- a/lib_main/dune +++ b/lib_main/dune @@ -1,5 +1,5 @@ (library (name systemd_main) - (public_name systemd.main) + (public_name systemd-ml.main) (preprocess (pps ppx_unicode)) - (libraries eio eio_linux systemd systemd.xlog xlog)) + (libraries eio eio_linux systemd-ml systemd-ml.xlog xlog)) diff --git a/lib_main/systemd_main.ml b/lib_main/systemd_main.ml index bfd4a28..04441bb 100644 --- a/lib_main/systemd_main.ml +++ b/lib_main/systemd_main.ml @@ -1,6 +1,7 @@ let noop _env _ctx = () let run ?(min_level=Xlog.WARN) ?(init=noop) ?(ready_status=None) ?(reload=noop) ?(shutdown=noop) func = + if not (Systemd.is_in_systemd ()) then failwith "Not executing in systemd!"; Eio_linux.run @@ fun env -> Eio.Switch.run ~name:"main" @@ fun sw -> if Systemd.is_journald_attached () then diff --git a/lib_xlog/dune b/lib_xlog/dune index f46c612..a355698 100644 --- a/lib_xlog/dune +++ b/lib_xlog/dune @@ -1,5 +1,5 @@ (library (name systemd_xlog) - (public_name systemd.xlog) + (public_name systemd-ml.xlog) (preprocess (pps ppx_unicode)) (libraries cstruct eio eio_linux unix xlog ptime)) diff --git a/systemd.opam b/systemd-ml.opam similarity index 86% rename from systemd.opam rename to systemd-ml.opam index c7b5bef..2882d6b 100644 --- a/systemd.opam +++ b/systemd-ml.opam @@ -7,7 +7,7 @@ description: authors: ["xenia "] license: "unfree" tags: ["meow"] -homepage: "https://git.lain.faith/haskal/ocaml-systemd" +homepage: "https://git.lain.faith/haskal/systemd-ml" depends: [ "ocaml" "dune" {>= "3.15"} @@ -35,4 +35,4 @@ build: [ "@doc" {with-doc} ] ] -dev-repo: "https://git.lain.faith/haskal/ocaml-systemd.git" +dev-repo: "https://git.lain.faith/haskal/systemd-ml.git"