Skip to content

Commit

Permalink
Fix for apache group detection: don't match ps lines with 'tomcat'
Browse files Browse the repository at this point in the history
  • Loading branch information
spyysalo committed Sep 20, 2012
1 parent c25b74d commit 923c09d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apache-group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Script for determining the (likely) apache group

apache_user=`ps aux | grep '[a]pache\|[h]ttpd' | cut -d ' ' -f 1 | grep -v '^root$' | head -n 1`
apache_user=`ps aux | grep -v 'tomcat' | grep '[a]pache\|[h]ttpd' | cut -d ' ' -f 1 | grep -v '^root$' | head -n 1`
apache_group=`groups $apache_user | head -n 1 | sed 's/ .*//'`

echo $apache_group
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mkdir -p $data_dir_abs

# Try to determine apache group

apache_user=`ps aux | grep '[a]pache\|[h]ttpd' | cut -d ' ' -f 1 | grep -v '^root$' | head -n 1`
apache_user=`ps aux | grep -v 'tomcat' | grep '[a]pache\|[h]ttpd' | cut -d ' ' -f 1 | grep -v '^root$' | head -n 1`
apache_group=`groups $apache_user | head -n 1 | sed 's/ .*//'`

# Place some example data
Expand Down

0 comments on commit 923c09d

Please sign in to comment.