[devstack] fix working with USE_SYSTEMD=True

* Use absolute path for dnsmasq, as systemd rejects relative and implicit paths
* Provide "root" user to run_process instead of an explicit sudo
* Use the generic devstack function to setup logging

Change-Id: I4511a60ccb7c374393bdf78a03507ab958bbb9e7
This commit is contained in:
Dmitry Tantsur 2017-04-26 18:42:50 +02:00
parent 68cbd1286f
commit 90c7e48eb4
1 changed files with 4 additions and 4 deletions

View File

@ -76,8 +76,10 @@ function start_inspector {
}
function start_inspector_dhcp {
# NOTE(dtantsur): USE_SYSTEMD requires an absolute path
run_process ironic-inspector-dhcp \
"sudo dnsmasq --conf-file=$IRONIC_INSPECTOR_DHCP_CONF_FILE"
"$(which dnsmasq) --conf-file=$IRONIC_INSPECTOR_DHCP_CONF_FILE" \
"" root
}
function stop_inspector {
@ -182,9 +184,7 @@ function configure_inspector {
iniset "$IRONIC_CONF_FILE" inspector enabled True
iniset "$IRONIC_CONF_FILE" inspector service_url $IRONIC_INSPECTOR_URI
if [ "$LOG_COLOR" == "True" ] && [ "$SYSLOG" == "False" ]; then
setup_colorized_logging $IRONIC_INSPECTOR_CONF_FILE DEFAULT
fi
setup_logging $IRONIC_INSPECTOR_CONF_FILE DEFAULT
cp "$IRONIC_INSPECTOR_DIR/rootwrap.conf" "$IRONIC_INSPECTOR_ROOTWRAP_CONF_FILE"
cp -r "$IRONIC_INSPECTOR_DIR/rootwrap.d" "$IRONIC_INSPECTOR_CONF_DIR"