109e02b1ce
Switch to using svc-map element for systemd based agent. This allows both .deb and .rpm installs to share the element for systemd based installs. There are not any plans to package a .rpm package for upstart or sysv, so these are left as is. Change-Id: Idca7ad97355cae785162989774a7e6dea6fdc5b5 Closes-Bug: #1490584
30 lines
607 B
Bash
Executable File
30 lines
607 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
install-packages -e python-dev git cloud-init
|
|
rm -rf /tmp/ironic-python-agent
|
|
|
|
case "$DIB_INIT_SYSTEM" in
|
|
upstart)
|
|
if [ -f /etc/init/ufw.conf ]; then
|
|
mv /etc/init/ufw.conf /etc/init/ufw.conf.disabled
|
|
fi
|
|
;;
|
|
systemd)
|
|
systemctl disable iptables.service
|
|
systemctl enable $(svc-map ironic-python-agent).service
|
|
;;
|
|
sysv)
|
|
update-rc.d iptables disable
|
|
;;
|
|
*)
|
|
echo "Unsupported init system"
|
|
exit 1
|
|
;;
|
|
esac
|