[Openstack-devel] Bug#726373: local_settings.py use realpath instead of abspath

YunQiang Su wzssyqa at gmail.com
Tue Oct 15 04:09:21 UTC 2013


Package: horizon
Version: 2013.2~rc1-1

I installed the 2013.2 version of openstack from sid/experimental, it
was a amazing experience.
While I met a problem that horizon try to lock create secret key in
   /usr/share/openstack-dashboard/openstack_dashboard/local/
In there, no file is allowed to create.


There are several ways to fix it.

1.  In locale_settings.py, there is a line
LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
Which will make LOCAL_PATH to be
    /usr/share/openstack-dashboard/openstack_dashboard/local/
use realpath here will make LOCAL_PATH to be
    /etc/openstack-dashboard/

By this way, /etc/openstack-dashboard should be writable by www-data user

2. Use
  SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join('/var/lib/horizon',
'.secret_key_store'))
   instead of
  SECRET_KEY = secret_key.generate_or_read_from_file(os.path.join(LOCALPATH,
'.secret_key_store'))
   and make /var/lib/horizon is writable by www-data

3. Don't make /etc/openstack-dashboard or /var/lib/horizon writable by
www-data by start
    wsgi as horizon:horizon, while by change
    line in openstack-dashboard.conf
           WSGIDaemonProcess horizon user=www-data group=www-data
    to
           WSGIDaemonProcess horizon user=horizon group=horizon
    It doesn't work. After restart apache2,

root at manager:~# ps aux |grep apache
root     15355  0.0  0.2  84064  3048 ?        Ss   03:59   0:00
/usr/sbin/apache2 -k start
horizon  15358  0.0  0.3 290992  5816 ?        Sl   03:59   0:00
/usr/sbin/apache2 -k start
www-data 15359  0.1  0.4 375396  6168 ?        Sl   03:59   0:00
/usr/sbin/apache2 -k start
www-data 15360  0.0  0.4 375396  6168 ?        Sl   03:59   0:00
/usr/sbin/apache2 -k start
root     15458  0.0  0.0  10352   912 pts/0    S+   03:59   0:00 grep apache

Only one apache process is running as horizon.

-- 
YunQiang Su



More information about the Openstack-devel mailing list