Comment 3 for bug 820360

Revision history for this message
Andrew Glen-Young (aglenyoung) wrote :

@Vish, @Thierry:

The current upstart script does seem to run as root and creates /var/log/nova/nova-objectstore.log owned as root.
Once I chowned the log file to be owned by the nova user and changed the upstart script to run as Vish has suggested, the daemon starts correctly.

Manual tests:

I expect the daemon to start listening on 10.55.58.254:6666 as is configured in /etc/nova/nova.conf

1) Run the start command as root [FAIL]

    root@host:~# nova-objectstore --uid $(getent passwd nova | cut -f3 -d:) --gid $(getent passwd nova | cut -f4 -d:) \
                                   --pidfile /var/run/nova/nova-objectstore.pid --flagfile=/etc/nova/nova.conf --nodaemon \
                                   --logfile=/var/log/nova/nova-objectstore.log
    2011-08-04 16:21:25,005 INFO nova.wsgi [-] Started S3 Objectstore on 10.55.59.2:3333

2) Run the start command as nova [FAIL]

    nova@host:~$ nova-objectstore --uid $(getent passwd nova | cut -f3 -d:) --gid $(getent passwd nova | cut -f4 -d:) \
                               --pidfile /var/run/nova/nova-objectstore.pid --flagfile=/etc/nova/nova.conf --nodaemon \
                               --logfile=/var/log/nova/nova-objectstore.log
    Traceback (most recent call last):
      File "/usr/bin/nova-objectstore", line 51, in <module>
        logging.setup()
    [...]
    IOError: [Errno 13] Permission denied: '/var/log/nova/nova-objectstore.log'

3) Run the start command as nova (after chowning the log file) [FAIL]

    nova@host:~$ nova-objectstore --uid $(getent passwd nova | cut -f3 -d:) --gid $(getent passwd nova | cut -f4 -d:) \
                               --pidfile /var/run/nova/nova-objectstore.pid --flagfile=/etc/nova/nova.conf --nodaemon \
                               --logfile=/var/log/nova/nova-objectstore.log
    2011-08-04 16:20:37,766 INFO nova.wsgi [-] Started S3 Objectstore on 10.55.59.2:3333

4) Run the suggested start command [PASS]

    nova@host:~$ nova-objectstore --flagfile=/etc/nova/nova.conf
    2011-08-04 16:22:04,582 INFO nova.wsgi [-] Started S3 Objectstore on 10.55.58.254:6666
    2011-08-04 16:22:04,582 INFO eventlet.wsgi.server [-] (22755) wsgi starting up on http://10.55.58.254:6666/