|
|
||
|---|---|---|
| bin | ||
| lib | ||
| lib_main | ||
| lib_xlog | ||
| test | ||
| .gitignore | ||
| README.md | ||
| dune-project | ||
| package.nix | ||
| shell.nix | ||
| systemd-ml.opam | ||
README.md
systemd-ml
systemd-ml provides libsystemd-like functionality for interacting with the systemd service
manager, in self-contained ocaml code (with a bit of C). systemd-ml is integrated with eio,
which provides for use in eio-based daemons
Unfortunately, systemd-ml currently assumes usage of the eio_linux backend. It's hard to make
code backend-agnostic because not enough functionality around Unix domain sockets is exposed by the
high-level eio APIs, necessitating use of the low-level backend APIs. Therefore, it does not
currently work on eio_posix, though future support is possible. Support for eio_windows is not
planned, since there is no systemd port for windows.
Additionally, some functionality that would be useful for systemd integration is currently not possible without library patches. This currently includes functionality for responding to memory pressure events.
systemd-mlwith entry moduleSystemdis the main librarysystemd-ml.xlogwith entry moduleSystemd_xlogconfiguresxlogto send log messages to journaldsystemd-ml.mainwith entry moduleSystemd_mainprovdes a convenience functionSystemd_main.runwhich handles common boilerplate operations forType=notifyorType=notify-reloaddaemons withxlogoutput to journald
Also note that per the license field in the package info, this package is not currently open source. If you have questions about this you should contact me
Features
- detect systemd and journald presence
- rich journald output using
xlog - convenience functions to retrieve directories passed by systemd
- service notifications, with wrapper functions for common notification types
- fdstore functionality, and socket activation
- watchdog notifications
features that would be nice to have but unfortunately require patches (eio does not currently support polling for POLLPRI)