Browse Source

Fixed issue in rpm init.d script

Torkel Ödegaard 10 years ago
parent
commit
d4e6ae2804
1 changed files with 6 additions and 2 deletions
  1. 6 2
      packaging/rpm/init.d/grafana-server

+ 6 - 2
packaging/rpm/init.d/grafana-server

@@ -82,13 +82,14 @@ case "$1" in
 
 
     # Start Daemon
     # Start Daemon
     cd $GRAFANA_HOME
     cd $GRAFANA_HOME
-    su -s /bin/sh -c "nohup ${DAEMON} ${DAEMON_OPTS} >> /dev/null 3>&1 &" $DAEMON_USER
+    su -s /bin/sh -c "nohup ${DAEMON} ${DAEMON_OPTS} >> /dev/null 3>&1 &" $GRAFANA_USER
     return=$?
     return=$?
     if [ $return -eq 0 ]
     if [ $return -eq 0 ]
     then
     then
       sleep 1
       sleep 1
       # check if pid file has been written two
       # check if pid file has been written two
       if ! [[ -s $PID_FILE ]]; then
       if ! [[ -s $PID_FILE ]]; then
+        echo "FAILED"
         exit 3
         exit 3
       fi
       fi
       i=0
       i=0
@@ -98,7 +99,10 @@ case "$1" in
       do
       do
         sleep 1
         sleep 1
         i=$(($i + 1))
         i=$(($i + 1))
-        [ $i -gt $timeout ] && exit 4
+        if [ $i -gt $timeout ]; then
+          echo "FAILED"
+          exit 4
+        fi
       done
       done
     fi
     fi