Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 8c6202abd5c23d52fed280e28dc23b0a > files > 34

initscripts-7.06-12.3.91mdk.i586.rpm

#!/bin/bash
# Description: Launch diverses Mandrake Scripts on boot.
# (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
# 	$Id: mandrake_everytime,v 1.16 2003/01/15 09:47:21 flepied Exp $	

. /etc/rc.d/init.d/functions

[ -e /etc/sysconfig/system ] && . /etc/sysconfig/system

# Build KdmSession
[ -x /usr/sbin/fndSession ] && {
       action "Building Window Manager Sessions" /usr/sbin/fndSession
}

# Disabling supermount if not here
if [[ $(uname -m) != sparc*  ]];then
    if grep -q '^\/.*supermount.*' /etc/fstab && \
	! grep -q '[[:space:]]supermount$' /proc/filesystems  && \
	! modprobe -n supermount >/dev/null 2>/dev/null && [ -x /usr/bin/perl ];then
	action "Disabling Supermount" /usr/sbin/supermount -i disable
    fi
fi

# setup eth* (without configuring it) interfaces before the
# hotplug/pcmcia started so we are sure that what we have configured
# in /etc/modules.conf get the device we have affected.
if [ -f /etc/modules.conf ]; then
    oldhotplug=`sysctl kernel.hotplug  2>/dev/null | \
	        awk '{ print $3 }' 2>/dev/null`
    sysctl -n -w kernel.hotplug="/bin/true" > /dev/null 2>&1
    grep '^[[:space:]]*alias[[:space:]]*eth[0-9]' /etc/modules.conf | sort | while read a if module; do
	/sbin/ifconfig $if 2>/dev/null >/dev/null
    done
    sysctl -n -w kernel.hotplug=$oldhotplug > /dev/null 2>&1
fi

#Clean up Tmp.
if [ -n "$CLEAN_TMP" ] && [ "$CLEAN_TMP" -ge 1 ];then
    ( 
	TEXPR="! -ctime -$CLEAN_TMP"
	echo -n "Clean-up /tmp directory: "
	cd /tmp && \
	    find . -xdev \
	    $TEXPR \
	    ! -name . \
	    ! \( -name lost+found -uid 0 \) \
	    ! \( -name quota.user -uid 0 \) \
	    ! \( -name quota.group -uid 0 \) \
	    -depth -print | while read i; do [ -d "$i" ] && rmdir "$i" 2>/dev/null ; rm -f "$i" 2>/dev/null; done
       	if [ "$?" = "0" ];then echo_success;else echo_failure;fi
	echo
    )
    rm -f /tmp/.X*-lock
    rm -f /tmp/esrv*
    rm -f /tmp/kio*
    rm -rf /tmp/.esd*
    rm -rf /tmp/orbit-*
    rm -rf /tmp/ssh-*
    rm -rf /tmp/ksocket-*
fi

# check if /etc/resolv.conf exist - if not creates it
[ -f /etc/resolv.conf ] || {
               touch /etc/resolv.conf
}

# Now that we have all of our basic modules loaded and the kernel going,
# let's dump the syslog ring somewhere so we can find it later
dmesg > /var/log/dmesg