From e20ba9402546d222edd86311af1338e5abb0c267 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Fri, 10 Feb 2023 18:59:17 +0900 Subject: [PATCH] Deploy `systemd` config for `exporter_proxy`. --- cookbooks/prometheus-exporters/exporter_proxy.rb | 8 +++----- .../files/etc/systemd/system/exporter_proxy.service | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 cookbooks/prometheus-exporters/files/etc/systemd/system/exporter_proxy.service diff --git a/cookbooks/prometheus-exporters/exporter_proxy.rb b/cookbooks/prometheus-exporters/exporter_proxy.rb index 55ffca2..515ad71 100644 --- a/cookbooks/prometheus-exporters/exporter_proxy.rb +++ b/cookbooks/prometheus-exporters/exporter_proxy.rb @@ -28,17 +28,15 @@ remote_file "#{CONFDIR}#{CONF}" do mode '644' end -remote_file '/etc/supervisor/conf.d/exporter_proxy.conf' do +remote_file '/etc/systemd/system/exporter_proxy.service' do user 'root' group 'root' mode '644' - - notifies :restart, 'service[supervisor]' end -service 'supervisor' do - action :nothing +service 'exporter_proxy' do + action [:enable, :start] end # Firewall settings here: diff --git a/cookbooks/prometheus-exporters/files/etc/systemd/system/exporter_proxy.service b/cookbooks/prometheus-exporters/files/etc/systemd/system/exporter_proxy.service new file mode 100644 index 0000000..1fc3c77 --- /dev/null +++ b/cookbooks/prometheus-exporters/files/etc/systemd/system/exporter_proxy.service @@ -0,0 +1,11 @@ +[Unit] +Description=Exporter Proxy + +[Service] +User=root +Group=root +ExecStart=/usr/local/bin/exporter_proxy -config /etc/prometheus_exporters.d/exporter_proxy/config.yml + +[Install] +WantedBy=multi-user.target +