Browse code

Remove change_apache_user_group function

This function allowed you to change the process running user for all of
apache. This is better handled on a per-process basis.

Change-Id: I165adc0c49fc328f34835856b49983c4e189f143
Fixes: bug 1226346
Fixes: bug 1225853

Jamie Lennox authored on 2013/09/17 10:44:05
Showing 2 changed files
... ...
@@ -4,7 +4,6 @@
4 4
 # Dependencies:
5 5
 # ``functions`` file
6 6
 # is_apache_enabled_service
7
-# change_apache_user_group
8 7
 # install_apache_wsgi
9 8
 # config_apache_wsgi
10 9
 # start_apache_server
... ...
@@ -52,29 +51,6 @@ function is_apache_enabled_service() {
52 52
     return 1
53 53
 }
54 54
 
55
-# change_apache_user_group() - Change the User/Group to run Apache server
56
-function change_apache_user_group(){
57
-    local stack_user=$@
58
-    if is_ubuntu; then
59
-        sudo sed -e "
60
-            s/^export APACHE_RUN_USER=.*/export APACHE_RUN_USER=${stack_user}/g;
61
-            s/^export APACHE_RUN_GROUP=.*/export APACHE_RUN_GROUP=${stack_user}/g
62
-        " -i /etc/${APACHE_NAME}/envvars
63
-    elif is_fedora; then
64
-        sudo sed -e "
65
-            s/^User .*/User ${stack_user}/g;
66
-            s/^Group .*/Group ${stack_user}/g
67
-        " -i /etc/${APACHE_NAME}/httpd.conf
68
-    elif is_suse; then
69
-        sudo sed -e "
70
-            s/^User .*/User ${stack_user}/g;
71
-            s/^Group .*/Group ${stack_user}/g
72
-        " -i /etc/${APACHE_NAME}/uid.conf
73
-    else
74
-        exit_distro_not_supported "apache user and group"
75
-    fi
76
-}
77
-
78 55
 # install_apache_wsgi() - Install Apache server and wsgi module
79 56
 function install_apache_wsgi() {
80 57
     # Apache installation, because we mark it NOPRIME
... ...
@@ -197,9 +197,6 @@ function _config_swift_apache_wsgi() {
197 197
 
198 198
     done
199 199
 
200
-    # run apache server as stack user
201
-    change_apache_user_group ${STACK_USER}
202
-
203 200
     # WSGI isn't enabled by default, enable it
204 201
     ! is_fedora && sudo a2enmod wsgi
205 202
 }
... ...
@@ -556,10 +553,6 @@ function start_swift() {
556 556
     fi
557 557
 
558 558
     if is_apache_enabled_service swift; then
559
-        # Make sure the apache lock dir is owned by $STACK_USER
560
-        # for running apache server to avoid failure of restarting
561
-        # apache server due to permission problem.
562
-        sudo chown -R $STACK_USER /var/run/lock/$APACHE_NAME
563 559
         restart_apache_server
564 560
         swift-init --run-dir=${SWIFT_DATA_DIR}/run rest start
565 561
         screen_it s-proxy "cd $SWIFT_DIR && sudo tail -f /var/log/$APACHE_NAME/proxy-server"