Changeset 928


Ignore:
Timestamp:
Nov 13, 2006, 10:17:07 AM (13 years ago)
Author:
bruno
Message:

ps (busybox) and ps (system) do not give PID in the same column. Adapted with a global variable.

Location:
branches/stable/mondo/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-fifo.c

    r797 r928  
    137137
    138138extern char *ps_options;
     139extern char *ps_proc_id;
    139140
    140141/**
     
    233234/**
    234235 * Kill @c buffer processes.
     236 * Only called in mondoarchive
    235237 */
    236238void kill_buffer()
     
    243245    paranoid_system("sync");
    244246    sprintf(command,
    245             "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $1;}' | grep -v PID | tr -s '\n' ' ' | awk '{ print $1; }'", ps_options,
     247            "ps %s | grep -F \"%s\" | grep -Fv grep | awk '{print $2;}' | grep -v PID | head -1", ps_options,
    246248            g_sz_call_to_buffer);
    247249    log_msg(2, "kill_buffer() --- command = %s", command);
  • branches/stable/mondo/src/common/newt-specific.c

    r883 r928  
    129129    extern char *g_mondo_home;
    130130    extern char *ps_options;
     131    extern char *ps_proc_id;
    131132
    132133    extern void set_signals(int);
     
    348349char *tmp = NULL;
    349350
    350 asprintf(&tmp,"kill `ps %s | grep \" %s \" | awk '{print $1;}' | grep -vx \"\\?\"`", ps_options, str);
     351asprintf(&tmp,"kill `ps %s | grep \" %s \" | awk '{print %s;}' | grep -vx \"\\?\"`", ps_options, str , ps_proc_id);
    351352run_program_and_log_output(tmp, TRUE);
    352353paranoid_free(tmp);
  • branches/stable/mondo/src/mondoarchive/main.c

    r814 r928  
    141141long diffs;
    142142char *ps_options = "auxww";
     143char *ps_proc_id = "$2";
    143144
    144145extern t_bkptype g_backup_media_type;
  • branches/stable/mondo/src/mondorestore/mondo-restore.c

    r912 r928  
    489489char *g_mondo_home;
    490490
     491/* Busybox ps has no option and PID in first pos */
    491492char *ps_options = "";
     493char *ps_proc_id = "$1";
    492494
    493495/* @} - end of "Restore-Time Globals" in globalGroup */
Note: See TracChangeset for help on using the changeset viewer.