Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
RC(8)			FreeBSD System Manager's Manual 		 RC(8)

NAME
     rc - command scripts for auto-reboot and daemon startup

SYNOPSIS
     rc
     rc.conf
     rc.conf.local
     rc.d
     rc.serial
     rc.pccard
     rc.network
     rc.firewall
     rc.atm
     rc.<arch>
     rc.local
     rc.shutdown

DESCRIPTION
     Rc is the command script which controls the automatic reboot (calling the
     other scripts) and rc.local is the script holding commands which are per­
     tinent only to a specific site.  Typically, the /usr/local/etc/rc.d mech­
     anism is used instead of rc.local these days but if you do want to use
     rc.local, /etc/rc still supports it.  In this case, rc.local should
     source /etc/rc.conf and contain additional custom startup code for your
     system.  Rc.conf contains the global system configuration information
     referenced by the rc files, while rc.conf.local contains the local system
     configuration.  See rc.conf(5)

     The rc.d directories contain scripts which will be automatically executed
     at boot time.  The specified directories are processed immediately after
     rc.local is executed.  (See below for details on how to specify directo­
     ries to check.)  The following key points apply to the scripts within
     each directory:

     ·	 Scripts are only executed if their basename(1) matches the shell
	 globbing pattern *.sh, and they are executable.  Any other files or
	 directories present within the directory are silently ignored.
     ·	 When a script is executed, it is passed the string ``start'' as its
	 first and only argument.  All rc.d scripts expected to handle this
	 argument appropriately.
     ·	 The scripts within each directory are executed in lexicographical or­
	 der.  If a specific order is required, numbers may be used as a pre­
	 fix to the existing filenames, so for example 100.foo would be exe­
	 cuted before 200.bar; without the numeric prefixes the opposite would
	 be true.

     The output from each script is traditionally a space character, followed
     by the name of the software package being started, without a trailing
     newline character (see the EXAMPLES section).

     The system initialization scripts can execute scripts from multiple rc.d
     directories.  The default locations are /usr/local/etc/rc.d and
     /usr/X11R6/etc/rc.d, but these may be overridden with the local_startup
     rc.conf(5) variable.

     Rc.shutdown is the command script which contains any necessary commands
     to be executed as the system is shut down.

     When an automatic reboot is in progress, rc is invoked with the argument
     autoboot. The first portion of rc runs an fsck(8) with option -p to
     ``preen'' all the disks of minor inconsistencies resulting from the last
     system shutdown and to check for serious inconsistencies caused by hard­
     ware or software failure.	If this auto-check and repair succeeds, then
     the second part of rc is run.

     The second part of rc, which is run after an auto-reboot succeeds and al­
     so if rc is invoked when a single user shell terminates (see init(8)),
     starts all the daemons on the system, preserves editor files and clears
     the scratch directory /tmp.

     Rc.serial is used to set any special configurations for serial devices.

     Rc.pccard is used to enable PC-cards.

     Rc.network is used to start the network.  The network is started in three
     passes.  The first pass sets the hostname and domainname, configures the
     network interfaces, turns on any IP firewall rules, and starts routing.
     The second pass starts most of the network related daemons.  The third
     pass starts NFS, amd, rwhod, Kerberos and the multicast routing daemon.

     Rc.firewall is used to configure rules for the kernel based firewall ser­
     vice.  It has several possible options:

	   open        will allow anyone in.
	   client      will try to protect just this machine.
	   simple      will try to protect a whole network.
	   closed      totally disables IP services except via lo0 interface.
	   UNKNOWN     disables the loading of firewall rules.
	   filename    will load the rules in the given filename (full path
		       required).

     Rc.atm is used to configure ATM network interfaces.  The interfaces are
     configured in three passes.  The first pass performs the initial inter­
     face configuration.  The second pass completes the interface configura­
     tion and defines PVCs and permanent ATMARP entries.  The third pass
     starts any ATM daemons.

     Rc.<arch> runs architecture specific programs.

     Rc.local is executed after the scripts above, but before the rest of the
     rc file is completed.  In a default installation rc.local does not exist,
     but its contents will be executed if the file is created by the adminis­
     trator.

     Following tradition, the startup files reside in /etc.

EXAMPLES
     The following is a simple, hypothetical example of an rc.d script, which
     would start a daemon at boot time.

	   #!/bin/sh -
	   #
	   #	initialization/shutdown script for foobar package

	   case "$1" in
	   start)
		   /usr/local/sbin/foo -d && echo -n ' foo'
		   ;;
	   *)
		   echo "unknown option: $1 - should be 'start'" >&2
		   ;;
	   esac

SEE ALSO
     rc.conf(5),  init(8),  reboot(8),	savecore(8)

HISTORY
     The rc command appeared in 4.0BSD.

4th Berkeley Distribution      December 11, 1993			     2

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | SEE ALSO | HISTORY

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=rc&sektion=8&manpath=FreeBSD+4.2-RELEASE>

home | help