commit 7b7f6e837baa4cf00f5274231d80615040833d6c Author: kueller Date: Sat May 3 16:59:18 2008 +0000 V961 Tree Umbau git-svn-id: svn://svn.compuextreme.de/Viitor/V961/Viitor_upstart@4329 504e572c-2e33-0410-9681-be2bf7408885 diff --git a/etc/event.d/.sulogin.swp b/etc/event.d/.sulogin.swp new file mode 100644 index 0000000..17635d7 Binary files /dev/null and b/etc/event.d/.sulogin.swp differ diff --git a/etc/event.d/checkfs b/etc/event.d/checkfs new file mode 100644 index 0000000..c036f18 --- /dev/null +++ b/etc/event.d/checkfs @@ -0,0 +1,59 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on stopped initlvm + +#stop on runlevel + +description "Check Filesystems" +author "Harald Kueller " + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + source /etc/init.d/functions + if [ -f /fastboot ]; then + echo "Fast boot, no file system check" + else + echo "Changing state of rootfs to ro" + /bin/mount -n -o remount,ro / + evaluate_retval + if [ $? = 0 ]; then + if [ -f /forcefsck ]; then + echo -n "/forcefsck exists, forcing " + echo "file system check" + force="-f" + else + force="" + fi + echo "Checking file systems..." + /sbin/fsck $force -a -A -C -T + + if [ $? -gt 1 ]; then + $FAILURE + echo + echo -n "fsck failed. Please repair your file " + echo "systems manually by running /sbin/fsck" + echo "without the -a option" + echo + echo -n "Please note that the root file system " + echo "is currently mounted in read-only mode." + echo + echo -n "I will start sulogin now. When you " + echo "logout I will reboot your system." + echo + $NORMAL + /sbin/initctl emit stalled + exit 1 + else + print_status success + fi + else + echo -n "Cannot check root file system because it " + echo "could not be mounted in read-only mode." + fi + fi +end script diff --git a/etc/event.d/checkvar b/etc/event.d/checkvar new file mode 100644 index 0000000..05de75f --- /dev/null +++ b/etc/event.d/checkvar @@ -0,0 +1,25 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on startup + +#stop on runlevel + +description "Check if / ist nfs" +author "Harald Kueller " + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + mount -t proc none /proc + if mount|grep /dev/root|grep nfs &>/dev/null; then + /sbin/initctl emit varmake + else + umount /proc + mount -t tmpfs none /var/lock + /sbin/initctl emit start udev + fi +end script diff --git a/etc/event.d/control-alt-delete b/etc/event.d/control-alt-delete new file mode 100644 index 0000000..7b3db2b --- /dev/null +++ b/etc/event.d/control-alt-delete @@ -0,0 +1,9 @@ +# control-alt-delete - emergency keypress handling +# +# This task is run whenever the Control-Alt-Delete key combination is +# pressed. Usually used to shut down the machine. + +start on control-alt-delete + +emit shutdown +exec /sbin/shutdown -t1 -a -r now "Control-Alt-Delete pressed" diff --git a/etc/event.d/hostname b/etc/event.d/hostname new file mode 100644 index 0000000..e52191d --- /dev/null +++ b/etc/event.d/hostname @@ -0,0 +1,19 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on stopped udevstart + +#stop on runlevel + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + if [ -f /etc/sysconfig/nodename ]; then + /bin/hostname `cat /etc/sysconfig/nodename` + else + /bin/hostname "localhost" + fi +end script diff --git a/etc/event.d/hotplug b/etc/event.d/hotplug new file mode 100644 index 0000000..97aa82a --- /dev/null +++ b/etc/event.d/hotplug @@ -0,0 +1,14 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started udev + +script + source /etc/init.d/functions + for RC in /etc/hotplug/*.rc; do + $RC start + done + touch /var/lock/subsys/hotplug +end script diff --git a/etc/event.d/ifup b/etc/event.d/ifup new file mode 100644 index 0000000..bad33ac --- /dev/null +++ b/etc/event.d/ifup @@ -0,0 +1,34 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on stopped maccfg +stop on stopping mountfs + +console logged + +pre-start script + for IF in `ls -d /sys/class/net/*[^lo]`; do + DEVNAME=`basename $IF` + if [ -d /sys/class/net/$DEVNAME/wireless ]; then + /sbin/wlan_setup $DEVNAME + #give wlan a chance go create link + sleep 1 + fi + if [ -f /usr/sbin/ethtool ]; then + if [ `ethtool $DEVNAME|grep Link|awk '{print $3}'` == "yes" ]; then + /sbin/if_up $DEVNAME + fi + else + /sbin/if_up $DEVNAME + fi + done +end script + +post-stop script + for IF in `ls -d /sys/class/net/*[^lo]`; do + DEVNAME=`basename $IF` + /sbin/if_down $DEVNAME + done +end script diff --git a/etc/event.d/initlvm b/etc/event.d/initlvm new file mode 100644 index 0000000..ccbaa53 --- /dev/null +++ b/etc/event.d/initlvm @@ -0,0 +1,30 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on stopped virtualfs + +#stop on runlevel + +description "Initialize Locical Volume Manager (LVM)" +author "Harald Kueller " + +console logged + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + source /etc/init.d/functions + if [ -f /sbin/vgscan ]; then + echo -n "Scanning Volumes" + /sbin/vgscan >/dev/null 2>&1 + evaluate_retval + for i in `vgdisplay|grep "VG Name"|awk '{print $3}'`; do + echo -n "Activating Volume $i" + vgchange -a y $i + evaluate_retval + done + fi +end script diff --git a/etc/event.d/klogd b/etc/event.d/klogd new file mode 100644 index 0000000..eac52c2 --- /dev/null +++ b/etc/event.d/klogd @@ -0,0 +1,11 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started mountfs +stop on stopping mountfs + +console logged + +exec /usr/sbin/klogd -n -f /var/log/kern.log diff --git a/etc/event.d/loadkeys b/etc/event.d/loadkeys new file mode 100644 index 0000000..bc5eba0 --- /dev/null +++ b/etc/event.d/loadkeys @@ -0,0 +1,26 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on started mountfs + +#stop on runlevel + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + source /etc/init.d/functions + if [ -f /etc/sysconfig/kbd/setkeys ]; then + echo -n "Loading Special kbd mappings" + exec 3&- + fi + echo -n "Loading keymap..." + /bin/loadkeys -d >/dev/null +end script diff --git a/etc/event.d/loadmodules b/etc/event.d/loadmodules new file mode 100644 index 0000000..7588ccc --- /dev/null +++ b/etc/event.d/loadmodules @@ -0,0 +1,42 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started udev +stop on stopping udev + +pre-start script + source /etc/init.d/functions + if [ -f /etc/sysconfig/loadmods ]; then + sed -e "/^#/d" /etc/sysconfig/loadmods | + sed -e "/^ *$/d" >/tmp/loadmods + exec 3/dev/null; then + print_status success + else + if [ "$Z" == "8" ]; then + print_status failure + else + echo "failed" + fi + fi + done + (( Z = $Z + 1 )) + exec 3>&- + done + fi +end script diff --git a/etc/event.d/localnet b/etc/event.d/localnet new file mode 100644 index 0000000..4a2bc74 --- /dev/null +++ b/etc/event.d/localnet @@ -0,0 +1,20 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on stopped udevstart + +#stop on runlevel + +console logged + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +pre-start script + /sbin/ifconfig lo 127.0.0.1 +end script + +post-stop script + /sbin/ifconfig lo down +end script diff --git a/etc/event.d/logd b/etc/event.d/logd new file mode 100644 index 0000000..3cbc052 --- /dev/null +++ b/etc/event.d/logd @@ -0,0 +1,16 @@ +# logd +# +# This service is started automatically by init so that the output from +# other services can be logged. + +description "service logging daemon" +author "Scott James Remnant " + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 6 + +console output + +exec /sbin/logd +respawn diff --git a/etc/event.d/maccfg b/etc/event.d/maccfg new file mode 100644 index 0000000..198315a --- /dev/null +++ b/etc/event.d/maccfg @@ -0,0 +1,16 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started loadmodules + +console logged + +script + if ls /etc/mactab* &>/dev/null; then + for maccfg in /etc/mactab*; do + nameif -c $maccfg >/dev/null + done + fi +end script diff --git a/etc/event.d/mountfs b/etc/event.d/mountfs new file mode 100644 index 0000000..1cf65a5 --- /dev/null +++ b/etc/event.d/mountfs @@ -0,0 +1,54 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on stopped checkfs + +stop on shutdown +stop on runlevel 6 +stop on runlevel 0 + +description "Mount all Filesystem which are not NFS" +author "Harald Kueller " + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +pre-start script + source /etc/init.d/functions + echo -n "Remounting rootfs in rw mode..." + /bin/mount -n -o remount,rw / + evaluate_retval + echo >/etc/mtab + /bin/mount -f -o remount,rw / + /bin/rm -f /fastboot /forcefsck + echo -n "Activating swap..." + /sbin/swapon -a + evaluate_retval + for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do + MOUNTPOINT=$i + FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab` + DEVICE=`awk '{if( $2 == "'$MOUNTPOINT'") print $1}' /etc/fstab` + if [ ! "$FILESYSTEM" == "nfs" ] \ + && [ ! "$FILESYSTEM" == "swap" ] \ + && [ ! "$MOUNTPOINT" == "/" ] \ + && [ ! "$DEVICE" == "none" ]; then + echo -n "Mounting $MOUNTPOINT" + mount $MOUNTPOINT + evaluate_retval + fi + done +end script + +post-stop script + source /etc/init.d/functions + + echo -n "Deactivating swap..." + /sbin/swapoff -a + evaluate_retval + + echo -n "Unmounting file systems..." + /bin/umount -a -r + evaluate_retval +end script diff --git a/etc/event.d/mountnfs b/etc/event.d/mountnfs new file mode 100644 index 0000000..476c9e8 --- /dev/null +++ b/etc/event.d/mountnfs @@ -0,0 +1,35 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started nfsclient +stop on stopping nfsclient + +console output + +pre-start script + source /etc/init.d/functions + for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do + MOUNTPOINT=$i + FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab` + if [ "$FILESYSTEM" == "nfs" ]; then + echo -n "Mounting nfs $MOUNTPOINT" + mount $MOUNTPOINT + evaluate_retval + fi + done +end script + +post-stop script + source /etc/init.d/functions + for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do + MOUNTPOINT=$i + FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab` + if [ "$FILESYSTEM" == "nfs" ]; then + echo -n "Mounting nfs $MOUNTPOINT" + umount $MOUNTPOINT + evaluate_retval + fi + done +end script diff --git a/etc/event.d/nfsroot b/etc/event.d/nfsroot new file mode 100644 index 0000000..0ac28d3 --- /dev/null +++ b/etc/event.d/nfsroot @@ -0,0 +1,46 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on varmake + +#stop on runlevel + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + source /etc/init.d/functions + echo -n "Mounting tmpfs on /var" + mount -t tmpfs none /var + evaluate_retval + echo -n "Getting Hostname ..." + ifconfig|\ + grep Protokoll|\ + awk '{ if ( $2 == "Protokoll:Ethernet" ) print $1 }' >/var/devices + for i in `cat /var/devices`; do + INET=`ifconfig $i|\ + grep inet|\ + awk -F ":" '{print $2}'|\ + awk '{print $1}'` + ANET=`echo $INET|awk -F "." '{print $1}'` + if [ ! "$ANET" == "127" ]; then + HOSTNAME=`getent hosts $INET` + HOSTNAME=`echo $HOSTNAME|\ + awk '{print $2}'|\ + awk -F "." '{print $1}'` + break + fi + done + echo -n " $HOSTNAME" + evaluate_retval + echo -n "Restoring var folder" + cd /var + tar -zxf /boot/var_${HOSTNAME}.tgz + echo $HOSTNAME >etc/sysconfig/nodename + cd - + evaluate_retval + umount /proc + /sbin/initctl mount_virtual +end script diff --git a/etc/event.d/rc-default b/etc/event.d/rc-default new file mode 100644 index 0000000..54a700b --- /dev/null +++ b/etc/event.d/rc-default @@ -0,0 +1,28 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started syslogd + +stop on runlevel + +console logged + +script + echo "Starting rc-default script" + /sbin/runlevel --reboot || true + + if grep -q -w -- "-s\|single\|S" /proc/cmdline; then + /sbin/telinit S + elif [ -r /etc/inittab ]; then + RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)" + if [ -n "$RL" ]; then + /sbin/telinit $RL + else + /sbin/telinit 2 + fi + else + /sbin/telinit 2 + fi +end script diff --git a/etc/event.d/rc0 b/etc/event.d/rc0 new file mode 100644 index 0000000..30fb087 --- /dev/null +++ b/etc/event.d/rc0 @@ -0,0 +1,25 @@ +# rc0 - runlevel 0 compatibility +# +# This task runs the old sysv-rc runlevel 0 ("halt/poweroff") scripts with +# the decision as to whether to halt or power off the system left up to the +# script (and thus /etc/default/poweroff). + +start on runlevel 0 + +stop on runlevel + +console output +script + set $(runlevel || true) + if [ "$2" != "0" ] && [ "$2" != "6" ]; then + set $(runlevel --set 0 || true) + fi + + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 0 +end script diff --git a/etc/event.d/rc1 b/etc/event.d/rc1 new file mode 100644 index 0000000..b69e53a --- /dev/null +++ b/etc/event.d/rc1 @@ -0,0 +1,19 @@ +# rc1 - runlevel 1 compatibility +# +# This task runs the old sysv-rc runlevel 1 ("single-user") scripts. + +start on runlevel 1 + +stop on runlevel + +console output +script + set $(runlevel --set 1 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 1 +end script diff --git a/etc/event.d/rc2 b/etc/event.d/rc2 new file mode 100644 index 0000000..3ddaa8f --- /dev/null +++ b/etc/event.d/rc2 @@ -0,0 +1,20 @@ +# rc2 - runlevel 2 compatibility +# +# This task runs the old sysv-rc runlevel 2 ("multi-user") scripts. It +# is usually started by the telinit compatibility wrapper. + +start on runlevel 2 + +stop on runlevel + +console output +script + set $(runlevel --set 2 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 2 +end script diff --git a/etc/event.d/rc3 b/etc/event.d/rc3 new file mode 100644 index 0000000..aa02a1d --- /dev/null +++ b/etc/event.d/rc3 @@ -0,0 +1,20 @@ +# rc3 - runlevel 3 compatibility +# +# This task runs the old sysv-rc runlevel 3 (user defined) scripts. It +# is usually started by the telinit compatibility wrapper. + +start on runlevel 3 + +stop on runlevel + +console output +script + set $(runlevel --set 3 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 3 +end script diff --git a/etc/event.d/rc4 b/etc/event.d/rc4 new file mode 100644 index 0000000..58c5b00 --- /dev/null +++ b/etc/event.d/rc4 @@ -0,0 +1,20 @@ +# rc3 - runlevel 3 compatibility +# +# This task runs the old sysv-rc runlevel 3 (user defined) scripts. It +# is usually started by the telinit compatibility wrapper. + +start on runlevel 4 + +stop on runlevel + +console output +script + set $(runlevel --set 4 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 4 +end script diff --git a/etc/event.d/rc5 b/etc/event.d/rc5 new file mode 100644 index 0000000..4bb868b --- /dev/null +++ b/etc/event.d/rc5 @@ -0,0 +1,20 @@ +# rc5 - runlevel 5 compatibility +# +# This task runs the old sysv-rc runlevel 5 (user defined) scripts. It +# is usually started by the telinit compatibility wrapper. + +start on runlevel 5 + +stop on runlevel + +console output +script + set $(runlevel --set 5 || true) + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 5 +end script diff --git a/etc/event.d/rc6 b/etc/event.d/rc6 new file mode 100644 index 0000000..4927d90 --- /dev/null +++ b/etc/event.d/rc6 @@ -0,0 +1,23 @@ +# rc6 - runlevel 6 compatibility +# +# This task runs the old sysv-rc runlevel 6 ("reboot") scripts. + +start on runlevel 6 + +stop on runlevel + +console output +script + set $(runlevel || true) + if [ "$2" != "0" ] && [ "$2" != "6" ]; then + set $(runlevel --set 6 || true) + fi + + if [ "$1" != "unknown" ]; then + PREVLEVEL=$1 + RUNLEVEL=$2 + export PREVLEVEL RUNLEVEL + fi + + exec /etc/init.d/rc 6 +end script diff --git a/etc/event.d/rcS-sulogin b/etc/event.d/rcS-sulogin new file mode 100644 index 0000000..40fd13a --- /dev/null +++ b/etc/event.d/rcS-sulogin @@ -0,0 +1,25 @@ +# rcS-sulogin - "single-user" runlevel compatibility +# +# This task runs the sulogin binary during "single-user" mode. + +start on runlevel S + +stop on runlevel + +console owner + +script + runlevel --set S >/dev/null || true + /sbin/sulogin + + if [ -r /etc/inittab ]; then + RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)" + if [ -n "$RL" ]; then + telinit $RL + else + telinit 2 + fi + else + telinit 2 + fi +end script diff --git a/etc/event.d/routing b/etc/event.d/routing new file mode 100644 index 0000000..98f10ce --- /dev/null +++ b/etc/event.d/routing @@ -0,0 +1,47 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started ifup + +console logged + +script + source /etc/init.d/functions + if [ ! -f /etc/sysconfig/net/notrouter ]; then + echo "Configuring System with routing allowed" + if [ -f /etc/sysconfig/net/gateways ]; then + sed -e "/^#/d" /etc/sysconfig/net/gateways | \ + sed -e "/^ *$/d" >/tmp/gateways + exec 3&- + rm /tmp/gateways + fi + if [ -f /etc/sysconfig/net/defaultrouter ]; then + echo -n "setting up defaultrouter `cat /etc/sysconfig/net/defaultrouter`" + $DEBUG route add default gw `cat /etc/sysconfig/net/defaultrouter` + evaluate_retval + fi + NUMIF=`ip -f inet addr show|grep inet|wc -l` + if [ $NUMIF -gt 2 ]; then + echo -n "Enable ip_forwarding" + echo "1" >/proc/sys/net/ipv4/ip_forward + evaluate_retval + fi + fi +end script diff --git a/etc/event.d/setclock b/etc/event.d/setclock new file mode 100644 index 0000000..10a3205 --- /dev/null +++ b/etc/event.d/setclock @@ -0,0 +1,24 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on started mountfs + +#stop on runlevel + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + source /etc/init.d/functions + CLOCKPARAMS="--hctosys" + case "$UTC" in + yes|true|1) + CLOCKPARAMS="$CLOCKPARAMS -u" + ;; + esac + echo -n "Setting clock.." + /sbin/hwclock $CLOCKPARAMS + evaluate_retval +end script diff --git a/etc/event.d/sulogin b/etc/event.d/sulogin new file mode 100644 index 0000000..03823a1 --- /dev/null +++ b/etc/event.d/sulogin @@ -0,0 +1,18 @@ +# sulogin - rescue mode +# +# This task ensures that should the system fail to have any active jobs +# that the system administrator can rescue it; by giving them a shell. + +start on stalled + +exec /sbin/sulogin +console owner + +pre-start script + echo + echo "The system has reached a state where there are no jobs running." + echo "A shell will be spawned so that you may start such jobs that are" + echo "necessary." + echo + echo "Type 'exit' when finished." +end script diff --git a/etc/event.d/syslogd b/etc/event.d/syslogd new file mode 100644 index 0000000..edd341a --- /dev/null +++ b/etc/event.d/syslogd @@ -0,0 +1,11 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on stopped routing +stop on stopping ifup + +console logged +exec /usr/sbin/syslogd -n -m 0 +respawn diff --git a/etc/event.d/tty1 b/etc/event.d/tty1 new file mode 100644 index 0000000..a98dfcf --- /dev/null +++ b/etc/event.d/tty1 @@ -0,0 +1,16 @@ +# tty1 - getty +# +# This service maintains a getty on tty1 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 +start on runlevel 4 +start on runlevel 5 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 6 + +respawn +exec /sbin/agetty /dev/tty1 9600 diff --git a/etc/event.d/tty2 b/etc/event.d/tty2 new file mode 100644 index 0000000..8c85729 --- /dev/null +++ b/etc/event.d/tty2 @@ -0,0 +1,17 @@ +# tty2 - getty +# +# This service maintains a getty on tty2 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 +start on runlevel 4 +start on runlevel 5 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 5 +stop on runlevel 6 + +respawn +exec /sbin/agetty /dev/tty2 9600 diff --git a/etc/event.d/tty3 b/etc/event.d/tty3 new file mode 100644 index 0000000..66d7bdb --- /dev/null +++ b/etc/event.d/tty3 @@ -0,0 +1,16 @@ +# tty3 - getty +# +# This service maintains a getty on tty3 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 +start on runlevel 4 +start on runlevel 5 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 6 + +respawn +exec /sbin/agetty /dev/tty3 9600 diff --git a/etc/event.d/tty4 b/etc/event.d/tty4 new file mode 100644 index 0000000..3626d4d --- /dev/null +++ b/etc/event.d/tty4 @@ -0,0 +1,16 @@ +# tty4 - getty +# +# This service maintains a getty on tty4 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 +start on runlevel 4 +start on runlevel 5 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 6 + +respawn +exec /sbin/agetty /dev/tty4 9600 diff --git a/etc/event.d/tty5 b/etc/event.d/tty5 new file mode 100644 index 0000000..da371f0 --- /dev/null +++ b/etc/event.d/tty5 @@ -0,0 +1,16 @@ +# tty5 - getty +# +# This service maintains a getty on tty5 from the point the system is +# started until it is shut down again. + +start on runlevel 2 +start on runlevel 3 +start on runlevel 4 +start on runlevel 5 + +stop on runlevel 0 +stop on runlevel 1 +stop on runlevel 6 + +respawn +exec /sbin/agetty /dev/tty5 9600 diff --git a/etc/event.d/tty6 b/etc/event.d/tty6 new file mode 100644 index 0000000..763b9a4 --- /dev/null +++ b/etc/event.d/tty6 @@ -0,0 +1,8 @@ +# tty6 - getty +# +# This service maintains a getty on tty6 from the point the system is +# started until it is shut down again. + +start on started udev +respawn +exec /sbin/agetty /dev/tty6 9600 diff --git a/etc/event.d/udev b/etc/event.d/udev new file mode 100644 index 0000000..24e9a20 --- /dev/null +++ b/etc/event.d/udev @@ -0,0 +1,27 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started mountfs +stop on stopping mountfs + +pre-start script + source /etc/udev/udev.conf + prog=udev + sysfs_dir=/sys + bin=/sbin/udev + udevd=/sbin/udevd + udev_root=/dev + if [ ! -d $sysfs_dir/block ]; then + exit 1 + fi + export ACTION=add + touch /var/lock/subsys/udev +end script + +exec /sbin/udevd + +post-stop script + rm /var/lock/subsys/udev +end script diff --git a/etc/event.d/udevstart b/etc/event.d/udevstart new file mode 100644 index 0000000..638a6a2 --- /dev/null +++ b/etc/event.d/udevstart @@ -0,0 +1,42 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on start udev + +#stop on runlevel + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + if [ -f /sbin/udevstart ]; then + . /etc/init.d/functions + . /etc/udev/udev.conf + prog=udev + szsfs_dir=/sys + bin=/lib/udev + udevd=/sbin/udevd + udev_root=/dev + echo "Bringing udev system up" + echo -n "mounting sys" + mount -t sysfs none /sys + evaluate_retval + echo -n ".../var/lock" + if [ ! -d /var/lock/subsys ]; then + mkdir /var/lock/subsys + fi + if [ ! -d $udev_root ]; then + mkdir $udev_root + fi + evaluate_retval + echo -n ".../dev " + mount -t tmpfs none /dev + evaluate_retval + export ACTION=add + echo -n "Creating initial udev device nodes" + /sbin/udevstart + mkdir /dev/pts + fi +end script diff --git a/etc/event.d/udevtrigger b/etc/event.d/udevtrigger new file mode 100644 index 0000000..7181b5b --- /dev/null +++ b/etc/event.d/udevtrigger @@ -0,0 +1,8 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started udev + +exec /sbin/udevtrigger diff --git a/etc/event.d/varmake b/etc/event.d/varmake new file mode 100644 index 0000000..5d7cc87 --- /dev/null +++ b/etc/event.d/varmake @@ -0,0 +1,44 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on varmake + +#stop on runlevel + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + echo -n "Mounting tmpfs on /var" + mount -t tmpfs none /var + evaluate_retval + echo -n "Getting Hostname ..." + ifconfig|\ + grep Protokoll|\ + awk '{ if ( $2 == "Protokoll:Ethernet" ) print $1 }' >/var/devices + for i in `cat /var/devices`; do + INET=`ifconfig $i|\ + grep inet|\ + awk -F ":" '{print $2}'|\ + awk '{print $1}'` + ANET=`echo $INET|awk -F "." '{print $1}'` + if [ ! "$ANET" == "127" ]; then + HOSTNAME=`getent hosts $INET` + HOSTNAME=`echo $HOSTNAME|\ + awk '{print $2}'|\ + awk -F "." '{print $1}'` + break + fi + done + echo -n " $HOSTNAME" + evaluate_retval + echo -n "Restoring var folder" + cd /var + tar -zxf /boot/var_${HOSTNAME}.tgz + echo $HOSTNAME >etc/sysconfig/nodename + cd - + evaluate_retval + /sbin/initctl emit start udev +end script diff --git a/etc/event.d/virtualfs b/etc/event.d/virtualfs new file mode 100644 index 0000000..a95d4ff --- /dev/null +++ b/etc/event.d/virtualfs @@ -0,0 +1,29 @@ +# rcS - runlevel compatibility +# +# This task runs the old sysv-rc startup scripts. + +start on stopped udevstart + +#stop on runlevel + +# Note: there can be no previous runlevel here, if we have one it's bad +# information (we enter rc1 not rcS for maintenance). Run /etc/init.d/rc +# without information so that it defaults to previous=N runlevel=S. +console output +script + source /etc/init.d/functions + echo -n "Changing state of rootfs to rw" + /bin/mount -n -o remount,rw / + evaluate_retval + echo >/dev/mtab + /bin/mount -f -o remount,rw / + for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do + MOUNTPOINT=$i + DEVICE=`awk '{if( $2 == "'$MOUNTPOINT'") print $1}' /etc/fstab` + if [ "$DEVICE" == "none" ]; then + echo -n "Mounting $MOUNTPOINT" + mount $MOUNTPOINT + evaluate_retval + fi + done +end script diff --git a/etc/event.d/ypclient b/etc/event.d/ypclient new file mode 100644 index 0000000..6d97662 --- /dev/null +++ b/etc/event.d/ypclient @@ -0,0 +1,21 @@ +# rc - runlevel compatibility +# +# This task guesses what the "default runlevel" should be and starts the +# appropriate script. + +start on started rpc +stop on stopping rpc + +console output + +pre-start script + if [ -f /etc/sysconfig/nis/defaultdomain ]; then + domainname `cat /etc/sysconfig/nis/defaultdomain` + /usr/sbin/ypbind + sleep 2 + fi +end script + +post-stop script + pkill ypbind +end script diff --git a/etc/init.d/functions b/etc/init.d/functions new file mode 100755 index 0000000..171032b --- /dev/null +++ b/etc/init.d/functions @@ -0,0 +1,416 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source: /export/Data/cvs/Viitor_sysvinit/etc/init.d/functions,v $ +# +#(c) 2003 Harald Kueller, Germany +#This program is free software; you can redistribute it and/or +#modify ist under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version +#2 of the License, or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program; if not write to the Free Software Foundation, +#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +#InitScript zum Start des Daemons: +#Funktionen für die init scripten +#Dieses Script basiert auf der Vorlage des Linuxfromscratch Projetes +# +#Letzte Änderung von: $Author: kueller $ +#Datum der letzten Änderung: $Date: 2004/03/03 12:48:07 $ +#Version der Datei: $Revision: 1.12 $ +# +#$Log: functions,v $ +#Revision 1.12 2004/03/03 12:48:07 kueller +#Header auf neuen Viitor GPL Header umgestellt +# +# +#Revision 1.11 2002/09/30 20:32:22 kueller +#Korrektur der Funktion getmasks - bei nichtvorhandener /etc/netmasks +#bricht die Funktion mit einem [] Fehler ab. Variable FOUND wurde +#in diesem Fall nicht gesetzt. Fehler behoben +# +#Revision 1.10 2002/09/23 20:22:09 hkueller +#Anpassung der Funktionen an BASH - dazu musste jedes typeset kommando +#entfernt werden, da bash keine zahlenumrechnung kann. Durch Neue Funktion +#GetShortMask problem mit short mask angabe bei ip kommando ohne verwendung +#von umrechnungsfunktionen gelöst. +# +#Revision 1.9 2002/09/11 18:16:05 hkueller +#Korrekturen bei der netzmask erkennung unter zsh +# +#Revision 1.8 2002/08/09 07:00:00 hkueller +#getmask vereinfacht und beschleunigt +# +#Revision 1.6 2002/05/05 14:40:08 hkueller +#mit neuem Release wandert basename von /usr/bin nach /bin. functions +#entsprechend angepasst +# +#Revision 1.5 2002/02/05 02:59:04 hkueller +#functions: getbroadcast() hinzugefuegt - gibt broadcast eines Netzes +# zurueck - Aufruf: getbroadcast +# getmask erweitert - keine mask in /etc/netmasks -> +# defaultmask (Class A/B/C) +#networks: Ueberfaelliger eintrag fuer PTP entfernt +# Eintraege zur Konfiguration mit ifconfig hinzugefuegt - aber +# auskommentiert. +# +#Revision 1.4 2001/11/18 21:25:52 kueller +#Korrektur der Aufräumfunktion (sed Regulare Expression) für /etc/netmasks +#(getmask funktion) +# +#Revision 1.3 2001/11/17 23:41:35 kueller +#Network Setup erweitert. Netmasks werden jetzt aus /etc/netmasks erkannt. +#Konfiguration der Netmask in /etc/sysconfig/hostname. nicht mehr +#notwendig! +# +#Revision 1.2 2001/11/17 22:20:33 kueller +#Funktionen dectohex und dectobin zur Umrechnung von dezimalen IP Adressen in +#Binäre bzw. Dezimale Darstellung hinzugefügt. +#Achtung: Diese Funktione funktionieren nur in Verbindung mit der zsh oder +#eine ksh - nicht mit sh oder bash!!!! +# +#Revision 1.1.1.1 2001/09/23 00:02:08 kueller +#Neustart wg. Datenverlust +# +#Revision 1.2 2001/08/25 10:14:28 kueller +# +#Optische Retusche der READY und FAILED Meldungen +# +#Revision 1.1.1.1 2001/08/08 10:02:32 kueller +#sysvinit addons +# +# + +if [ "$COLUMNS" ]; then + (( COL = $COLUMNS - 10 )) +else + COL=70 +fi +SET_COL="/bin/echo -en \\033[${COL}G" +NORMAL="/bin/echo -en \\033[0;39m" +SUCCESS="/bin/echo -en \\033[1;42m" +FAILURE="/bin/echo -en \\033[1;41m" + +evaluate_retval() +{ + if [ $? = 0 ] + then + print_status success + else + print_status failure + fi +} + +print_status() +{ + if [ $# = 0 ] + then + echo "Usage: print_status {success|failure}" + exit 1 + fi + + case "$1" in + success) + $SET_COL + $SUCCESS + echo -n " READY " + $NORMAL + echo "" + ;; + failure) + $SET_COL + $FAILURE + echo -n " FAILED " + $NORMAL + echo "" + ;; + esac + +} + +loadproc() +{ + + if [ $# = 0 ] + then + echo "Usage: loadproc {program}" + exit 1 + fi + + base=`/bin/basename $1` + + pidlist=`/bin/pidof -o $$ -o $PPID -o %PPID -x $base` + + pid="" + + for apid in $pidlist + do + if [ -d /proc/$apid ] + then + pid="$pid $apid" + fi + done + + if [ ! -n "$pid" ] + then + $* + evaluate_retval + else + print_status failure + fi + +} + +killproc() +{ + + if [ $# = 0 ] + then + echo "Usage: killproc {program} [signal]" + exit 1 + fi + + base=`/bin/basename $1` + + if [ "$2" != "" ] + then + killlevel=$2 + else + nolevel=1 + fi + + pidlist=`/bin/pidof -o $$ -o $PPID -o %PPID -x $base` + + pid="" + + for apid in $pidlist + + do + if [ -d /proc/$apid ] + then + pid="$pid $apid" + fi + done + + if [ -n "$pid" ] + then + if [ "$nolevel" = 1 ] + then + /bin/kill -TERM $pid + if ps h $pid >/dev/null 2>&1 + then + /bin/kill -KILL $pid + fi + /bin/ps h $pid >/dev/null 2>&1 + if [ $? = 0 ] + then + print_status failure + else + /bin/rm -f /var/run/$base.pid + print_status success + fi + else + /bin/kill $killlevel $pid + /bin/ps h $pid >/dev/null 2>&1 + if [ $? = 0 ] + then + print_status failure + else + /bin/rm -f /var/run/$base.pid + print_status success + fi + fi + else + print_status failure + fi +} + +reloadproc() +{ + if [ $# = 0 ] + then + echo "Usage: reloadproc {program} [signal]" + exit 1 + fi + + base=`/bin/basename $1` + + if [ -n "$2" ] + then + killlevel=-$2 + else + nolevel=1 + fi + + pidlist=`/bin/pidof -o $$ -o $PPID -o %PPID -x $base` + + pid="" + + for apid in $pidlist + do + if [ -d /proc/$apid ] + then + pid="$pid $apid" + fi + done + + if [ -n "$pid" ] + then + if [ "$nolevel" = 1 ] + then + /bin/kill -SIGHUP $pid + evaluate_retval + else + /bin/kill -$killlevel $pid + evaluate_retval + fi + else + print_status failure + fi +} + +statusproc() + +{ + if [ $# = 0 ] + then + echo "Usage: status {program}" + return 1 + fi + + pid=`/bin/pidof -o $$ -o $PPID -o %PPID -x $1` + if [ -n "$pid" ] + then + echo "$1 running with Process ID $pid" + return 0 + fi + + if [ -f /var/run/$1.pid ] + then + pid=`/usr/bin/head -1 /var/run/$1.pid` + if [ -n "$pid" ] + then + echo "$1 not running but /var/run/$1.pid exists" + return 1 + fi + else + echo "$i is not running" + fi + +} + +getbroadcast() { + IP=$1 + MASK=$2 + for i in 1 2 3 4; do + IP[$i]=`echo $IP|awk -F. '{print $'$i'}'` + MASK[$i]=`echo $MASK|awk -F. '{print $'$i'}'` + (( BCAST[$i] = ${IP[$i]} | (( ${MASK[$i]} ^ 255 )) )) + done + echo ${BCAST[1]}.${BCAST[2]}.${BCAST[3]}.${BCAST[4]} +} + +getnetaddr() { + IP=$1 + MASK=$2 + for i in 1 2 3 4; do + IPS=`echo $IP|awk -F. '{print $'$i'}'` + MASKS=`echo $MASK|awk -F. '{print $'$i'}'` + (( BCASTS = $IPS & $MASKS )) + if [ "$i" = "4" ]; then + printf "$BCASTS" + else + printf "$BCASTS." + fi + done + echo +} + +getmask() { + IP=$1 + FOUND=0 + if [ -f /etc/netmasks ]; then + sed -e "/^#/d" /etc/netmasks |\ + sed -e "/^ *$/d" >/tmp/if + while read NETADDR NETMASK; do + NETIP=`getnetaddr $IP $NETMASK` + if [ "$NETADDR" = "$NETIP" ]; then + echo $NETMASK + FOUND=1 + break + fi + done /tmp/autofs + exec 3&- + rm /tmp/autofs +} +# End /etc/init.d/functions diff --git a/sbin/if_down b/sbin/if_down new file mode 100755 index 0000000..97c4363 --- /dev/null +++ b/sbin/if_down @@ -0,0 +1,56 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source: /Data/cvs/ViitorMake/templates/Script.template,v $ +# +#(c) 2003 Harald Kueller, Germany +#This program is free software; you can redistribute it and/or +#modify ist under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version +#2 of the License, or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program; if not write to the Free Software Foundation, +#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +#Script:if_up +# +#Letzte Änderung von: $Author: $ +#Datum der letzten Änderung: $Date: $ +#Version der Datei: $Revision: $ +# +#$Log: $ +# + +source /etc/init.d/functions +DEV=$1 +if [ ! "$DEV" ]; then + echo "Usage: $0 " + exit 10 +fi +if [ -f /etc/sysconfig/net/${DEV}.dhcp ]; then + kill `ps -ef|grep dhclient|grep eth0|awk '{print $2}'` +elif [ -f /etc/sysconfig/net/hostname.${DEV} ]; then + HOST=`cat /etc/sysconfig/net/hostname.${DEV}|awk '{print $1}'` + IP=`grep $HOST /etc/hosts|awk '{print $1}'` + NETMASK=`getmask $IP` + SHMASK=`GetShortMask $NETMASK` + echo -n "setting up interface $i:IP=$IP NMASK=$NETMASK" + if [ "$NETMASK" = "" ]; then + DEV=`echo $i|cut -d ":" -f 1` + $DEBUG ip addr del $IP broadcast + dev $DEV + $DEBUG ip link set $DEV down + else + DEV=`echo $i|cut -d ":" -f 1` + $DEBUG ip addr del $IP/$SHMASK broadcast + dev $DEV + $DEBUG ip link set $DEV down + fi + evaluate_retval +fi diff --git a/sbin/if_up b/sbin/if_up new file mode 100755 index 0000000..33b5154 --- /dev/null +++ b/sbin/if_up @@ -0,0 +1,56 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source: /Data/cvs/ViitorMake/templates/Script.template,v $ +# +#(c) 2003 Harald Kueller, Germany +#This program is free software; you can redistribute it and/or +#modify ist under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version +#2 of the License, or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program; if not write to the Free Software Foundation, +#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +#Script:if_up +# +#Letzte Änderung von: $Author: $ +#Datum der letzten Änderung: $Date: $ +#Version der Datei: $Revision: $ +# +#$Log: $ +# + +source /etc/init.d/functions +DEV=$1 +if [ ! "$DEV" ]; then + echo "Usage: $0 " + exit 10 +fi +if [ -f /etc/sysconfig/net/${DEV}.dhcp ]; then + dhclient -q ${DEV} +elif [ -f /etc/sysconfig/net/hostname.${DEV} ]; then + HOST=`cat /etc/sysconfig/net/hostname.${DEV}|awk '{print $1}'` + IP=`grep $HOST /etc/hosts|awk '{print $1}'` + NETMASK=`getmask $IP` + SHMASK=`GetShortMask $NETMASK` + echo -n "setting up interface $i:IP=$IP NMASK=$NETMASK" + if [ "$NETMASK" = "" ]; then + DEV=`echo $i|cut -d ":" -f 1` + $DEBUG ip addr add $IP broadcast + dev $DEV + $DEBUG ip link set $DEV up + else + DEV=`echo $i|cut -d ":" -f 1` + $DEBUG ip addr add $IP/$SHMASK broadcast + dev $DEV + $DEBUG ip link set $DEV up + fi + evaluate_retval +fi diff --git a/sbin/wlan_setup b/sbin/wlan_setup new file mode 100755 index 0000000..fc60658 --- /dev/null +++ b/sbin/wlan_setup @@ -0,0 +1,75 @@ +#!/bin/bash +#Framework, welches ein komplettes Linux System aus den Sourcen erstellt +#dieses Framework wird im CVS Repository +#:pserver:cvs.compuextreme.de:/Data/cvs zur Verfügung gestellt +# +#Lage dieser Datei im Archiv: $Source: /export/Data/cvs/Viitor_wireless/etc/init.d/wireless,v $ +# +#(c) 2003 Harald Kueller, Germany +#This program is free software; you can redistribute it and/or +#modify ist under the terms of the GNU General Public License +#as published by the Free Software Foundation; either version +#2 of the License, or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +#along with this program; if not write to the Free Software Foundation, +#Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +#Script:wlan_setup +#Setup eines WLAN Interfaces per accesspoint config files in +#/etc/sysconfig/wlan/ +# +#Letzte Änderung von: $Author$ +#Datum der letzten Änderung: $Date$ +#Version der Datei: $Revision$ +# +#$Log: wireless,v $ +#Revision 1.1.1.1 2004/12/05 13:10:59 kueller +#New Package wireless +# +# +source /etc/init.d/functions + +DEV=$1 +if [ ! "$DEV" ]; then + echo "usage: $0 " + exit 1 +fi +if [ ! -d /sys/class/net/$DEV/wireless ]; then + echo "No Wireless Device" + exit 2 +fi +for AP in `iwlist $DEV scan 2>/dev/null|\ + grep ESSID|\ + cut -d":" -f 2-`; do + AP=`echo $AP|sed -e "s/\"//g"` + if [ -f /etc/sysconfig/wlan/$AP ]; then + echo -n "Binding Wireless Network to AP $AP" + $DEBUG iwconfig $DEV essid $AP + evaluate_retval + sed -e "/^#/d" /etc/sysconfig/wlan/$AP | \ + sed -e "/^ *$/d" >/tmp/AP + exec 3&- + rm /tmp/AP + fi +done diff --git a/tmp/postinstall b/tmp/postinstall new file mode 100644 index 0000000..fbc3ead --- /dev/null +++ b/tmp/postinstall @@ -0,0 +1,35 @@ +cd /etc/init.d +for i in 0 1 2 3 4 5 6; do + cd rc$i.d + if [ ! -d upstart_disabled ]; then + mkdir upstart_disabled + fi + if [ -h S03sysklogd ]; then + mv S03sysklogd upstart_disabled/S03sysklogd + fi + if [ -h S04hotplug ]; then + mv S04hotplug upstart_disabled/S04hotplug + fi + if [ -h S05loadmodules ]; then + mv S05loadmodules upstart_disabled/S05loadmodules + fi + if [ -h S05udev ]; then + mv S05udev upstart_disabled/S05udev + fi + if [ -h S08wireless ]; then + mv S08wireless upstart_disabled/S08wireless + fi + if [ -h S09localnet ]; then + mv S09localnet upstart_disabled/S09localnet + fi + if [ -h S10dhcpclient ]; then + mv S10dhcpclient upstart_disabled/S10dhcpclient + fi + if [ -h S10networks ]; then + mv S10networks upstart_disabled/S10networks + fi + if [ -h S13ypclient ]; then + mv S13ypclient upstart_disabled/S13ypclient + fi + cd .. +done