From e2edb76e69323d3a7eb91a398670d331bffaf937 Mon Sep 17 00:00:00 2001 From: kueller Date: Thu, 22 Apr 2010 14:04:34 +0000 Subject: [PATCH] Vorbereitung auf upstart git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_cdboot@5575 504e572c-2e33-0410-9681-be2bf7408885 --- etc/init/checkfs.conf | 11 +++++++++++ etc/init/checkvar.conf | 29 +++++++++++++++++++++++++++++ etc/init/hostname.conf | 17 +++++++++++++++++ etc/init/mountfs.conf | 27 +++++++++++++++++++++++++++ etc/init/xdm.conf | 29 +++++++++++++++++++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 etc/init/checkfs.conf create mode 100644 etc/init/checkvar.conf create mode 100644 etc/init/hostname.conf create mode 100644 etc/init/mountfs.conf create mode 100644 etc/init/xdm.conf diff --git a/etc/init/checkfs.conf b/etc/init/checkfs.conf new file mode 100644 index 0000000..c438933 --- /dev/null +++ b/etc/init/checkfs.conf @@ -0,0 +1,11 @@ +description "Check Filesystems" +author "Harald Kueller " +version 1.0 +emits none special + +start on stopped initlvm + +console output +script + tar -C / -zxf /dev/floppy/0 +end script diff --git a/etc/init/checkvar.conf b/etc/init/checkvar.conf new file mode 100644 index 0000000..a39cb01 --- /dev/null +++ b/etc/init/checkvar.conf @@ -0,0 +1,29 @@ +description "Check if / ist nfs" +author "Harald Kueller " +version 1.0 +emits varmake startudev + + +start on startup + +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 + tar -C /var -zxpf /boot/var.tgz + if [ ! -d /var/lock ]; then + mkdir /var/lock + fi + mount -t tmpfs none /var/lock + /sbin/initctl emit startudev + status_message "emitting startudev" + fi +end script diff --git a/etc/init/hostname.conf b/etc/init/hostname.conf new file mode 100644 index 0000000..decb9a5 --- /dev/null +++ b/etc/init/hostname.conf @@ -0,0 +1,17 @@ +description "Setup System Hostname" +author "Harald Kueller " +version 1.0 +emits none special + +start on ( runlevel [S012345] and ( started udev )) + +console none +script + if ip addr list dev eth0|grep -q inet; then + IP=`ifconfig eth0|grep inet|awk '{print $2}'|cut -d ":" -f 2` + echo "$IP ViitorLinux_install" >>/etc/hosts + else + sed -e "s/127\.0\.0\.1.*$/127.0.0.1 localhost ViitorLinux_install/" /etc/hosts >/tmp/hosts + mv /tmp/hosts /var/etc/hosts + fi +end script diff --git a/etc/init/mountfs.conf b/etc/init/mountfs.conf new file mode 100644 index 0000000..fb9744b --- /dev/null +++ b/etc/init/mountfs.conf @@ -0,0 +1,27 @@ +description "Mounting all Filesystem not depending on Network" +author "Harald Kueller " +version 1.0 +emits none special + +start on stopped checkfs + +console output +script + 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 + if [ -d $MOUNTPOINT ]; then + echo -n "Mounting $MOUNTPOINT" + mount $MOUNTPOINT + evaluate_retval + else + echo "Mountpoint $MOUNTPOINT not existing!" + fi + fi + done +end script diff --git a/etc/init/xdm.conf b/etc/init/xdm.conf new file mode 100644 index 0000000..22224c0 --- /dev/null +++ b/etc/init/xdm.conf @@ -0,0 +1,29 @@ +description "Startup autofs System for local configuration files" +author "Harald Kueller " +version 1.0 +emits none special + +start on (runlevel [45] and (started rpc)) +stop on runlevel [01236] + +console output + +post-start script + if [ ! -d /tmp/.ICE-unix ]; then + mkdir /tmp/.ICE-unix + chown root:root /tmp/.ICE-unix + chmod 1777 /tmp/.ICE-unix + fi +end script + +script + if ls /etc/X11/xdm/*.xdm >/dev/null 2>&1; then + XDM=`cat /etc/X11/xdm/*.xdm` + dbus-launch --exit-with-session $XDM --nodaemon + else + source /etc/profile + source /root/.bash_profile + export HOME=/root + startx + fi +end script