[alsa-devel] [PATCH] alsa-info: Use pgrep with -f for matching against the process' cmdline.

Ozan Çağlayan ozan at pardus.org.tr
Mon Jan 19 13:52:30 CET 2009


Latest alsa-info.sh has a sound daemon detection snippet which uses pgrep to find
out if any sound daemon is loaded or not. The full paths to the binaries are
given to pgrep but pgrep matches its first parameter against the "process name"
by default.

Call pgrep with -f to match against the process' command line to fix the detection
code.

Signed-off-by: Ozan Çağlayan <ozan at pardus.org.tr>
---
 utils/alsa-info.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/utils/alsa-info.sh b/utils/alsa-info.sh
index 1be147f..be10362 100755
--- a/utils/alsa-info.sh
+++ b/utils/alsa-info.sh
@@ -375,21 +375,21 @@ echo "!!Sound Servers on this system" >> $FILE
 echo "!!----------------------------" >> $FILE
 echo "" >> $FILE
 if [[ -n $PAINST ]];then
-[[ `pgrep $PAINST` ]] && PARUNNING="Yes" || PARUNNING="No"
+[[ `pgrep -f $PAINST` ]] && PARUNNING="Yes" || PARUNNING="No"
 echo "Pulseaudio:" >> $FILE
 echo "      Installed - Yes ($PAINST)" >> $FILE
 echo "      Running - $PARUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $ESDINST ]];then
-[[ `pgrep $ESDINST` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
+[[ `pgrep -f $ESDINST` ]] && ESDRUNNING="Yes" || ESDRUNNING="No"
 echo "ESound Daemon:" >> $FILE
 echo "      Installed - Yes ($ESDINST)" >> $FILE
 echo "      Running - $ESDRUNNING" >> $FILE
 echo "" >> $FILE
 fi
 if [[ -n $ARTSINST ]];then
-[[ `pgrep $ARTSINST` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
+[[ `pgrep -f $ARTSINST` ]] && ARTSRUNNING="Yes" || ARTSRUNNING="No"
 echo "aRts:" >> $FILE
 echo "      Installed - Yes ($ARTSINST)" >> $FILE
 echo "      Running - $ARTSRUNNING" >> $FILE
-- 
1.6.1



More information about the Alsa-devel mailing list