installer: attempt to use "service" even on non-systemd system, if the user has installed the files
Costa Tsaousis committed
May 29, 2016 at 23:30 UTC
8f74b1c1751386b3fa4b74d2d7efd90c2d17c5a6
1 file changed
+13
-1
netdata-installer.sh
+13
-1
@@ -594,9 +594,21 @@ then
594
run service netdata start && running=1
595
fi
596
597
+if [ ${running} -eq 0 -a "${UID}" -eq 0 ]
598
+then
599
+ service netdata status >/dev/null 2>&1
600
+ if [ $? -eq 0 ]
601
+ then
602
+ # nice guy, he installed netdata to his system
603
+ run service netdata stop
604
+ stop_all_netdata
605
+ run service netdata start && running=1
606
+ fi
607
+fi
608
+
609
if [ ${running} -eq 0 ]
610
then
599
- # no systemd (or not running as root, or systemd failed)
611
+ # still not running...
612
613
stop_all_netdata
614