summaryrefslogtreecommitdiff
path: root/etc/init.d/vyatta-router
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2010-11-24 10:39:59 -0800
committerBob Gilligan <gilligan@vyatta.com>2010-11-24 10:39:59 -0800
commit5ab34f4db51e54e00385e9c4583d8cc1771d0169 (patch)
treec0f485373067c6a007a42430a10f98035972e014 /etc/init.d/vyatta-router
parent6298508485f7f78a7a827716a35001b074d47b21 (diff)
downloadvyatta-cfg-5ab34f4db51e54e00385e9c4583d8cc1771d0169.tar.gz
vyatta-cfg-5ab34f4db51e54e00385e9c4583d8cc1771d0169.zip
Bind mount /opt/vyatta/etc/config to /config.
Diffstat (limited to 'etc/init.d/vyatta-router')
-rwxr-xr-xetc/init.d/vyatta-router22
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/init.d/vyatta-router b/etc/init.d/vyatta-router
index 4f10f3a..763471a 100755
--- a/etc/init.d/vyatta-router
+++ b/etc/init.d/vyatta-router
@@ -180,6 +180,26 @@ bind_mount_boot()
fi
}
+#
+# On live booted machines (i.e. systems booted from LiveCD and systems
+# booted from images), the /opt/vyatta/etc/config directory is bind
+# mounted to /config. We want all machines to have the config directory
+# mounted under /config because it is a more convenient location. So we
+# bind mount /opt/vyatta/etc/config to /config here if it has not already
+# been done.
+#
+mount_slash_config ()
+{
+ mounted=`mount | grep /opt/vyatta/etc/config`
+
+ if [ -z "$mounted" ]; then
+ if [ ! -d /config ]; then
+ mkdir /config
+ fi
+ mount --bind /opt/vyatta/etc/config /config
+ fi
+}
+
start ()
{
log_action_begin_msg "Mounting Vyatta Config"
@@ -189,6 +209,8 @@ start ()
disabled bootfile || init_bootfile
+ mount_slash_config
+
log_daemon_msg "Starting Vyatta router"
disabled migrate || migrate_bootfile
for s in ${subinit[@]} ; do