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
(cherry picked from commit 5c612875a6)
This commit is contained in:
Georgy Kibardin 2017-02-07 12:12:25 +03:00
parent e950bee9ed
commit 9526f477d8
2 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
# Perform fuel bootstrap configuration # Perform fuel bootstrap configuration
fix-configs-on-startup || true /usr/bin/fix-configs-on-startup || /bin/true
# Unlocking nailgun-agent for discovering # Unlocking nailgun-agent for discovering
rm -f /etc/nailgun-agent/nodiscover /bin/rm -f /etc/nailgun-agent/nodiscover

View File

@ -1,6 +1,8 @@
#!/bin/sh #!/bin/sh
set -e 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) 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_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}') 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 sed -i "/^\s*server\b/ d" /etc/ntp.conf
echo "server $masternode_ip burst iburst" >> /etc/ntp.conf echo "server $masternode_ip burst iburst" >> /etc/ntp.conf
service ntp restart systemctl restart ntp
# #
# Update mcollective config # 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.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 sed -i "s/^plugin.rabbitmq.pool.1.password\b.*$/plugin.rabbitmq.pool.1.password= $mco_pass/" /etc/mcollective/server.cfg
systemctl unmask mcollective systemctl unmask mcollective
service mcollective restart systemctl start mcollective