summaryrefslogtreecommitdiff
blob: 59632972d1bec82f5fb8dd58c77fad4bf1d2290c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/sbin/openrc-run
# Copyright 2016-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

description="Prometheus ceph metrics exporter"
pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
user=${user:-ceph}
group=${group:-ceph}

command="/usr/bin/ceph_exporter"
command_background="true"
output_log="/var/log/ceph_exporter/${RC_SVCNAME}.log"
error_log="/var/log/ceph_exporter/${RC_SVCNAME}.log"
start_stop_daemon_args="--user ${user} --group ${group}"

depend() {
	after net
}

start_pre() {
	if [ ! -f "/etc/ceph/ceph.${user}.keyring" ]; then
		eerror "keyring not found, exporter won't be able to connect to the cluster!"
		exit 1
	fi
}