Use custom grafana.service file with Restart=always defined

Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
Rick Elrod 2015-06-25 00:37:11 +00:00
parent c42c633c00
commit a5b4bd2d01
3 changed files with 37 additions and 0 deletions

View 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

View file

@ -0,0 +1,3 @@
---
- name: restart grafana
service: name=grafana-server state=restarted

View file

@ -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