]> arthur.barton.de Git - netdata.git/commitdiff
installer: attempt to use "service" even on non-systemd system, if the user has insta...
authorCosta Tsaousis <costa@tsaousis.gr>
Sun, 29 May 2016 20:30:53 +0000 (23:30 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Sun, 29 May 2016 20:30:53 +0000 (23:30 +0300)
netdata-installer.sh

index b5455776a6f979b90d7d6e60bf74ef4343a0e61b..64edab65b8bad80fe02dcda01003fc576e76fee3 100755 (executable)
@@ -594,9 +594,21 @@ then
        run service netdata start && running=1
 fi
 
+if [ ${running} -eq 0 -a "${UID}" -eq 0 ]
+then
+       service netdata status >/dev/null 2>&1
+       if [ $? -eq 0 ]
+       then
+               # nice guy, he installed netdata to his system
+               run service netdata stop
+               stop_all_netdata
+               run service netdata start && running=1
+       fi
+fi
+
 if [ ${running} -eq 0 ]
 then
-       # no systemd (or not running as root, or systemd failed)
+       # still not running...
 
        stop_all_netdata