The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Tables and borders amatuer_lee_3 Shell Programming and Scripting 8 05-15-2008 01:57 PM
awk - list to tables Lobaria Shell Programming and Scripting 10 04-24-2008 05:07 AM
Converting tables of row data into columns of tables justthisguy Shell Programming and Scripting 7 07-16-2007 01:42 PM
viewing tables itldp UNIX for Dummies Questions & Answers 2 12-17-2003 06:19 AM
PHP: list into tables perleo Shell Programming and Scripting 2 10-01-2003 06:50 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #8  
Old 10-06-2006
Registered User
 

Join Date: Jun 2006
Location: Las Vegas, NV
Posts: 104
Yep, that did the trick.

I guess I'll put what I did in here just incase someone else needs it some other time.

in /etc/rc3.d/

I created a file called S99addroute (why S99 it was with the naming convention with the other files soooo you can probably just make a file called addroute and it should work)

-rwxr--r-- 1 root sys 244 Oct 6 09:31 S99addroute (make sure perms are same as other files)

(inside file)
#!/sbin/sh

ifconfig hme0:1 plumb
ifconfig hme0:1 172.28.66.10 netmask 255.255.255.252 broadcast 172.28.66.11
ifconfig hme0:1 up
route add 10.192.0.0/10 172.28.66.9

I changed the ip's around so they aren't mine, but you get the idea... if anyone thinks the script can be improved or start it in a different rc dir let me know this is kinda new to me.
Reply With Quote
Forum Sponsor
  #9  
Old 10-06-2006
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 401
Ok, two things.

First, Solaris goes into the rc directories upon startup and shutdown and runs the scripts in the rc directory. On startup, all scripts that begin with 'S' are run in order. Shutdown runs the scripts that begin with 'K'.

So the script must start with an S or K depending on when you want the script to run. The numbers ensure the scripts are executed in the proper order. That the network is started before the web server or mail daemon for example. If you have a necessary route, I would think (I haven't tried this) that it would need to be run after the interface is set up and active.

Second, it is convention and highly suggested that you put the addroute script in the /etc/init.d directory. Then use ln -s to link the S script in the rc2.d or rc3.d directories

Code:
# ln -s ../init.d/addroute S99addroute
Generally when I'm checking the system for startup files, I'll check the /etc/init.d directory first since each of the scripts in the rc.d directories should link to a script that exists in /etc/init.d. It's a centralized repository of the startup scripts. Otherwise I have to go into each of the rc directories (not like there's 200 of them or anything) and search.

Hope this helps.

Carl
Reply With Quote
  #10  
Old 10-06-2006
Registered User
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 401
Oh and you shouldn't need to configure your interface in your script. It should already be up if there's a /etc/hostname.hme0 file. This file tells the startup scripts to initialize the hme0 interface with information in the other files (netmask, hosts, etc).

Carl
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:00 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0