#!/bin/sh # # rc.inet2 This shell script boots up the entire INET system. # Note, that when this script is used to also fire # up any important remote NFS disks (like the /usr # distribution), care must be taken to actually # have all the needed binaries online _now_ ... # # Author: Fred N. van Kempen, # Modified for Slackware by Patrick Volkerding # # Some constants: NET="/usr/sbin" IN_SERV="lpd" LPSPOOL="/var/spool/lpd" # If we see IPv4 packet forwarding support in the kernel, we will turn it on. # This was the default for 2.0.x kernels, but with recent kernels it must be # activated through a file in /proc. IPv4 packet forwarding support is # required if you plan to use your Linux machine as a router or firewall. # If you don't want your Linux machine to forward packets, change the 1 below # to a 0. IPV4_FORWARD=1 if [ -f /proc/sys/net/ipv4/ip_forward ]; then if [ "$IPV4_FORWARD" = "1" ]; then echo "Activating IPv4 packet forwarding..." echo 1 > /proc/sys/net/ipv4/ip_forward else echo "Disabling IPv4 packet forwarding..." echo 0 > /proc/sys/net/ipv4/ip_forward fi fi # When using IPv4 packet forwarding, you will also get the rp_filter, which # automatically rejects incoming packets if the routing table entry for their # source address doesn't match the network interface they're arriving on. This # has security advantages because it prevents the so-called IP spoofing, # however it can pose problems if you use asymmetric routing (packets from you # to a host take a different path than packets from that host to you) or if # you operate a non-routing host which has several IP addresses on different # interfaces. To turn rp_filter off, uncomment the lines below: # if [ -r /proc/sys/net/ipv4/conf/all/rp_filter ]; then # echo "Disabling rp_filter..." # echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter # fi # Start the SUN RPC Portmapper: #if [ -f /sbin/rpc.portmap ]; then # echo "Starting /sbin/rpc.portmap..." # /sbin/rpc.portmap #fi # At this point, we are ready to talk to The World... # Begin a list of started daemons: echo -n "Starting daemons: " # Start the SYSLOGD/KLOGD daemons: if [ -f ${NET}/syslogd ]; then echo -n " syslogd" ${NET}/syslogd -m 0 sleep 1 # prevent syslogd/klogd race condition on SMP kernels echo -n " klogd" # '-c 3' = display level 'error' or higher messages on console ${NET}/klogd -c 3 fi # Start the INET SuperServer: if [ -f ${NET}/inetd ]; then echo -n " inetd" ${NET}/inetd else echo echo "WARNING: ${NET}/inetd not found." echo -n "Continuing daemon loading: " fi # Look for sshd in the two most common locations (compiled with --prefix=/usr # or with --prefix=/usr/local) and if we find it, start it up if [ -x /usr/local/sbin/sshd ]; then echo -n " sshd" /usr/local/sbin/sshd elif [ -x /usr/sbin/sshd ]; then echo -n " sshd" /usr/sbin/sshd fi # Start the various INET servers: for server in ${IN_SERV} ; do if [ -f ${NET}/${server} ]; then echo -n " ${server}" ${NET}/${server} fi done # The 'echo' below will put a carriage return at the end # of the list of started servers. echo # Done!