diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2016-07-29 13:15:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-29 13:15:10 +0300 |
commit | 8036b86cbc12648f777a2e80b11c5c9799e3be8e (patch) | |
tree | 7ec354e4212e969b211e9daed1471f39555a2396 /netdata.spec.in | |
parent | ee4de7bd2b88b824a40339477bdacb4e465e7afa (diff) | |
parent | e46b07d8ac3e3a595052eff9ac59e1dc1299452c (diff) |
Merge pull request #741 from jasonwbarnett/bugfix/fix-postin-failure
fix %post, %preun and %postun
Diffstat (limited to 'netdata.spec.in')
-rw-r--r-- | netdata.spec.in | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/netdata.spec.in b/netdata.spec.in index 884aa3fcdb..f2307f6f82 100644 --- a/netdata.spec.in +++ b/netdata.spec.in @@ -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 |