Thursday, January 27, 2011

All about /etc/rc file

The /etc/rc file contains commands that the storage system executes at boot time to configure the system.

What startup commands do  

Startup commands are placed into the /etc/rc file automatically after you run the setup command or the Setup Wizard.

Commands in the /etc/rc file configure the storage system to
1) Communicate on your network 
2) Use the NIS and DNS services 
3) Save the core dump that might exist if the storage system panicked before it was booted

Default /etc/rc file contents

To understand the commands used in the /etc/rc file on the root volume, examine the following sample /etc/rc file, which contains default startup commands:

#Auto-generated /etc/rc 


hostname filerA
ifconfig e0 `hostname`-0
ifconfig e1 `hostname`-1
ifconfig a0 `hostname`-a0
ifconfig a1 `hostname`-a1
route add default MyRouterBox
routed on
savecore


Explanation of default /etc/rc contents 

Description : hostname filerA
Sets the storage system host name to "filerA."

Description : 
ifconfig e0 `hostname`-0 
ifconfig e1 `hostname`-1
ifconfig a0 `hostname`-a0
ifconfig a1 `hostname`-a1
Sets the IP addresses for the storage system network interfaces with a default network mask.
The arguments in single backquotes expand to "filerA" if you specify "filerA" as the host name during setup. The actual IP addresses are obtained from the /etc/hosts file on the storage system root volume. If you prefer to have the actual IP addresses in the /etc/rc file, you can enter IP addresses directly in /etc/rc on the root volume.

Description: route add default MyRouterBox

Specifies the default router. You can set static routes for the storage system by adding route commands to the /etc/rc file. The network address for MyRouterBox must be in /etc/hosts on the root volume.
 
Description : routed on

Starts the routing daemon.
 
 
Description: savecore
Saves the core file from a system panic, if any, in the /etc/crash directory on the root volume. Core files are created only during the first boot after a system panic.

No comments:

Post a Comment