]> arthur.barton.de Git - netdata.git/commitdiff
do not instruct user to set capabilities on systems that do not have capabilities
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 29 Jan 2017 19:20:23 +0000 (21:20 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 29 Jan 2017 19:20:23 +0000 (21:20 +0200)
src/apps_plugin.c

index 654056c0d5bfb24fd839f0736ab2d212f883e7a3..c17560c1910d75a5773ede2a1d560f83993b163b 100644 (file)
@@ -3138,12 +3138,21 @@ int main(int argc, char **argv) {
 
     if(!am_i_running_as_root())
         if(!check_capabilities())
+#ifdef HAVE_CAPABILITY
             error("apps.plugin should either run as root or have special capabilities. "
                           "Without these, apps.plugin cannot report disk I/O utilization of other processes. "
                           "To enable capabilities run: sudo setcap cap_dac_read_search,cap_sys_ptrace+ep %1$s; "
                           "To enable setuid to root run: sudo chown root %1$s; sudo chmod 4755 %1$s; "
                   , argv[0]
             );
+#else
+            error("apps.plugin should either run as root or have special capabilities. "
+                          "Without these, apps.plugin cannot report disk I/O utilization of other processes. "
+                          "Your system does not support capabilities. "
+                          "To enable setuid to root run: sudo chown root %1$s; sudo chmod 4755 %1$s; "
+                  , argv[0]
+            );
+#endif
 
     all_pids_sortlist = callocz(sizeof(pid_t), (size_t)pid_max);
     all_pids          = callocz(sizeof(struct pid_stat *), (size_t) pid_max);