sdutil 0.1.1

Helpers for communicate with systemd


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

SystemD util

Minimal dynamic bindings for libsystemd.so:

  • int sd_notify(int unset_environment, const char* state)
  • int sd_pid_notify(pid_t pid, int unset_environment, const char *state)
  • int sd_journal_print(int priority, const char* fmt, ...)
  • int sd_journal_send(const char* fmt, ...)
  • int sd_journal_perror(const char *message)

with minimal wraps:

  • int sdNotify(int unset_environment, string state)
  • int sdNotify_ready(int unset_environment=0) @nogc send state="READY=1"
  • int sdNotify_reloading(int unset_environment=0) @nogc send state="RELOADING=1"
  • int sdNotify_stopping(int unset_environment=0) @nogc send state="STOPPING=1"
  • int sdNotify_watchdog(int unset_environment=0) @nogc send state="WATCHDOG=1"
  • int sdPidNotify(pid_t pid, int unset_environment, string state)
  • int sdNotifyf(Args...)(int unset_environment, string fmt, Args args) with D format
  • int sdPidNotifyf(Args...)(pid_t pid, int unset_environment, string fmt, Args args) with D format

and 2 std.experimental.logger.Logger implementations:

  • SDSimpleLogger not use libsystemd, only specific format output to stderr
  • SDJournalLogger use sd_journal_print in writeLogMsg and call initSystemDLib in ctor

See example

Authors:
  • deviator
Dependencies:
ssll
Versions:
0.1.1 2019-May-08
0.1.0 2019-May-05
~master 2019-May-08
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 6 downloads this week

  • 103 downloads this month

  • 169 downloads total

Score:
1.6
Short URL:
sdutil.dub.pm