rc-local and rabbitmq-server ordering.

This patch will configure the startup ordering dependency between the
rc-local.service and rabbitmq-server.service. If not configured systemd
will start both services simultaneously and it might cause the first boot
execution to fail because rabbitmq-server wasn't up and running when the
scripts are running. Before I8985d8020f94c257d426065cf914213b35ec959f
this problem wasn't apparent because rabbitmq was manually restarted at
the beginning of the first-boot.d/98-boot-stack script.

Change-Id: Id86b43036f448262f241c04369191dfa253a6aeb
This commit is contained in:
Lucas Alvares Gomes 2013-06-28 10:12:39 +01:00
parent 3f3d32aa19
commit bf3b59b71c
1 changed files with 7 additions and 3 deletions

View File

@ -4,7 +4,6 @@ DISTRO=`lsb_release -si` || true
install-packages rabbitmq-server
# In Ubuntu rabbit's default init.d script is broken.
if [ x`lsb_release -si 2> /dev/null` = "xUbuntu" ]; then
update-rc.d -f rabbitmq-server remove
@ -20,8 +19,13 @@ post-start exec /usr/sbin/rabbitmqctl wait >/dev/null 2>&1
eof
fi
if [ $DISTRO = "Fedora" ]; then
# Delay the rc-local.service start-up until rabbitmq-server.service is started up
sed -i 's/\[Unit\]/\[Unit\]\nBefore=rc-local.service/g' /lib/systemd/system/rabbitmq-server.service
# Make systemd take notice of it
systemctl daemon-reload
# Enable the service
systemctl enable rabbitmq-server.service
fi