From 9df088532e4938abc6068193b3f18b5cd8238943 Mon Sep 17 00:00:00 2001 From: kueller Date: Tue, 20 Apr 2010 12:58:29 +0000 Subject: [PATCH] =?UTF-8?q?Neue=20erst=20versionen=20f=C3=BCr=20den=20eins?= =?UTF-8?q?atz=20von=20upstart=20als=20std=20init=20prozess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_upstart@5506 504e572c-2e33-0410-9681-be2bf7408885 --- etc/init/checkfs.conf | 18 +++------ etc/init/checkvar.conf | 20 +++++----- etc/init/control-alt-delete.conf | 9 +++-- etc/init/functions | 20 +--------- etc/init/hostname.conf | 19 ++++----- etc/init/hotplug.conf | 14 +++---- etc/init/ifup.conf | 66 +++++--------------------------- etc/init/initlvm.conf | 22 ++++------- etc/init/klogd.conf | 16 ++++---- etc/init/loadkeys.conf | 21 +++++----- etc/init/loadmodules.conf | 36 ++++------------- etc/init/localnet.conf | 29 +++++--------- etc/init/logd.conf | 6 ++- etc/init/maccfg.conf | 13 ++++--- etc/init/mountfs.conf | 43 +++++++-------------- etc/init/mountnfs.conf | 27 ++++--------- etc/init/nfsroot.conf | 14 +++---- etc/init/routing.conf | 14 +++---- etc/init/setclock.conf | 16 +++----- etc/init/syslogd.conf | 18 +++++---- etc/init/tty1.conf | 18 +++------ etc/init/tty2.conf | 19 +++------ etc/init/tty3.conf | 18 +++------ etc/init/tty4.conf | 18 +++------ etc/init/tty5.conf | 18 +++------ etc/init/tty6.conf | 12 +++--- etc/init/udev.conf | 59 +++++++++++++++++++--------- etc/init/varmake.conf | 11 +++--- etc/init/virtualfs.conf | 24 ++++++------ etc/init/ypclient.conf | 26 ++++++------- 30 files changed, 257 insertions(+), 407 deletions(-) diff --git a/etc/init/checkfs.conf b/etc/init/checkfs.conf index f7172c3..fd1ce6b 100644 --- a/etc/init/checkfs.conf +++ b/etc/init/checkfs.conf @@ -1,20 +1,14 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Check Filesystems" +author "Harald Kueller " +version 1.0 +emits none special 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/event.d/functions + echo "running checkfs" + source /etc/init/functions if [ -f /fastboot ]; then echo "Fast boot, no file system check" else diff --git a/etc/init/checkvar.conf b/etc/init/checkvar.conf index 1f8e256..eaa2c69 100644 --- a/etc/init/checkvar.conf +++ b/etc/init/checkvar.conf @@ -1,22 +1,24 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Check if / ist nfs" +author "Harald Kueller " +version 1.0 +emits varmake startudev + start on startup -#stop on runlevel - -description "Check if / ist nfs" -author "Harald Kueller " - console output script + echo "Starting checkvar script" + source /etc/init/functions mount -t proc none /proc + status_message "/proc mounted" if mount|grep /dev/root|grep nfs &>/dev/null; then /sbin/initctl emit varmake + status_message "emitting varmake" else umount /proc mount -t tmpfs none /var/lock - /sbin/initctl emit start udev + /sbin/initctl emit startudev + status_message "emitting startudev" fi end script diff --git a/etc/init/control-alt-delete.conf b/etc/init/control-alt-delete.conf index 7b3db2b..590528d 100644 --- a/etc/init/control-alt-delete.conf +++ b/etc/init/control-alt-delete.conf @@ -1,9 +1,12 @@ # 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. +# pressed, and performs a safe reboot of the machine. + +description "emergency keypress handling" +author "Scott James Remnant " start on control-alt-delete -emit shutdown -exec /sbin/shutdown -t1 -a -r now "Control-Alt-Delete pressed" +task +exec shutdown -r now "Control-Alt-Delete pressed" diff --git a/etc/init/functions b/etc/init/functions index 7b28b5f..b719426 100755 --- a/etc/init/functions +++ b/etc/init/functions @@ -117,11 +117,12 @@ status_message() { echo "Usage: status_message " fi echo -n $Message - if [ $? = 0 ]; then + if [ $STATUS = 0 ]; then print_status success else print_status failure fi + return 0 } @@ -412,20 +413,3 @@ GetShortMask () { done echo $NumIP } - -initautomount() { - MOUNTSOURCE=$1 - AUTOMOUNTSOURCE=$2 - source /etc/sysconfig/autofstime - sed -e '/^#/d' |\ - sed -e '/^ *$/d' >/tmp/autofs - exec 3&- - rm /tmp/autofs -} -# End /etc/init.d/functions diff --git a/etc/init/hostname.conf b/etc/init/hostname.conf index a51c9ad..6ad44fe 100644 --- a/etc/init/hostname.conf +++ b/etc/init/hostname.conf @@ -1,17 +1,14 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Setup System Hostname" +author "Harald Kueller " +version 1.0 +emits none special -start on stopped udevstart +start on ( runlevel [S012345] and ( started 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 +console none script - source /etc/event.d/functions + echo "setting up hostname" + source /etc/init/functions if [ -f /etc/sysconfig/nodename ]; then /bin/hostname `cat /etc/sysconfig/nodename` status_message "Hostname set to $HOSTNAME" diff --git a/etc/init/hotplug.conf b/etc/init/hotplug.conf index 354aa79..9e2b434 100644 --- a/etc/init/hotplug.conf +++ b/etc/init/hotplug.conf @@ -1,16 +1,16 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Startup Hotplug Service" +author "Harald Kueller " +version 1.0 +emits none special start on started udev script - source /etc/event.d/functions + echo "starting hotplug scripts" + source /etc/init/functions for RC in /etc/hotplug/*.rc; do $RC start done touch /var/lock/subsys/hotplug - echo -n "starting of hotplug" - print_status success + status_message "hotplug startup ready" end script diff --git a/etc/init/ifup.conf b/etc/init/ifup.conf index 45edd7f..f2907be 100644 --- a/etc/init/ifup.conf +++ b/etc/init/ifup.conf @@ -1,58 +1,17 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Setup all configured Network Interfaces" +author "Harald Kueller " +version 1.0 +emits none special -start on stopped maccfg -stop on stopping mountfs +start on ( runlevel [2345] and (stopped maccfg)) -console logged - -pre-start script - WAITTIME=7 - 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 - ifconfig $DEVNAME up - ZAHLER=0 - if ! ethtool $DEVNAME|grep -q "No data available"; then - while [ ${ZAHLER} -le ${WAITTIME} ]; do - if [ `ethtool $DEVNAME|grep Link|awk '{print $3}'` == "yes" ]; then - (( ZAHLER++ )) - else - break - fi - sleep 1 - done - fi - fi - ifconfig $DEVNAME up - ZAHLER=0 - while [ ${ZAHLER} -le ${WAITTIME} ]; do - if [ "`cat /sys/class/net/$DEVNAME/carrier`" == "0" ]; then - (( ZAHLER++ )) - else - break - fi - sleep 1 - done -end script +console output script - for IF in `ld -d /sys/class/net/*[^lo]`; do + echo "Configuring network" + for IF in `ls -d /sys/class/net/*[^lo]`; do DEVNAME=`basename $IF` - if [ -f /usr/sbin/ethtool ]; then - DEVSTATUS=`ethtool $DEVNAME|grep Link|awk '{print $3}'` - fi - if [ "$DEVSTATUS" == "yes" ] || [ `cat /sys/class/net/$DEVNAME/carrier` == "1" ]; then - /sbin/if_up $DEVNAME - touch /var/run/net_up - fi + /sbin/if_up $DEVNAME done end script @@ -73,10 +32,3 @@ post-start script fi fi 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/init/initlvm.conf b/etc/init/initlvm.conf index 0732f5a..ae2c4b0 100644 --- a/etc/init/initlvm.conf +++ b/etc/init/initlvm.conf @@ -1,27 +1,19 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Initialize Logical Volume Manager (LVM)" +author "Harald Kueller " +version 1.0 +emits none special 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/event.d/functions + echo "Initializing volumes" + source /etc/init/functions if [ -f /sbin/vgscan ]; then /sbin/vgscan >/dev/null 2>&1 status_message "Scanning of Volumes....." for i in `vgdisplay|grep "VG Name"|awk '{print $3}'`; do - vgchange -a -y $i + vgchange -a y $i status_message "Volume Aktivation of $i ..." done fi diff --git a/etc/init/klogd.conf b/etc/init/klogd.conf index eac52c2..70866c6 100644 --- a/etc/init/klogd.conf +++ b/etc/init/klogd.conf @@ -1,11 +1,13 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Startup Kernel Logging daemon" +author "Harald Kueller " +version 1.0 +emits none special -start on started mountfs -stop on stopping mountfs +start on ( runlevel [12345] and (stopped mountfs)) +stop on ( runlevel [S06] and stopping udev)) -console logged +pre-start script + echo "Starting kernel log daemon" +end script exec /usr/sbin/klogd -n -f /var/log/kern.log diff --git a/etc/init/loadkeys.conf b/etc/init/loadkeys.conf index 3d86d11..8dbe4ca 100644 --- a/etc/init/loadkeys.conf +++ b/etc/init/loadkeys.conf @@ -1,17 +1,14 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Load System default Keymap" +author "Harald Kueller " +version 1.0 +emits none special -start on started mountfs +start on stopped 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/event.d/functions + echo "Loading Keymap" + source /etc/init/functions if [ -f /etc/sysconfig/kbd/setkeys ]; then exec 3&- fi - /bin/loadkeys -d >/dev/null - status_message "Load Keymap ..." + /usr/bin/loadkeys -d >/dev/null + status_message "Loaded Keymap ..." end script diff --git a/etc/init/loadmodules.conf b/etc/init/loadmodules.conf index df4f675..9c32b9c 100644 --- a/etc/init/loadmodules.conf +++ b/etc/init/loadmodules.conf @@ -1,13 +1,13 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Force load of special Modules defined in /etc/sysconfig/loadmods" +author "Harald Kueller " +version 1.0 +emits none special -start on started udev -stop on stopping udev +start on ( runlevel [S012345] and ( started udev ) pre-start script - source /etc/event.d/functions + echo "Loading additional modules" + source /etc/init/functions if [ -f /etc/sysconfig/loadmods ]; then sed -e "/^#/d" /etc/sysconfig/loadmods | sed -e "/^ *$/d" >/tmp/loadmods @@ -19,25 +19,3 @@ pre-start script rm /tmp/loadmods fi end script - -post-stop script - if [ -f /etc/sysconfig/loadmods ]; then - Z=0 - while [ "$Z" "<" "9" ]; do - 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/init/localnet.conf b/etc/init/localnet.conf index a68135e..d90444a 100644 --- a/etc/init/localnet.conf +++ b/etc/init/localnet.conf @@ -1,24 +1,15 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Loopback Network Setup" +author "Harald Kueller " +version 1.0 +emits none special -start on stopped udevstart +start on ( runlevel [S012345] and ( started udev )) -#stop on runlevel +console output -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 - source /etc/event.d/functions - /sbin/ifconfig lo 127.0.0.1 +script + echo "Setting up localhost" + source /etc/init/functions + /sbin/ifconfig lo 127.0.0.1 up status_message "Setup local net..." end script - -post-stop script - source /etc/event.d/functions - /sbin/ifconfig lo down - status_message "Remove Local Net..." -end script diff --git a/etc/init/logd.conf b/etc/init/logd.conf index 3cbc052..77bea3d 100644 --- a/etc/init/logd.conf +++ b/etc/init/logd.conf @@ -12,5 +12,9 @@ stop on runlevel 6 console output -exec /sbin/logd +post-start script + echo "Starting logd" +end script + respawn +exec /sbin/logd diff --git a/etc/init/maccfg.conf b/etc/init/maccfg.conf index 198315a..e67aa03 100644 --- a/etc/init/maccfg.conf +++ b/etc/init/maccfg.conf @@ -1,14 +1,15 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Special MAC Address Setup based on /etc/mactab*" +author "Harald Kueller " +version 1.0 +emits none special -start on started loadmodules +start on ( runlevel [2345] and (stopped mountfs)) -console logged +console output script if ls /etc/mactab* &>/dev/null; then + echo "Setting up mac adresses" for maccfg in /etc/mactab*; do nameif -c $maccfg >/dev/null done diff --git a/etc/init/mountfs.conf b/etc/init/mountfs.conf index 918843d..cd57cbd 100644 --- a/etc/init/mountfs.conf +++ b/etc/init/mountfs.conf @@ -1,22 +1,13 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Mounting all Filesystem not depending on Network" +author "Harald Kueller " +version 1.0 +emits none special 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/event.d/functions +script + source /etc/init/functions echo -n "Remounting rootfs in rw mode..." /bin/mount -n -o remount,rw / evaluate_retval @@ -34,21 +25,13 @@ pre-start script && [ ! "$FILESYSTEM" == "swap" ] \ && [ ! "$MOUNTPOINT" == "/" ] \ && [ ! "$DEVICE" == "none" ]; then - echo -n "Mounting $MOUNTPOINT" - mount $MOUNTPOINT - evaluate_retval + if [ -d $MOUNTPOINT ]; then + echo -n "Mounting $MOUNTPOINT" + mount $MOUNTPOINT + evaluate_retval + else + echo "Mountpoint $MOUNTPOINT not existing!" + fi fi done end script - -post-stop script - source /etc/event.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/init/mountnfs.conf b/etc/init/mountnfs.conf index b23c26f..c7b029d 100644 --- a/etc/init/mountnfs.conf +++ b/etc/init/mountnfs.conf @@ -1,15 +1,14 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Mounting NFS Filesystems" +author "Harald Kueller " +version 1.0 +emits none special -start on started nfsclient -stop on stopping nfsclient +start on ( runlevel [2345] and (started nfsclient)) console output -pre-start script - source /etc/event.d/functions +script + source /etc/init/functions for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do MOUNTPOINT=$i FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab` @@ -19,15 +18,3 @@ pre-start script fi done end script - -post-stop script - source /etc/event.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 - umount $MOUNTPOINT - status_message "umount NFS Filesystem from $MOUNTPOINT" - fi - done -end script diff --git a/etc/init/nfsroot.conf b/etc/init/nfsroot.conf index d3e46b3..46faa8c 100644 --- a/etc/init/nfsroot.conf +++ b/etc/init/nfsroot.conf @@ -1,17 +1,13 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Special Handling for nfs / (root) Filesystem" +author "Harald Kueller " +version 1.0 +emits none special 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/event.d/functions + source /etc/init/functions mount -t tmpfs none /var status_message "Mount tmpfs on /var" ifconfig|\ diff --git a/etc/init/routing.conf b/etc/init/routing.conf index 9fc1a9c..188ff4b 100644 --- a/etc/init/routing.conf +++ b/etc/init/routing.conf @@ -1,14 +1,14 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Setup Routing depending on several config files" +author "Harald Kueller " +version 1.0 +emits none special -start on started ifup +start on stopped ifup -console logged +console output script - source /etc/event.d/functions + source /etc/init/functions if [ ! -f /etc/sysconfig/net/notrouter ]; then echo "Configuring System with routing allowed" if [ -f /etc/sysconfig/net/gateways ]; then diff --git a/etc/init/setclock.conf b/etc/init/setclock.conf index d17aac9..1c83fd7 100644 --- a/etc/init/setclock.conf +++ b/etc/init/setclock.conf @@ -1,17 +1,13 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Set Clock from hw System clock" +author "Harald Kueller " +version 1.0 +emits none special -start on started mountfs +start on ( runlevel [12345] and (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/event.d/functions + source /etc/init/functions CLOCKPARAMS="--hctosys" case "$UTC" in yes|true|1) diff --git a/etc/init/syslogd.conf b/etc/init/syslogd.conf index edd341a..dd21a0c 100644 --- a/etc/init/syslogd.conf +++ b/etc/init/syslogd.conf @@ -1,11 +1,15 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Startup Syslog" +author "Harald Kueller " +version 1.0 +emits none special -start on stopped routing -stop on stopping ifup +start on ( runlevel [12345] and (stopped routing)) +stop on (runlevel [S06] and stopping udev) + +console output +pre-start script + echo "Starting syslog" +end script -console logged exec /usr/sbin/syslogd -n -m 0 respawn diff --git a/etc/init/tty1.conf b/etc/init/tty1.conf index a98dfcf..45ea3a1 100644 --- a/etc/init/tty1.conf +++ b/etc/init/tty1.conf @@ -1,16 +1,10 @@ -# tty1 - getty -# -# This service maintains a getty on tty1 from the point the system is -# started until it is shut down again. +description "Startup login getty on tty1" +author "Harald Kueller " +version 1.0 +emits none special -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 +start on runlevel [2345] +stop on runlevel [016] respawn exec /sbin/agetty /dev/tty1 9600 diff --git a/etc/init/tty2.conf b/etc/init/tty2.conf index 8c85729..7d40b3b 100644 --- a/etc/init/tty2.conf +++ b/etc/init/tty2.conf @@ -1,17 +1,10 @@ -# tty2 - getty -# -# This service maintains a getty on tty2 from the point the system is -# started until it is shut down again. +description "Startup login getty on tty2" +author "Harald Kueller " +version 1.0 +emits none special -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 +start on ( runlevel [2345] and ( started udev )) +stop on ( runlevel [S016] and ( stopping udev )) respawn exec /sbin/agetty /dev/tty2 9600 diff --git a/etc/init/tty3.conf b/etc/init/tty3.conf index 66d7bdb..6ddaca9 100644 --- a/etc/init/tty3.conf +++ b/etc/init/tty3.conf @@ -1,16 +1,10 @@ -# tty3 - getty -# -# This service maintains a getty on tty3 from the point the system is -# started until it is shut down again. +description "Startup login getty on tty3" +author "Harald Kueller " +version 1.0 +emits none special -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 +start on ( runlevel [2345] and (started udev)) +stop on ( runlevel [S016] and (stopping udev)) respawn exec /sbin/agetty /dev/tty3 9600 diff --git a/etc/init/tty4.conf b/etc/init/tty4.conf index 3626d4d..cee2a12 100644 --- a/etc/init/tty4.conf +++ b/etc/init/tty4.conf @@ -1,16 +1,10 @@ -# tty4 - getty -# -# This service maintains a getty on tty4 from the point the system is -# started until it is shut down again. +description "Startup login getty on tty4" +author "Harald Kueller " +version 1.0 +emits none special -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 +start on ( runlevel [2345] and (started udev)) +stop on ( runlevel [S016] and (stopping udev)) respawn exec /sbin/agetty /dev/tty4 9600 diff --git a/etc/init/tty5.conf b/etc/init/tty5.conf index da371f0..bece49c 100644 --- a/etc/init/tty5.conf +++ b/etc/init/tty5.conf @@ -1,16 +1,10 @@ -# tty5 - getty -# -# This service maintains a getty on tty5 from the point the system is -# started until it is shut down again. +description "Startup login getty on tty5" +author "Harald Kueller " +version 1.0 +emits none special -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 +start on ( runlevel [2345] and (started udev)) +stop on ( runlevel [S016] and (stopping udev)) respawn exec /sbin/agetty /dev/tty5 9600 diff --git a/etc/init/tty6.conf b/etc/init/tty6.conf index 763b9a4..c46d546 100644 --- a/etc/init/tty6.conf +++ b/etc/init/tty6.conf @@ -1,8 +1,10 @@ -# tty6 - getty -# -# This service maintains a getty on tty6 from the point the system is -# started until it is shut down again. +description "Startup login getty on tty6" +author "Harald Kueller " +version 1.0 +emits none special + +start on ( runlevel [2345] and (started udev)) +#stop on ( runlevel [S016] and (stopping udev)) -start on started udev respawn exec /sbin/agetty /dev/tty6 9600 diff --git a/etc/init/udev.conf b/etc/init/udev.conf index 24e9a20..3d40c0b 100644 --- a/etc/init/udev.conf +++ b/etc/init/udev.conf @@ -1,27 +1,48 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "Staring udevdaemon to create all the /dev entrys" +author "Harald Kueller " +version 1.0 +emits none special -start on started mountfs -stop on stopping mountfs +start on startudev +stop on runlevel [06] +console output 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 + source /etc/init/functions + echo "Starting udev" + mount -t sysfs none /sys + status_message "udev: mount sysfs" + if [ ! -d /var/lock/subsys ]; then + mkdir /var/lock/subsys + fi + if [ ! -d /dev ]; then + mkdir /dev + fi + mount -n -t tmpfs -o mode=0755 udev /dev + status_message "udev: tmpfs on /dev created" + if [ -d /lib/udev/devices ]; then + cp --preserve=all --recursive --remove-destination /lib/udev/devices/* /dev + status_message "udev: Static entries copied..." + fi + /bin/mkdir /dev/shm + /bin/mount -n -t tmpfs -o mode=1755 none /dev/shm + status_message "udev: generation of /dev/shm done" + /bin/mknod /dev/null c 1 3 + /bin/chmod 666 /dev/null + /bin/mknod /dev/console c 5 1 + status_message "udev: permissions on /dev/shm corrected..." + echo "udev:pre-start end with rc $?" end script +respawn exec /sbin/udevd -post-stop script - rm /var/lock/subsys/udev +post-start script + source /etc/init/functions + /bin/mkdir -p /dev/.udev/queue + status_message "udev: queue maked" + /sbin/udevadm trigger + status_message "udev: trigger done" + /sbin/udevadm settle + status_message "udev: Coldplug ready..." end script diff --git a/etc/init/varmake.conf b/etc/init/varmake.conf index 6ca21a0..b6c8b7d 100644 --- a/etc/init/varmake.conf +++ b/etc/init/varmake.conf @@ -1,11 +1,10 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Make special handling for ro nfs root" +author "Harald Kueller " +version 1.0 +emits none special start on varmake -#stop on runlevel - console output script source /etc/init.d/functions @@ -35,5 +34,5 @@ script echo $HOSTNAME >etc/sysconfig/nodename cd - status_message "Restore of var Filesystem..." - /sbin/initctl emit start udev + /sbin/initctl emit startudev end script diff --git a/etc/init/virtualfs.conf b/etc/init/virtualfs.conf index 5da8504..24087cd 100644 --- a/etc/init/virtualfs.conf +++ b/etc/init/virtualfs.conf @@ -1,17 +1,13 @@ -# rcS - runlevel compatibility -# -# This task runs the old sysv-rc startup scripts. +description "Mount all Virtual Filesystems like /proc /sys /tmp.." +author "Harald Kueller " +version 1.0 +emits none special -start on stopped udevstart +start on started 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 - source /etc/event.d/functions + source /etc/init/functions /bin/mount -n -o remount,rw / status_message "Changing state of rootfs to rw" echo >/dev/mtab @@ -20,8 +16,12 @@ script MOUNTPOINT=$i DEVICE=`awk '{if( $2 == "'$MOUNTPOINT'") print $1}' /etc/fstab` if [ "$DEVICE" == "none" ]; then - mount $MOUNTPOINT - status_message "Mounting $MOUNTPOINT ..." + if [ -d $MOUNTPOINT ]; then + mount $MOUNTPOINT + status_message "Mounting $MOUNTPOINT ..." + else + echo "Mountpoint $MOUNTPOINT not existing" + fi fi done end script diff --git a/etc/init/ypclient.conf b/etc/init/ypclient.conf index 34e6ec9..211e73e 100644 --- a/etc/init/ypclient.conf +++ b/etc/init/ypclient.conf @@ -1,23 +1,19 @@ -# rc - runlevel compatibility -# -# This task guesses what the "default runlevel" should be and starts the -# appropriate script. +description "If configured, startup ypbind prozess" +author "Harald Kueller " +version 1.0 +emits none special -start on started rpc +start on ( runlevel [2345] and (started rpc)) stop on stopping rpc -console output -pre-start script - source /etc/event.d/functions +#exect daemon +#pid binary /usr/sbin/ypbind +console none +script + source /etc/init/functions if [ -f /etc/sysconfig/nis/defaultdomain ]; then domainname `cat /etc/sysconfig/nis/defaultdomain` - /usr/sbin/ypbind - status_message "ypclient started" - sleep 2 + /usr/sbin/ypbind -debug fi end script - -post-stop script - pkill ypbind -end script