Merge "Fix LDAP support for openSUSE"
diff --git a/lib/apache b/lib/apache
index a2b0534..d811f87 100644
--- a/lib/apache
+++ b/lib/apache
@@ -4,7 +4,6 @@
 # Dependencies:
 # ``functions`` file
 # is_apache_enabled_service
-# change_apache_user_group
 # install_apache_wsgi
 # config_apache_wsgi
 # start_apache_server
@@ -52,29 +51,6 @@
     return 1
 }
 
-# change_apache_user_group() - Change the User/Group to run Apache server
-function change_apache_user_group(){
-    local stack_user=$@
-    if is_ubuntu; then
-        sudo sed -e "
-            s/^export APACHE_RUN_USER=.*/export APACHE_RUN_USER=${stack_user}/g;
-            s/^export APACHE_RUN_GROUP=.*/export APACHE_RUN_GROUP=${stack_user}/g
-        " -i /etc/${APACHE_NAME}/envvars
-    elif is_fedora; then
-        sudo sed -e "
-            s/^User .*/User ${stack_user}/g;
-            s/^Group .*/Group ${stack_user}/g
-        " -i /etc/${APACHE_NAME}/httpd.conf
-    elif is_suse; then
-        sudo sed -e "
-            s/^User .*/User ${stack_user}/g;
-            s/^Group .*/Group ${stack_user}/g
-        " -i /etc/${APACHE_NAME}/uid.conf
-    else
-        exit_distro_not_supported "apache user and group"
-    fi
-}
-
 # install_apache_wsgi() - Install Apache server and wsgi module
 function install_apache_wsgi() {
     # Apache installation, because we mark it NOPRIME
diff --git a/lib/swift b/lib/swift
index 25d443d..8741e55 100644
--- a/lib/swift
+++ b/lib/swift
@@ -203,9 +203,6 @@
 
     done
 
-    # run apache server as stack user
-    change_apache_user_group ${STACK_USER}
-
     # WSGI isn't enabled by default, enable it
     ! is_fedora && sudo a2enmod wsgi
 }
@@ -562,10 +559,6 @@
     fi
 
     if is_apache_enabled_service swift; then
-        # Make sure the apache lock dir is owned by $STACK_USER
-        # for running apache server to avoid failure of restarting
-        # apache server due to permission problem.
-        sudo chown -R $STACK_USER /var/run/lock/$APACHE_NAME
         restart_apache_server
         swift-init --run-dir=${SWIFT_DATA_DIR}/run rest start
         screen_it s-proxy "cd $SWIFT_DIR && sudo tail -f /var/log/$APACHE_NAME/proxy-server"
diff --git a/tools/fixup_stuff.sh b/tools/fixup_stuff.sh
index 371b25f..87922c8 100755
--- a/tools/fixup_stuff.sh
+++ b/tools/fixup_stuff.sh
@@ -34,8 +34,8 @@
 # ---------------
 
 # Pre-install affected packages so we can fix the permissions
-sudo pip install prettytable
-sudo pip install httplib2
+pip_install prettytable
+pip_install httplib2
 
 SITE_DIRS=$(python -c "import site; import os; print os.linesep.join(site.getsitepackages())")
 for dir in $SITE_DIRS; do