glance-api yoga loads unnecessary configuration files

Bug #1989098 reported by Rikimaru Honjo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
New
Undecided
Unassigned

Bug Description

=====
Issue
=====

I'm using glance-api yoga of cloud-archive on Ubuntu 20.04.

-----
# dpkg -l|grep glance-api
ii glance-api 2:24.1.0-0ubuntu1~cloud0 all OpenStack Image Registry and Delivery Service - API
-----

I set use_syslog=True in glance-api.conf. But it didn't work. The glance-api's log messages weren't printed in syslog.

==========
Root cause
==========

The "config-dir" option[1] is specified for glance-api processes.

-----------------
# ps -ef|grep glance
glance 174533 1 2 08:55 ? 00:00:21 /usr/bin/python3 /usr/bin/glance-api --config-file=/etc/glance/glance-api.conf --config-dir=/etc/glance/ --log-file=/var/log/glance/glance-api.log
glance 174561 174533 0 08:55 ? 00:00:00 /usr/bin/python3 /usr/bin/glance-api --config-file=/etc/glance/glance-api.conf --config-dir=/etc/glance/ --log-file=/var/log/glance/glance-api.log
glance 174562 174533 0 08:55 ? 00:00:00 /usr/bin/python3 /usr/bin/glance-api --config-file=/etc/glance/glance-api.conf --config-dir=/etc/glance/ --log-file=/var/log/glance/glance-api.log
root 180241 180002 0 09:12 pts/0 00:00:00 grep --color=auto glance
-----------------

So glance-api loads all *.conf files under the /etc/glance directory. As a result, /etc/glance/rootwrap.conf's use_syslog value(False) overwrites glance-api.conf's use_syslog value(True). The *.conf files seem to be loaded in alphabetical order.

I think that glance-api also loads unnecessary configuration files.(e.g. glance-scrubber.conf, rootwrap.conf...)

The "config-dir" option is defined in /etc/init.d/glance-api.

---------------
# grep config-dir /etc/init.d/glance-api
DAEMON_ARGS="--config-dir=/etc/${PROJECT_NAME}/"
---------------

[1]
The config-dir spec is written in the following document.
https://docs.openstack.org/glance/latest/configuration/configuring.html

==============================
Why is "config-dir" specified?
==============================

'DAEMON_ARGS="--config-dir=/etc/${PROJECT_NAME}/"' was added by the following bug report.

https://bugs.launchpad.net/cloud-archive/+bug/1955022

=>https://git.launchpad.net/~ubuntu-openstack-dev/ubuntu/+source/glance/commit/?id=39ce4e7eafc33ef2ddc61c338230b4afe1eeb79b

The above patch was contained in ver. 2:23.0.0+git2022011216.502fa0ffc-0ubuntu1.

So there is a possibility that this issue will also affect to xena version. But I haven't confirm xena. I would appreciate it if someone could confirm that.

=======
Remarks
=======

These are the files under /etc/glance directory after installing the glance-api yoga package.

-------------------------------------------------------------
# ls -1 /etc/glance/
glance-api-paste.ini
glance-api.conf
glance-cache.conf
glance-image-import.conf.sample
glance-manage.conf
glance-scrubber.conf
metadefs
rootwrap.conf
rootwrap.d
schema-image.json
-------------------------------------------------------------

description: updated
description: updated
description: updated
description: updated
description: updated
description: updated
summary: - glance-api yoga lodas unnecessary configuration files
+ glance-api yoga loads unnecessary configuration files
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.