From 77992d4359019ec8f6cb8ec2bde603679a806db5 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Wed, 20 Apr 2011 14:18:22 -0700 Subject: Fix Bug 6811 ENH: add a proper post-configuration boot script * added /config/scripts/vyatta-postconfig-bootup.script that gets called from /etc/rc.local. Users/Support can put in any workarounds in the script for unfixed bugs and enhancements that are not in Vyatta yet. Placing the script under /config makes sure that changes to the script will be preserved for the new image --- debian/vyatta-cfg-system.postinst.in | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'debian') diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in index a443b891..7daa9935 100644 --- a/debian/vyatta-cfg-system.postinst.in +++ b/debian/vyatta-cfg-system.postinst.in @@ -171,6 +171,36 @@ mkdir -p /opt/vyatta/etc/config/auth mkdir -p /opt/vyatta/etc/config/scripts mkdir -p /opt/vyatta/etc/config/user-data +# create /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script +# this should be after 'mkdir -p /opt/vyatta/etc/config/scripts' above +if [ ! -x /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script ]; then + touch /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script + chmod 755 /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script + cat <>/opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script +#!/bin/sh +# This script is called from /etc/rc.local on boot after the Vyatta +# configuration is fully applied. Any modifications done to work around +# unfixed bugs and implement enhancements which are not complete in the Vyatta +# system can be placed here. +EOF +fi + +# call vyatta-postconfig-bootup.script from /etc/rc.local +if ! grep -q /opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script \ + /etc/rc.local +then + cat <>/etc/rc.local +# Do not remove the following call to vyatta-postconfig-bootup.script. +# Any boot time workarounds should be put in script below so that they +# get preserved for the new image during image upgrade. +/opt/vyatta/etc/config/scripts/vyatta-postconfig-bootup.script +EOF + sh -c "sed -i -e '/exit 0/d' /etc/rc.local" + cat <>/etc/rc.local +exit 0 +EOF +fi + touch /etc/environment if [ ! -f /etc/bash_completion ]; then -- cgit v1.2.3