/usr/share/tripleo-image-elements/bm-dnsmasq/install.d/81-bm-dnsmasq is in python-tripleo-image-elements 0.7.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | #!/bin/bash
set -eux
install-packages dnsmasq dnsmasq-utils
function install_dnsmasq_upstart {
cat > /etc/init/nova-bm-dnsmasq.conf << eof
start on runlevel [2345]
stop on runlevel [016]
pre-start script
mkdir -p /tftpboot
chown -R nova:nova /tftpboot
killall -9 dnsmasq || echo 'no dnsmasq running'
end script
respawn
respawn limit 2 5
script
exec dnsmasq --conf-file= \\
--keep-in-foreground \\
--port=0 \\
--dhcp-boot=pxelinux.0 \\
--bind-interfaces \\
--pid-file=/var/run/dnsmasq.pid \\
--interface=br-ctlplane \\
--dhcp-range=192.0.2.65,192.0.2.69,29
end script
post-start exec sleep 1
eof
}
function install_dnsmasq_systemd {
cat > /lib/systemd/system/nova-bm-dnsmasq.service << eof
[Unit]
Description=Nova dnsmasq service
After=openvswitch.service
[Service]
Type=forking
ExecStartPre=-/bin/killall -9 dnsmasq
ExecStart=/sbin/dnsmasq --conf-file= \\
--port=0 \\
--enable-tftp \\
--tftp-root=/tftpboot \\
--dhcp-boot=pxelinux.0 \\
--bind-interfaces \\
--pid-file=/var/run/dnsmasq.pid \\
--interface=br-ctlplane \\
--dhcp-range=192.0.2.65,192.0.2.69,29
[Install]
WantedBy=multi-user.target
Alias=nova-bm-dnsmasq.service
eof
# Enable the service
systemctl enable nova-bm-dnsmasq.service
}
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
install_dnsmasq_upstart
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
install_dnsmasq_systemd
fi
|