From 5c612875a6881b1c93c4dac04759f9e806a3ee1d Mon Sep 17 00:00:00 2001 From: Georgy Kibardin Date: Tue, 7 Feb 2017 12:12:25 +0300 Subject: [PATCH] Use explicit path in Xenial Nobody promised PATH to be set during rc.local execution by systemd. And it happens that this is the case on some systems, i.e. the PATH is not set by the time of rc.local execution. Change-Id: I4806df3217dd09430ad45b13cda49fab0925cb88 Partial-Bug: #1656150 --- contrib/fuel_bootstrap/files/xenial/etc/rc.local | 4 ++-- .../files/xenial/usr/bin/fix-configs-on-startup | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/contrib/fuel_bootstrap/files/xenial/etc/rc.local b/contrib/fuel_bootstrap/files/xenial/etc/rc.local index 95270382..73a2922e 100755 --- a/contrib/fuel_bootstrap/files/xenial/etc/rc.local +++ b/contrib/fuel_bootstrap/files/xenial/etc/rc.local @@ -1,7 +1,7 @@ #!/bin/sh -e # Perform fuel bootstrap configuration -fix-configs-on-startup || true +/usr/bin/fix-configs-on-startup || /bin/true # Unlocking nailgun-agent for discovering -rm -f /etc/nailgun-agent/nodiscover +/bin/rm -f /etc/nailgun-agent/nodiscover diff --git a/contrib/fuel_bootstrap/files/xenial/usr/bin/fix-configs-on-startup b/contrib/fuel_bootstrap/files/xenial/usr/bin/fix-configs-on-startup index aaa6dcf5..e4e5bb72 100755 --- a/contrib/fuel_bootstrap/files/xenial/usr/bin/fix-configs-on-startup +++ b/contrib/fuel_bootstrap/files/xenial/usr/bin/fix-configs-on-startup @@ -1,6 +1,8 @@ #!/bin/sh set -e +export PATH=$PATH:/bin + masternode_ip=$(sed -rn 's/^.*url=http:\/\/(([0-9]{1,3}\.){3}[0-9]{1,3}).*$/\1/ p' /proc/cmdline) mco_user=$(sed 's/\ /\n/g' /proc/cmdline | grep mco_user | awk -F\= '{print $2}') mco_pass=$(sed 's/\ /\n/g' /proc/cmdline | grep mco_pass | awk -F\= '{print $2}') @@ -54,7 +56,7 @@ chown ntp: /var/lib/ntp/ntp.drift # sed -i "/^\s*server\b/ d" /etc/ntp.conf echo "server $masternode_ip burst iburst" >> /etc/ntp.conf -service ntp restart +systemctl restart ntp # # Update mcollective config @@ -63,4 +65,4 @@ sed -i "s/^plugin.rabbitmq.pool.1.host\b.*$/plugin.rabbitmq.pool.1.host = $maste sed -i "s/^plugin.rabbitmq.pool.1.user\b.*$/plugin.rabbitmq.pool.1.user = $mco_user/" /etc/mcollective/server.cfg sed -i "s/^plugin.rabbitmq.pool.1.password\b.*$/plugin.rabbitmq.pool.1.password= $mco_pass/" /etc/mcollective/server.cfg systemctl unmask mcollective -service mcollective restart +systemctl start mcollective