]> arthur.barton.de Git - netdata.git/commitdiff
fix %post, %preun and %postun
authorJason Barnett <jason.w.barnett@gmail.com>
Thu, 28 Jul 2016 23:30:36 +0000 (19:30 -0400)
committerJason Barnett <jason.w.barnett@gmail.com>
Thu, 28 Jul 2016 23:30:36 +0000 (19:30 -0400)
netdata.spec.in

index 884aa3fcdbe1479015f6f53a68f9700334672920..f2307f6f82c626af2513c0f06dea49d811c094e7 100644 (file)
@@ -115,14 +115,27 @@ exit 0
 %post
 # Register the netdata service
 /sbin/chkconfig --add netdata
-# Start the netdata service
-/sbin/service netdata start
+# Only gets run on initial install (not upgrades or uninstalls)
+if [ $1 = 1 ]; then
+        # Start the netdata service
+        /sbin/service netdata start
+fi
+exit 0
 
 %preun
+# Only gets run on uninstall (not upgrades)
 if [ $1 = 0 ]; then
         /sbin/service netdata stop > /dev/null 2>&1
         /sbin/chkconfig --del netdata
 fi
+exit 0
+
+%postun
+# Only gets run on upgrade (not uninstalls)
+if [ $1 != 0 ]; then
+        /sbin/service netdata condrestart 2>&1 > /dev/null
+fi
+exit 0
 %endif
 
 %clean