From 753ae366ec49bf4367fb619bf5f80df8c660f528 Mon Sep 17 00:00:00 2001 From: Jens Elkner Date: Wed, 26 Jan 2022 00:47:56 +0100 Subject: [PATCH] add service config files for Linux and Solaris --- etc/ipmimex.defaults | 18 ++++++++ etc/ipmimex.manifest | 103 +++++++++++++++++++++++++++++++++++++++++++ etc/ipmimex.service | 35 +++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 etc/ipmimex.defaults create mode 100644 etc/ipmimex.manifest create mode 100644 etc/ipmimex.service diff --git a/etc/ipmimex.defaults b/etc/ipmimex.defaults new file mode 100644 index 0000000..3df1214 --- /dev/null +++ b/etc/ipmimex.defaults @@ -0,0 +1,18 @@ +# file: /etc/default/ipmimex + +# Any options to pass verbatim to the exporter. See 'ipmimex -h'. +ARGS="-c " + +# For buggy DELLs: +#ARGS="-c D" + +# For SUN ILOMs: +#ARGS="-c N" + +# Compact as possible. Readings, only: +#ARGS="-c PoDNUT" + +# Just Power now and overall scrapetime: +#ARGS='-c -n version,ipmi,process -PS' + +# Check operational state e.g. via http://localhost:9290/metrics diff --git a/etc/ipmimex.manifest b/etc/ipmimex.manifest new file mode 100644 index 0000000..3916a8d --- /dev/null +++ b/etc/ipmimex.manifest @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/etc/ipmimex.service b/etc/ipmimex.service new file mode 100644 index 0000000..85fbc7c --- /dev/null +++ b/etc/ipmimex.service @@ -0,0 +1,35 @@ +# file: /lib/systemd/system/ipmimex.service + +[Unit] +Description=Metrics exporter for IPMI driven BMCs +Documentation=man:ipmimex(8) +After=network.target auditd.service +Before=vmagent.service + +[Service] +Type=forking +User=daemon +Group=daemon +# The 'control-group' mode is absolutely unreliable at least on ubuntu 20.04. +# So e.g. on start timeout spawned threads would not be killed and restart +# would fail because the address/port is already in use. +KillMode=mixed + +EnvironmentFile=-/etc/default/ipmimex +LogsDirectory=ipmimex + +Restart=always +RestartSec=1 +RestartPreventExitStatus=1 95 96 97 98 99 100 101 102 +# This allows us to run ipmimex as unprivileged service. One could accomplish +# the same thing using a propper udev rule. +ExecStartPre=+-/bin/chown daemon /dev/ipmi0 +ExecStart=/usr/sbin/ipmimex -l %L/ipmimex/out.log -d $ARGS +ExecStop=/bin/kill -s SIGTERM $MAINPID +TimeoutSec=10 + +MemoryLow=2M +MemoryMin=1M + +[Install] +WantedBy=multi-user.target