Ignore:
Timestamp:
Sep 13, 2006, 11:48:01 PM (18 years ago)
Author:
Bruno Cornec
Message:

Fix Bug #24

  • Introduce kill_anything_like_this as a function instead of define
  • Add an external variable ps_options whose value is empty in restore and auxww in archive
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/common/newt-specific.c

    r738 r792  
    128128    extern char *g_boot_mountpt;
    129129    extern char *g_mondo_home;
     130    extern char *ps_options;
    130131
    131132    extern void set_signals(int);
     
    340341    }
    341342
    342 
     343/**
     344 * Kill any process containing the string @p str surrounded by spaces in its commandline.
     345 */
     346void kill_anything_like_this(char *str) {
     347
     348char *tmp = NULL;
     349
     350asprintf(&tmp,"kill `ps %s | grep \"" %s "\" | awk '{print $1;}' | grep -vx \"\\?\"`", ps_options, str);
     351run_program_and_log_output(tmp, TRUE);
     352paranoid_free(tmp);
     353}
    343354
    344355
Note: See TracChangeset for help on using the changeset viewer.