Use custom grafana.service file with Restart=always defined
Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
parent
c42c633c00
commit
a5b4bd2d01
3 changed files with 37 additions and 0 deletions
23
roles/graphite/grafana/files/grafana.service
Normal file
23
roles/graphite/grafana/files/grafana.service
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Starts and stops a single grafana instance on this system
|
||||||
|
Documentation=http://docs.grafana.org
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
EnvironmentFile=/etc/sysconfig/grafana-server
|
||||||
|
User=grafana
|
||||||
|
Group=grafana
|
||||||
|
Type=simple
|
||||||
|
WorkingDirectory=/usr/share/grafana
|
||||||
|
ExecStart=/usr/sbin/grafana-server \
|
||||||
|
--config=${CONF_FILE} \
|
||||||
|
cfg:default.paths.logs=${LOG_DIR} \
|
||||||
|
cfg:default.paths.data=${DATA_DIR} \
|
||||||
|
LimitNOFILE=10000
|
||||||
|
TimeoutStopSec=20
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
3
roles/graphite/grafana/handlers/main.yml
Normal file
3
roles/graphite/grafana/handlers/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
- name: restart grafana
|
||||||
|
service: name=grafana-server state=restarted
|
|
@ -35,3 +35,14 @@
|
||||||
- restart apache
|
- restart apache
|
||||||
tags:
|
tags:
|
||||||
- grafana
|
- grafana
|
||||||
|
- config
|
||||||
|
|
||||||
|
- name: Install custom systemd service file
|
||||||
|
copy: >
|
||||||
|
src=grafana.service
|
||||||
|
dest=/usr/lib/systemd/system/grafana.service
|
||||||
|
tags:
|
||||||
|
- config
|
||||||
|
- grafana
|
||||||
|
notify:
|
||||||
|
- restart grafana
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue