5 kx #!/bin/sh
5 kx #
5 kx # rc.inet2 This shell script boots up the entire network system.
5 kx # Note, that when this script is used to also fire
5 kx # up any important remote NFS disks (like the /usr
5 kx # directory), care must be taken to actually
5 kx # have all the needed binaries online _now_ ...
5 kx #
5 kx # Uncomment or comment out sections depending on which
5 kx # services your site requires.
5 kx #
5 kx # Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
5 kx # Modified by: Patrick Volkerding <volkerdi@slackware.com>
406 kx # Andrey V. Kosteltsev, <kx@radix-linux.su>
5 kx #
5 kx
5 kx
5 kx # At this point, we are (almost) ready to talk to The World...
5 kx
5 kx
5 kx # If there is a firewall script, run it before enabling packet forwarding.
5 kx # See the HOWTOs on http://www.netfilter.org/ for documentation on
5 kx # setting up a firewall or NAT on Linux. In some cases this might need to
5 kx # be moved past the section below dealing with IP packet forwarding.
5 kx if [ -x /etc/rc.d/rc.firewall ]; then
5 kx /etc/rc.d/rc.firewall start
5 kx fi
5 kx
5 kx # Turn on IPv4 packet forwarding support.
5 kx if [ -x /etc/rc.d/rc.ip_forward ]; then
5 kx /etc/rc.d/rc.ip_forward start
5 kx fi
5 kx
5 kx # Start krb5kdc, which is the Kerberos version 5 Authentication Service
5 kx # and Key Distribution Center (AS/KDC). This needs to run first on both
5 kx # master and secondary KDCs.
5 kx if [ -x /etc/rc.d/rc.krb5kdc ]; then
5 kx /etc/rc.d/rc.krb5kdc start
5 kx fi
5 kx
5 kx # Start the Kerberos administration server. This typically runs on the
5 kx # master Kerberos server, which stores the KDC database.
5 kx if [ -x /etc/rc.d/rc.kadmind ]; then
5 kx /etc/rc.d/rc.kadmind start
5 kx fi
5 kx
5 kx # Start the Kerberos V5 slave KDC update server. This runs on a slave
5 kx # (secondary) KDC server. It allows the master Kerberos server to use
5 kx # kprop(8) to propagate its database to the slave servers.
5 kx if [ -x /etc/rc.d/rc.kpropd ]; then
5 kx /etc/rc.d/rc.kpropd start
5 kx fi
5 kx
5 kx # Mount remote (NFS) filesystems:
5 kx if cat /etc/fstab | grep -v '^#' | grep -w nfs 1> /dev/null 2> /dev/null ; then
5 kx # Start rpc.portmap, /sbin/rpc.lockd, and /sbin/rpc.statd if we find NFS
5 kx # volumes defined in /etc/fstab since these will need to be running in order
5 kx # to mount them. If they are not running, attempting to mount an NFS
5 kx # partition will cause mount to hang, or at least result in unreliable
5 kx # operation. Keep this in mind if you plan to mount unlisted NFS
5 kx # partitions...
5 kx # If you have uncommented NFS partitions in your /etc/fstab, rc.rpc is run
5 kx # whether it is set as executable or not. If you don't want to run it,
5 kx # comment the NFS partitions out in /etc/fstab or erase/rename rc.rpc.
5 kx if [ -r /etc/rc.d/rc.rpc ]; then
5 kx sh /etc/rc.d/rc.rpc start
5 kx fi
5 kx echo "Mounting remote (NFS) file systems: /sbin/mount -a -t nfs"
5 kx /sbin/mount -a -t nfs # This may be our /usr runtime!
5 kx # Show the mounted volumes:
5 kx /sbin/mount -v -t nfs
5 kx fi
5 kx
5 kx # If /etc/rc.d/rc.rpc is executable, run it to load rpc.portmap, rpc.lockd,
5 kx # and rpc.statd. This might be needed to mount NFS partitions that are not
5 kx # listed in /etc/fstab. Starting this twice won't hurt as the script will
5 kx # check if things are already running before trying to start them.
5 kx if [ -x /etc/rc.d/rc.rpc ]; then
5 kx /etc/rc.d/rc.rpc start
5 kx fi
5 kx
5 kx # Mount remote CIFS filesystems. Note that where possible, using CIFS is
5 kx # preferred over SMBFS. SMBFS is no longer actively maintained.
5 kx if cat /etc/fstab | grep -v '^#' | grep -w cifs 1> /dev/null 2> /dev/null ; then
5 kx echo "Mounting remote CIFS file systems: /sbin/mount -a -t cifs"
5 kx /sbin/mount -a -t cifs
5 kx # Show the mounted volumes:
5 kx /sbin/mount -v -t cifs
5 kx fi
5 kx
5 kx # Mount remote SMB filesystems:
5 kx if cat /etc/fstab | grep -v '^#' | grep -w smbfs 1> /dev/null 2> /dev/null ; then
5 kx echo "Mounting remote SMBFS file systems: /sbin/mount -a -t smbfs"
5 kx /sbin/mount -a -t smbfs
5 kx # Show the mounted volumes:
5 kx /sbin/mount -v -t smbfs
5 kx fi
5 kx
5 kx # Start the system logger if it is not already running (maybe because /usr
5 kx # is on a network partition). NOTE: Don't put /usr on a network partition,
5 kx # or even a separate local partition. This is not supported and is likely to
5 kx # cause some problems...
5 kx if [ -x /etc/rc.d/rc.syslog -a -d /var/log -a ! -r /var/run/syslogd.pid ]; then
5 kx /etc/rc.d/rc.syslog start
5 kx fi
5 kx
5 kx # Start the inetd server:
5 kx if [ -x /etc/rc.d/rc.inetd ]; then
5 kx /etc/rc.d/rc.inetd start
5 kx fi
5 kx
5 kx # Start the OpenSSH SSH daemon:
5 kx if [ -x /etc/rc.d/rc.sshd ]; then
5 kx echo "Starting OpenSSH SSH daemon: /usr/sbin/sshd"
5 kx /etc/rc.d/rc.sshd start
5 kx fi
5 kx
5 kx # Start the BIND name server daemon:
5 kx if [ -x /etc/rc.d/rc.bind ]; then
5 kx /etc/rc.d/rc.bind start
5 kx fi
5 kx
5 kx # Start NIS (the Network Information Service):
5 kx if [ -x /etc/rc.d/rc.yp ]; then
5 kx /etc/rc.d/rc.yp start
5 kx fi
5 kx
5 kx # Start OpenVPN:
5 kx if [ -x /etc/rc.d/rc.openvpn ]; then
5 kx /etc/rc.d/rc.openvpn start
5 kx fi
5 kx
5 kx # Start the NFS server. Note that for this to work correctly, you'll
5 kx # need nfsd support in the kernel (the startup script will try to load
5 kx # the module for you).
5 kx # You'll also need to set up some shares in /etc/exports.
5 kx # Starting the NFS server:
5 kx if [ -x /etc/rc.d/rc.nfsd ]; then
5 kx /etc/rc.d/rc.nfsd start
5 kx fi
5 kx