#!/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 } # 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 #### 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 #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 65 & # Set the hostname if [ -r /etc/HOSTNAME ]; then /bin/hostname $(cat /etc/HOSTNAME | cut -f1 -d .) else # fall back on this default echo "zenwalk.local" > /etc/HOSTNAME /bin/hostname zenwalk fi # Save temporary udev rules if [ -x /lib/udev/save-rules.sh ]; then /lib/udev/save-rules.sh & fi # Initialize network interfaces 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 # Start the DBUS daemon: if [ -x /etc/rc.d/rc.messagebus ]; then /usr/bin/ionice -c1 -n0 /etc/rc.d/rc.messagebus start fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 70 & # Start the HAL daemon: if [ -x /etc/rc.d/rc.hald ]; then /usr/bin/ionice -c1 -n0 /etc/rc.d/rc.hald start fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 75 & # Start various services and daemons if [ -x /etc/rc.d/rc.services ]; then echo -e "${BOLDCYAN}Starting up services${COLOR_RESET}" /usr/bin/ionice -c2 -n2 /etc/rc.d/rc.services 1>/dev/null 2>/dev/null & fi # Load a custom screen font if [ -x /etc/rc.d/rc.font ]; then . /etc/rc.d/rc.font 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.conf 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 & # Activate numlock if enabled if [ -x /etc/rc.d/rc.numlock ]; then . /etc/rc.d/rc.numlock start fi #### Progress bar #### [ "$SPLASHSCREEN" = "yes" ] && progressbar 95 & # 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.