diff --git a/Gemfile b/Gemfile index 96aa959..1572c41 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,7 @@ source 'https://rubygems.org' gem 'ruby-lxc', git: 'https://git.denkn.at/deac/ruby-lxc' gem 'prometheus-client' -gem 'puma' gem 'rack' +gem 'puma' +gem 'sd_notify' gem 'cbor' diff --git a/lxc-exporter.service.erb b/lxc-exporter.service.erb new file mode 100644 index 0000000..e0fdada --- /dev/null +++ b/lxc-exporter.service.erb @@ -0,0 +1,17 @@ +[Unit] +Description=Prometheus lxc-exporter for getting container health +Documentation=https://git.denkn.at/deac/lxc-exporter +After=network-online.target + +[Service] +Type=notify +KillMode=mixed +WatchdogSec=10 +Restart=always +User=prometheus +WorkingDirectory=<%= Dir.pwd %> +ExecStart=<%= `which bundle`.chomp %> exec puma -b tcp://[::]:9124 -e production --tag lxc-exporter +ExecReload=/bin/kill -USR1 $MAINPID + +[Install] +WantedBy=multi-user.target