๐Ÿ“— Ansible playbooks and roles for building an idempotent, interconnected and scalable infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
947 B

2 years ago
#!/sbin/openrc-run
name="$SVCNAME"
directory="{{ prometheus_conf_dir }}"
command=/usr/bin/prometheus
command_args="--config.file=$prometheus_config_file \
--storage.tsdb.path=$prometheus_storage_path \
--storage.tsdb.retention.time=$prometheus_retention_time \
--web.listen-address={{ ('127.0.0.1:' ~ prometheus_port) | quote }} \
--web.page-title={{ ('Prometheus | ' ~ org) | quote }} \
--web.external-url={{ host_url | quote }}"
command_user="{{ prometheus_user }}:{{ prometheus_group }}"
extra_started_commands="reload"
pidfile="/var/run/$SVCNAME.pid"
command_background=true
start_stop_daemon_args="--stdout-logger logger --stderr-logger logger"
rc_ulimit="${prometheus_ulimit:--n 65536}"
depend() {
after net
}
start_pre() {
checkpath -d "$prometheus_storage_path" -o {{ prometheus_user }}:{{ prometheus_group }}
}
reload() {
ebegin "Reloading $RC_SVCNAME"
supervise-daemon $RC_SVCNAME --signal HUP
eend $?
}