packaging: fixed issue with pid file on systemd systems, fixes #9133

This commit is contained in:
Torkel Ödegaard
2017-09-04 10:42:48 +02:00
parent ce6050f5d6
commit c3cffeb10c
8 changed files with 80 additions and 50 deletions

View File

@@ -6,6 +6,7 @@ set -e
IS_UPGRADE=false
case "$1" in
configure)
[ -z "$GRAFANA_USER" ] && GRAFANA_USER="grafana"
@@ -41,6 +42,12 @@ case "$1" in
IS_UPGRADE=true
fi
# make sure there is a /var/run/grafana dir on systemd systems
if [ -x /bin/systemctl ] ; then
mkdir -p $PID_FILE_DIR
chown -R $GRAFANA_USER:$GRAFANA_GROUP $PID_FILE_DIR
fi
if [ "x$IS_UPGRADE" != "xtrue" ]; then
if command -v systemctl >/dev/null; then
echo "### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd"