kolla/docker/ironic-inspector/extend_start.sh
Mark Goddard 8b63089e1c Use ironic-inspector user for ironic-inspector
This change updates the ironic-inspector image to use the
ironic-inspector user rather than the ironic user to execute the
ironic inspector service as this more closely aligns with what is
typically done by downstream packagers (specifically, Ubuntu and
RDO).

This change rebases the ironic-inspector image onto the openstack-base
image instead of the ironic-base image. We configure an
ironic-inspector user and use this to execute the ironic-inspector
service. We also configure ironic-inspector to log to
/var/log/kolla/ironic-inspector instead of the previous ironic
location.

Following this change we no longer need the workaround of a
sudoers file for the binary install type that was added in change
I8ecd0b658b8df8f38ddf717fa9443d4dc2896984.

Change-Id: Ibdc5ba35db61f4974d4282aff34bcb5ccd952d45
Closes-Bug: #1624457
2017-04-17 08:46:53 +01:00

18 lines
486 B
Bash

#!/bin/bash
LOG_PATH=/var/log/kolla/ironic-inspector
if [[ ! -d "${LOG_PATH}" ]]; then
mkdir -p "${LOG_PATH}"
fi
if [[ $(stat -c %a "${LOG_PATH}") != "755" ]]; then
chmod 755 "${LOG_PATH}"
fi
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
ironic-inspector-dbsync --config-file /etc/ironic-inspector/inspector.conf upgrade
exit 0
fi