Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/federicoceratto/nim-sdnotify
systemd service notification client for Nim
https://github.com/federicoceratto/nim-sdnotify
nim sdnotify systemd watchdog
Last synced: 7 days ago
JSON representation
systemd service notification client for Nim
- Host: GitHub
- URL: https://github.com/federicoceratto/nim-sdnotify
- Owner: FedericoCeratto
- License: lgpl-3.0
- Created: 2016-12-25T15:12:37.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-22T22:16:14.000Z (about 8 years ago)
- Last Synced: 2025-01-05T20:42:23.109Z (27 days ago)
- Topics: nim, sdnotify, systemd, watchdog
- Language: Nimrod
- Size: 3.91 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
=== systemd service notification for Nim
Client for the systemd "sd_notify" protocol. Sends message to systemd to notify service startup, ping the watchdog and other events.
Installation:
[source,bash]
----
nimble install sdnotify
----Usage:
[source,nim]
----
import sdnotifylet sd = newSDNotify()
# Notify the application is ready
sd.notify_ready()# Set status
sd.send_msg("STATUS=Running as expected")# Notify of an error
sd.notify_errno(2)# Notify of a D-Bus error
sd.notify_buserror("org.freedesktop.DBus.Error.TimedOut")# Set main process PID
sd.notify_main_pid(1234)# Ping the watchdog
sd.ping_watchdog()# Set the watchdog timer to 1s
----Example systemd service file:
[source,ini]
----
[Unit]
Description=My service[Service]
ExecStart=/tmp/myservice
Restart=always
Type=notify
WatchdogSec=10s[Install]
WantedBy=multi-user.target
----