[Unit]
Description=Grafana instance
Documentation=http://docs.grafana.org
Wants=network-online.target
After=network-online.target

[Service]
EnvironmentFile=/etc/sysconfig/grafana-server
User=grafana
Group=grafana
Type=notify
Restart=on-failure
WorkingDirectory=/usr/share/grafana
RuntimeDirectory=grafana
RuntimeDirectoryMode=0750
ExecStart=/usr/sbin/grafana server                                  \
	    --homepath=${GRAFANA_HOME}                              \
	    --config=${CONF_FILE}                                   \
	    --pidfile=${PID_FILE_DIR}/grafana-server.pid            \
	    --packaging=rpm                                         \
	    cfg:default.paths.logs=${LOG_DIR}                       \
	    cfg:default.paths.data=${DATA_DIR}                      \
	    cfg:default.paths.plugins=${PLUGINS_DIR}                \
	    cfg:default.paths.provisioning=${PROVISIONING_CFG_DIR}

UMask=0027

[Install]
WantedBy=multi-user.target
