-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloki_exporter.init
29 lines (24 loc) · 988 Bytes
/
loki_exporter.init
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
26
27
28
29
#!/bin/sh /etc/rc.common
# delayed start to ensure network and NTP services go first
START=99
# stop before stopping network
STOP=89
USE_PROCD=1
NAME=loki_exporter
PROG=/usr/bin/loki_exporter
BOOT=0
start_service() {
local loki_push_url=$(uci -q get loki_exporter.@loki_exporter[0].loki_push_url)
local loki_auth_header=$(uci -q get loki_exporter.@loki_exporter[0].loki_auth_header)
local start_delay_on_boot=$(uci -q get loki_exporter.@loki_exporter[0].start_delay_on_boot)
local skewed_timestamps_delta_threshold=$(uci -q get loki_exporter.@loki_exporter[0].skewed_timestamps_delta_threshold)
procd_open_instance
procd_set_param command "$PROG"
procd_set_param env BOOT="${BOOT}" LOGREAD="/sbin/logread" LOKI_PUSH_URL="${loki_push_url}" LOKI_AUTH_HEADER="${loki_auth_header}" START_DELAY_ON_BOOT="${start_delay_on_boot}" SKEWED_TIMESTAMP_DELTA_THRESHOLD="${skewed_timestamps_delta_threshold}"
procd_set_param stderr 1
procd_close_instance
}
boot() {
BOOT=1
start "$@"
}