#!/bin/sh # # rc.M This file is executed by init(8) when the system is being # initialized for one of the "multi user" run levels (i.e. # level 3 and 4). # Origin Fred N. van Kempen, # Heavily modified by Patrick Volkerding # Softly modified by Jean-Philippe Guillemin for Zenwalk Linux :) . /etc/shell-colors # Tell the viewers what's going to happen. echo -e "${BOLDMAGENTA}Going multiuser${COLOR_RESET}" # Check for splash availability SPLASHSCREEN="no" [[ -x /sbin/splash && -e /proc/splash ]] && export SPLASHSCREEN="yes" progressbar() { echo "show $(( 65534 * $1 / 100 ))" > /proc/splash } # Remove stale locks and junk files /bin/rm -f /var/lock/* /var/spool/uucp/LCK..* /tmp/.X*lock /tmp/core /core 2> /dev/null if [ -d /var/lock/subsys ]; then rm -f /var/lock/subsys/* fi # Start the system logger if [ -x /etc/rc.d/rc.syslog -a -x /usr/sbin/syslogd -a -d /var/log ]; then . /etc/rc.d/rc.syslog start 1>/dev/null 2>/dev/null & fi # Ensure basic filesystem permissions sanity. chmod 755 / 2> /dev/null chmod 1777 /tmp /var/tmp # Create /tmp/.X11-unix and cleanup /tmp/.ICE-unix mkdir -p /tmp/.X11-unix chmod 1777 /tmp/.X11-unix mkdir -p /tmp/.ICE-unix ( cd /tmp/.ICE-unix && rm -rf * ) chmod 1777 /tmp/.ICE-unix # Remove stale hunt sockets if [ -r /tmp/hunt -o -r /tmp/hunt.stats ]; then echo "Removing your stale hunt sockets from /tmp." /bin/rm -f /tmp/hunt* fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 60 & # Screen blanks after 15 minutes idle time, and powers down in one hour # if the kernel supports APM or ACPI power management: /bin/setterm -blank 15 -powersave powerdown -powerdown 60 # Start ACPI daemon if [ -x /etc/rc.d/rc.acpid ]; then . /etc/rc.d/rc.acpid start 1>/dev/null 2>/dev/null & fi # Set the hostname if [ -r /etc/HOSTNAME ]; then /bin/hostname $(cat /etc/HOSTNAME | cut -f1 -d .) else # fall back on this default echo "zenwalk.hyperion.net" > /etc/HOSTNAME /bin/hostname zenwalk fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 65 & # Start the DBUS daemon: if [ -x /etc/rc.d/rc.messagebus ]; then /etc/rc.d/rc.messagebus start fi # Save interfaces names mappings for udev coldplug if [ -x /lib/udev/net-mapper.sh ]; then /lib/udev/net-mapper.sh fi # Initialize networking if [ -x /etc/rc.d/rc.inet1 ]; then echo -e "${BOLDCYAN}Starting the Network${COLOR_RESET}" # first set the .inetflag flag : rc.inet1 will check it # /dev is mounted in tmpfs, so the flag will go on shutdown touch /dev/.inetflag # Now we can play ! . /etc/rc.d/rc.inet1 fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 70 & # Start the portmapper if [ -x /etc/rc.d/rc.rpc ]; then . /etc/rc.d/rc.rpc start fi # Start various services and daemons if [ -x /etc/rc.d/rc.services ]; then echo -e "${BOLDCYAN}Starting up miscellaneous services${COLOR_RESET}" nice -15 /etc/rc.d/rc.services 1>/dev/null 2>/dev/null & fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 75 & # Load a custom screen font if [ -x /etc/rc.d/rc.font ]; then . /etc/rc.d/rc.font fi # Start the print spooling system if [ -x /etc/rc.d/rc.cups ]; then # Start CUPS: echo "Starting up the printer spooling daemon" /etc/rc.d/rc.cups start 1>/dev/null 2>/dev/null & fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 80 & # Start crond # If you want cron to actually log activity to /var/log/cron, then change # -l10 to -l8 to increase the logging level. if [ -x /usr/sbin/crond ]; then /usr/sbin/crond -l10 >>/var/log/cron 1>/dev/null 2>/dev/null & fi # Start atd (manages jobs scheduled with 'at') if [ -x /usr/sbin/atd ]; then /usr/sbin/atd -b 15 -l 1 fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 85 & # Load ALSA (sound) defaults if [ -x /etc/rc.d/rc.alsa ]; then touch /etc/modprobe.d/sound echo "Starting up the sound daemon" . /etc/rc.d/rc.alsa 1>/dev/null 2>/dev/null & fi # Start the GPM mouse server if [ -x /etc/rc.d/rc.gpm ]; then . /etc/rc.d/rc.gpm start 1>/dev/null 2>/dev/null & fi # Load a custom keymap if the user has an rc.keymap script if [ -x /etc/rc.d/rc.keymap ]; then . /etc/rc.d/rc.keymap fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 90 & # 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 #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 95 & # Activate numlock if enabled if [ -x /etc/rc.d/rc.numlock ]; then . /etc/rc.d/rc.numlock start fi # Start the local setup procedure if [ -x /etc/rc.d/rc.local ]; then . /etc/rc.d/rc.local 1>/dev/null 2>/dev/null & fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 100 & # Save the contents of dmesg /bin/dmesg -s 65536 > /var/log/dmesg # Check for licenced packages if [ -x /etc/rc.d/rc.licences ]; then /etc/rc.d/rc.licences fi # Perform some post-install setup, this will be executed only once ! if [ -x /etc/rc.d/rc.postinstall ]; then /etc/rc.d/rc.postinstall chmod 400 /etc/rc.d/rc.postinstall fi #### Push the progress bar and Set the splash screen to verbose mode 10 seconds later #### if [ "$SPLASHSCREEN" = "yes" ]; then echo "show 65534" > /proc/splash & (sleep 10 ; echo "verbose") > /proc/splash & fi # All done.