diff options
author | Mohit Mehta <mohit@vyatta.com> | 2011-04-20 14:18:22 -0700 |
---|---|---|
committer | Mohit Mehta <mohit@vyatta.com> | 2011-04-20 14:18:22 -0700 |
commit | 77992d4359019ec8f6cb8ec2bde603679a806db5 (patch) | |
tree | 47cc31bf36e9f34af4e70f37318c4f06840617f5 | |
parent | 6b63b690f2d9659d7fc4813a4255a0d1617ba05a (diff) | |
download | vyatta-cfg-system-77992d4359019ec8f6cb8ec2bde603679a806db5.tar.gz vyatta-cfg-system-77992d4359019ec8f6cb8ec2bde603679a806db5.zip |
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
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | debian/vyatta-cfg-system.postinst.in | 30 | ||||
-rw-r--r-- | scripts/check-params-on-reboot.d/README | 6 |
3 files changed, 39 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 0fabe989..23bdc3a1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,9 @@ sysconf_DATA = initd_SCRIPTS = checkparamsonreboot_SCRIPTS = +checkparamsonreboot_DATA = +checkparamsonreboot_DATA += scripts/check-params-on-reboot.d/README + initd_SCRIPTS += etc/init.d/vyatta-config-reboot-params checkparamsonreboot_SCRIPTS += scripts/check-params-on-reboot.d/ipv6_disable_blacklist 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 <<EOF >>/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 <<EOF >>/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 <<EOF >>/etc/rc.local +exit 0 +EOF +fi + touch /etc/environment if [ ! -f /etc/bash_completion ]; then diff --git a/scripts/check-params-on-reboot.d/README b/scripts/check-params-on-reboot.d/README new file mode 100644 index 00000000..d54ec338 --- /dev/null +++ b/scripts/check-params-on-reboot.d/README @@ -0,0 +1,6 @@ +# /etc/init.d/vyatta-config-reboot-params script executes scripts placed in +# this directory when system boots during 'runlevel S'. Scripts placed in this +# directory are responsible for making sure that the underlying system value of +# config parameters which require a reboot match when the system boots. All +# scripts placed in this directory are passed the configuration boot file as +# an argument. More info in /etc/init.d/vyatta-config-reboot-params |