From f4a19dfad3417228c0a0632bf71e91b1798f10c7 Mon Sep 17 00:00:00 2001 From: Fredrik Thulin Date: Thu, 3 May 2018 12:33:31 +0200 Subject: [PATCH] ubuntu 18.04 doesn't seem to have /etc/rc.local anymore --- .../eid/templates/kvm/bootstrap-cosmos.sh.erb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/global/overlay/etc/puppet/modules/eid/templates/kvm/bootstrap-cosmos.sh.erb b/global/overlay/etc/puppet/modules/eid/templates/kvm/bootstrap-cosmos.sh.erb index 30a5a1bc..449fe1b0 100755 --- a/global/overlay/etc/puppet/modules/eid/templates/kvm/bootstrap-cosmos.sh.erb +++ b/global/overlay/etc/puppet/modules/eid/templates/kvm/bootstrap-cosmos.sh.erb @@ -55,14 +55,16 @@ if ! test -d /var/cache/cosmos/repo; then cosmos clone "$cmd_repo" fi -# re-run cosmos at reboot until it succeeds - use bash -l to get working proxy settings -grep -v "^exit 0" /etc/rc.local > /etc/rc.local.new -(echo "" - echo "test -f /etc/run-cosmos-at-boot && (bash -l cosmos -v update; bash -l cosmos -v apply && rm /etc/run-cosmos-at-boot)" - echo "" - echo "exit 0" -) >> /etc/rc.local.new -mv -f /etc/rc.local.new /etc/rc.local +if [ -f /etc/rc.local ]; then + # re-run cosmos at reboot until it succeeds - use bash -l to get working proxy settings + grep -v "^exit 0" /etc/rc.local > /etc/rc.local.new + (echo "" + echo "test -f /etc/run-cosmos-at-boot && (bash -l cosmos -v update; bash -l cosmos -v apply && rm /etc/run-cosmos-at-boot)" + echo "" + echo "exit 0" + ) >> /etc/rc.local.new + mv -f /etc/rc.local.new /etc/rc.local +fi touch /etc/run-cosmos-at-boot