#!/bin/sh # # rc.serices This shell script starts daemons and mounts network filesystems # Author: Jean-Philippe Guillemin for Zenwalk Linux :) . /etc/shell-colors # Start the network control daemon if [ -x /etc/rc.d/rc.wicd ]; then . /etc/rc.d/rc.wicd start fi # Start the Avahi mDNS/DNS-SD daemon if [ -x /etc/rc.d/rc.avahidaemon ]; then # We need DBUS if ps axc | grep -q dbus-daemon ; then . /etc/rc.d/rc.avahidaemon start 1>/dev/null 2>/dev/null & else echo -e "${BOLDYELLOW}Please activate DBUS (rc.messagebus), Avahi needs it!${COLOR_RESET}" fi fi # Start the portmapper if [ -x /etc/rc.d/rc.rpc ]; then . /etc/rc.d/rc.rpc start fi # At this point, we are ready to talk to The World... ############## STARTING DAEMONS AND NETWORK SERVICES ################## # We won't start these services from here, don't play with this list ;) blacklist(){ for mask in \~ .new rc.S rc.M rc.K rc.4 rc.0 rc.6 .conf rc.services rc.inet1 rc.inet2 rc.postinstall rc.rpc \ rc.modules rc.local rc.keymap rc.hald rc.wicd rc.sample rc.font rc.serial rc.udev rc.uwd rc.acpid rc.howl rc.wireless \ rc.alsa rc.numlock rc.syslog rc.font rc.cups rc.famd rc.gpm rc.messagebus rc.licences \ rc.avahidaemon ; do echo $1 | grep $mask done } # Here we go for rcscript in /etc/rc.d/rc.* ; do [ "$(blacklist $rcscript)" ] && continue if [ -x $rcscript ]; then service="$(basename $rcscript | sed -e 's/^rc\.\(.*\)$/\1/')" /usr/bin/ionice -c2 -n2 $rcscript start & fi done # Start the print spooling system if [ -x /etc/rc.d/rc.cups ]; then # Start CUPS: echo "Starting up the printer spooling daemon" /usr/bin/ionice -c3 -n2 /etc/rc.d/rc.cups start 1>/dev/null 2>/dev/null fi # Let's wait for network connectivity sleep 10 # Mount remote (NFS) filesystems if cat /etc/fstab | grep -v '^#' | grep -w nfs 1> /dev/null 2> /dev/null ; then # We need the portmapper if ps axc | grep -q rpc.statd ; then sbin/mount -a -t nfs # Show the mounted volumes /sbin/mount -v -t nfs else echo "Please activate the portmapper (rc.rpc), NFS needs it!" fi fi # Mount remote (CIFS) filesystems: if cat /etc/fstab | grep -v '^#' | grep -w cifs 1> /dev/null 2> /dev/null ; then /sbin/mount -a -t cifs # Show the mounted volumes: /sbin/mount -v -t cifs fi # All done.