diff options
-rw-r--r-- | netdata.spec.in | 1 | ||||
-rw-r--r-- | src/Makefile.am | 19 |
2 files changed, 12 insertions, 8 deletions
diff --git a/netdata.spec.in b/netdata.spec.in index af73a7b6d0..2aef64275f 100644 --- a/netdata.spec.in +++ b/netdata.spec.in @@ -45,7 +45,6 @@ make %{?_smp_mflags} install DESTDIR="%{buildroot}" find "%{buildroot}" -name .keep -exec rm {} \; %files -%attr(4755, root, root) %{_libexecdir}/%{name}/plugins.d/apps.plugin %attr(-, netdata, netdata) %dir %{_localstatedir}/cache/%{name}/ %attr(-, netdata, netdata) %dir %{_localstatedir}/log/%{name}/ %{_bindir}/%{name} diff --git a/src/Makefile.am b/src/Makefile.am index dde90145e4..1d87d5be77 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -73,10 +73,15 @@ apps_plugin_SOURCES = \ procfile.c procfile.h \ $(NULL) -install-data-hook: - @echo - @echo "ATTENTION" - @echo - @echo "setuid bit of $(pluginsdir)/apps.plugin must be set, please execute as root:" - @echo "chown root '$(pluginsdir)/apps.plugin' && chmod 4755 '$(pluginsdir)/apps.plugin'" - @echo +install-exec-hook: + if [ `id -u` == 0 ]; then \ + chown root '$(DESTDIR)$(pluginsdir)/apps.plugin' && \ + chmod 4755 '$(DESTDIR)$(pluginsdir)/apps.plugin'; \ + else \ + echo; \ + echo "ATTENTION"; \ + echo; \ + echo "setuid bit of $(pluginsdir)/apps.plugin must be set, please execute as root:"; \ + echo "chown root '$(pluginsdir)/apps.plugin' && chmod 4755 '$(pluginsdir)/apps.plugin'"; \ + echo; \ + fi |