#!/bin/sh

# boot.local is run once only during the startup process after 
# nfcms.  If called under :boot: under inittab it will run in 
# parallel with the other boot processes.  If called under 
# :bootwait: it will be run and finished before calling other 
# boot processes.   A danger with :bootwait: is that if it fails
# the system will not continue to boot.

# The intent here is to run some housekeeping items at boot.  
# Our initial usage of this is to import a separate bash script
# to be executed for the initial boot after a firmware upgrade.
# It would operate silimarly to the initialize and migrate scripts,
# but we are unable to use those two since drives are not yet mounted.
# This a good place to put items that need drive access since they
# will be mounted by this time (typically /media/hd0).


# path to file to run once and then delete
POST_MIG_FILE=/etc/sysconfig/boot_migrate

# source it, run it and delete it.  It should be self logging.
if [ -e $POST_MIG_FILE ]; then
   . $POST_MIG_FILE
   rm -f $POST_MIG_FILE
   logger -t "[MIGRATE]" "Post Migrate Completed."
fi

# fix old env.global TZ variable, this was moved from /etc/init.d/rcservices
source /etc/env.global
unset TZ
tzset.sh

# Here we can run some general utilities such as inserting microcode

# The network socket buffer had a max of 100,000.  Increase the max value
# for multicast receive effeciency.

sysctl -w net.core.rmem_max=5242880 &>/dev/null

#increase message queues buffers
#Maximum size of a single message
# NOTE- don't modify this, as the apps use the defined 8KB value
#sysctl -w kernel.msgmax=16384 &>/dev/null
#Maximum size of a queue in bytes
sysctl -w kernel.msgmnb=131072 &>/dev/null

# allow the net device to respond to network broadcasts.
# This allows us to find units based on adtec prefixed MAC address.
sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=0
