diskimage-builder/elements/os-config-applier/install.d/10-os-config-applier
Clint Byrum 597575c681 Fix issues causing Fedora images to fail
For os-refresh-config and os-config-applier, support systemd or upstart.

Change-Id: I4ff12e891a85b3171a6ef0c6898b2d45a1699de1
2013-03-07 14:17:41 -08:00

33 lines
675 B
Bash
Executable File

#!/bin/bash
set -eux
install-packages git-core python-pip
pip install -U git+https://github.com/tripleo/os-config-applier.git
TEMPLATE_ROOT=$(os-config-applier --print-templates)
mkdir -p $TEMPLATE_ROOT
# Upstart
if [ -d /etc/init ] ; then
cat > /etc/init/os-config-applier.conf <<eof
start on runlevel [2345]
task
exec os-config-applier
eof
# Systemd
elif [ -d /etc/systemd/system ] ; then
cat > /etc/systemd/system/os-config-applier.service <<eof
[Unit]
Description=Apply configs from Heat metadata
[Service]
ExecStart=os-config-applier
[Install]
WantedBy=multi-user.target
eof
else
echo "Only systems with systemd or upstart are supported."
exit 1
fi