VirtualBox

Changeset 50787 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 14, 2014 1:15:26 PM (11 years ago)
Author:
vboxsync
Message:

Installer/solaris: Use pgrep, it's been there since Solaris 8.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Installer/solaris/vboxconfig.sh

    r50519 r50787  
    4747BIN_ID=/usr/bin/id
    4848BIN_PKILL=/usr/bin/pkill
     49BIN_PGREP=/usr/bin/pgrep
    4950
    5051# "vboxdrv" is also used in sed lines here (change those as well if it ever changes)
     
    203204    if test ! -x "$BIN_PKILL"; then
    204205        BIN_PKILL=`find_bin_path "$BIN_PKILL"`
     206    fi
     207
     208    if test ! -x "$BIN_PGREP"; then
     209        BIN_PGREP=`find_bin_path "$BIN_PGREP"`
    205210    fi
    206211}
     
    837842    fi
    838843
    839     procname=$1
    840     procpid=`ps -eo pid,fname | grep $procname | grep -v grep | awk '{ print $1 }'`
    841     if test ! -z "$procpid" && test "$procpid" -ge 0; then
     844    procname="$1"
     845    $BIN_PGREP "$procname" > /dev/null 2>&1
     846    if test "$?" -eq 0; then
    842847        return 1
    843848    fi
     
    855860    fi
    856861
    857     # @todo use is_process_running()
    858     procname=$1
    859     procpid=`ps -eo pid,fname | grep $procname | grep -v grep | awk '{ print $1 }'`
    860     if test ! -z "$procpid" && test "$procpid" -ge 0; then
     862    procname="$1"
     863    is_process_running "$procname"
     864    if test "$?" -eq 1; then
    861865        $BIN_PKILL "$procname"
    862866        sleep 2
    863         procpid=`ps -eo pid,fname | grep $procname | grep -v grep | awk '{ print $1 }'`
    864         if test ! -z "$procpid" && test "$procpid" -ge 0; then
     867        is_process_running "$procname"
     868        if test "$?" -eq 1; then
    865869            subprint "Terminating: $procname  ...FAILED!"
    866870            if test "$fatal" = "$FATALOP"; then
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette