LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   rc.local 'gone' (https://www.linuxquestions.org/questions/linux-newbie-8/rc-local-%27gone%27-212/)

jbrown 10-25-2000 06:35 PM

Everything was going so well...I was adding routes at the CLI, but found the need to add these lines into a script. rc.local seemed like the right place, but when I saved/restarted...still no routes. When I went to verify the 'route add...' lines were saved, I found what I didn't expect in the file.

Basically, it's gone. I get the feeling rc.local is a pretty vanilla file, though I can't remember exactly what was there to begin with. Can somone post a sample? I'm using RH 6.2, nothing fancy. (It's actually a FW, and most services are disabled)

Many thanks!

JB

bickford 10-25-2000 09:30 PM

This is the original rc.local from a virgin RH6.2 install...

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

if [ -f /etc/redhat-release ]; then
R=$(cat /etc/redhat-release)

arch=$(uname -m)
a="a"
case "_$arch" in
_a*) a="an";;
_i*) a="an";;
esac

NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
if [ "$NUMPROC" -gt "1" ]; then
SMP="$NUMPROC-processor "
if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
a="an"
else
a="a"
fi
fi

# This will overwrite /etc/issue at every boot. So, make any changes you
# want to make to /etc/issue here or you will lose them when you reboot.
echo "" > /etc/issue
echo "$R" >> /etc/issue
echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue

cp -f /etc/issue /etc/issue.net
echo >> /etc/issue
fi

jbrown 10-25-2000 11:00 PM

rc.local
 
Whew! I was really sweatin' about how I'd attack this one... You probably saved me hours of wasted searching, or a re-install! I never expected a response so quickly...

THANK YOU!

JB


All times are GMT -5. The time now is 04:12 AM.