sdnotify

command module
v0.0.0-...-96dafd1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 5 Imported by: 0

README

Simple wrapper to help include a statically linked binary into a docker container for use with the systemd watchdog/notify system.

The wrapper only supports three commands:

sdnotify watchdog sdnotify ready sdnotify

The final form sets a status message for the unit.

Note that this still needs support from systemd

[Unit]
Description=showing docker with systemd-notify support

[Service]
Type=notify
NotifyAccess=all
WatchdogSec=10
ExecStart=/usr/local/bin/dockersd %N notify_tester:latest

[Install]
WantedBy=default.target

Where dockersd in this case might look like

#!/bin/bash
# Internally the process must use some form of sd_notify(3) or
# systemd-notify(1) to signal the unit.
SD_NOTIFY_PROXY=/usr/libexec/sdnotify_proxy
SD_SOCK=/tmp/$1.sock

function sdproxy() {
    $SD_NOTIFY_PROXY $SD_SOCK /usr/bin/docker run --volume=$SD_SOCK:$SD_SOCK \
    --env=NOTIFY_SOCKET=$SD_SOCK --env=WATCHDOG_USEC=$WATCHDOG_USEC \
    $@
}

# Invoke the wrapper as 
# $ sdproxy %N dockerargs beyond "run"
sdproxy ${@:2}

All of which depends on sdnotify_proxy which can be found at https://github.com/coreos/sdnotify-proxy

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL