summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-24 09:57:30 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-24 09:57:30 -0700
commit07ac603a29d1157d0ed0d1629c2bf620b8846ef0 (patch)
tree807ddd4efcd5ac2b22b868d3670501ef2f6cf63a /etc
parent510bd206970da7a8d5764f5465856952d11d6a73 (diff)
parentb6b8db9771c217c0d0347e4880f3a516029532a6 (diff)
downloadvyatta-cfg-07ac603a29d1157d0ed0d1629c2bf620b8846ef0.tar.gz
vyatta-cfg-07ac603a29d1157d0ed0d1629c2bf620b8846ef0.zip
Merge branch 'islavista' of suva.vyatta.com:/git/vyatta-cfg into islavista
Diffstat (limited to 'etc')
-rwxr-xr-xetc/init.d/vyatta-ofr38
-rw-r--r--etc/shell/level/users/allowed-op2
2 files changed, 35 insertions, 5 deletions
diff --git a/etc/init.d/vyatta-ofr b/etc/init.d/vyatta-ofr
index 8ff02ab..75a03b4 100755
--- a/etc/init.d/vyatta-ofr
+++ b/etc/init.d/vyatta-ofr
@@ -12,7 +12,7 @@
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
-#
+#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
@@ -66,6 +66,22 @@ have_rl_system () {
# if necessary, provide initial config
init_bootfile () {
+ # try floppy
+ # if we do not discover an fd device, try loading the floppy module
+ grep -q fd /proc/devices || modprobe -q floppy 2>/dev/null
+ grep -q ext2 /proc/filesystems || modprobe -q ext2 2>/dev/null
+ grep -q vfat /proc/filesystems || modprobe -q vfat 2>/dev/null
+ if [ ! -d /media/floppy/config ] && grep -q fd /proc/devices
+ then
+ mkdir -p /media/floppy
+ mount /dev/fd0 /media/floppy -o sync ||
+ mount -t ext2 /dev/fd0 /media/floppy -o sync ||
+ mount -t vfat /dev/fd0 /media/floppy
+ fi 2>/dev/null
+
+ [ -d /media/floppy/config ] &&
+ mount -o bind /media/floppy/config /opt/vyatta/etc/config
+
if [ -f $BOOTFILE ] && grep -q '/\*XORP Configuration File, v1.0\*/' \
$BOOTFILE >&/dev/null; then
CURTIME=$(date +%F-%H%M%S)
@@ -78,7 +94,7 @@ init_bootfile () {
$vyatta_sbindir/vyatta_current_conf_ver.pl > $BOOTFILE
fi
fi
- chgrp ${GROUP} $BOOTFILE
+ chgrp ${GROUP} $BOOTFILE
chmod 660 $BOOTFILE
## remove the unnecessary and potentially conflicting
## config-directory statement (i.e. /mnt/floppy vs. /media/floppy
@@ -103,6 +119,19 @@ load_bootfile ()
fi
}
+
+# Unload the RAID modules that we are not using. It is safe to try to
+# unload all of the RAID modules. The kernel will refuse to unload any
+# that we are actually using.
+#
+cleanup_raid()
+{
+ MD_MODULES='linear multipath raid0 raid1 raid456 raid5 raid6 raid10'
+ rmmod $MD_MODULES > /tmp/vyatta_raid_cleanup_log 2>&1
+}
+
+
+
start ()
{
log_action_begin_msg "Mounting Vyatta Config"
@@ -110,13 +139,14 @@ start ()
chgrp ${GROUP} ${vyatta_configdir}
log_action_end_msg $?
init_bootfile
- log_daemon_msg "Starting Vyatta Router"
+ log_daemon_msg "Starting Vyatta router"
migrate_bootfile
for s in ${subinit[@]} ; do
log_progress_msg $s
${vyatta_sbindir}/${s}.init start || (log_end_msg $? && return)
done
load_bootfile
+ cleanup_raid
chmod g-w,o-w /
log_end_msg $?
@@ -125,7 +155,7 @@ start ()
stop()
{
local -i status=0
- log_daemon_msg "Stopping Vyatta Router"
+ log_daemon_msg "Stopping Vyatta router"
for ((i=${#sub_inits[@]} - 1; i >= 0; i--)) ; do
s=${subinit[$i]}
log_progress_msg $s
diff --git a/etc/shell/level/users/allowed-op b/etc/shell/level/users/allowed-op
index c387a99..40c1a91 100644
--- a/etc/shell/level/users/allowed-op
+++ b/etc/shell/level/users/allowed-op
@@ -6,7 +6,6 @@ disconnect
exit
no
ping
-reboot
release
renew
set
@@ -15,4 +14,5 @@ telnet
terminal
traceroute
undebug
+update
vpn