[Initng-svn] r3634 - initng-ifiles/trunk/initfiles/system

svn at initng.thinktux.net svn at initng.thinktux.net
Sun Apr 2 23:27:08 CEST 2006


Author: jimmy
Date: Sun Apr  2 23:27:07 2006
New Revision: 3634

Removed:
   initng-ifiles/trunk/initfiles/system/readahead-desktop.ii
Modified:
   initng-ifiles/trunk/initfiles/system/Makefile.am
   initng-ifiles/trunk/initfiles/system/readahead.ii
Log:
Readahead work.



Modified: initng-ifiles/trunk/initfiles/system/Makefile.am
==============================================================================
--- initng-ifiles/trunk/initfiles/system/Makefile.am	(original)
+++ initng-ifiles/trunk/initfiles/system/Makefile.am	Sun Apr  2 23:27:07 2006
@@ -43,7 +43,6 @@
 	numlock.ii \
 	pcmcia.ii \
 	readahead.ii \
-	readahead-desktop.ii \
 	rmnologin.ii \
 	serial.ii \
 	speedstep.ii \

Modified: initng-ifiles/trunk/initfiles/system/readahead.ii
==============================================================================
--- initng-ifiles/trunk/initfiles/system/readahead.ii	(original)
+++ initng-ifiles/trunk/initfiles/system/readahead.ii	Sun Apr  2 23:27:07 2006
@@ -1,3 +1,69 @@
+
+service system/readaead/stopper
+	last;
+	script start = {
+	    [ -e /var/run/readahead-watch.pid ] && kill `cat /var/run/readahead-watch.pid`
+	    [ -e /var/run/readahead-watch-boot.pid ] && kill `cat/var/run/readahead.pid`
+	    exit 0
+	};
+}
+
+
+# This watcher, is launched after /usr /var is mounted.
+daemon system/readahead/watcher-desktop {
+	need = system/initial/mountvirtfs system/mountfs;
+	also_start = system/readahead/stopper;
+	script daemon = {
+	    # Move away the old pid created by system/readahead/watcher
+	    mv /var/run/readahead-watch.pid /var/run/readahead-watch-boot.pid
+	    
+	    # Add /usr to dirs, if that is a mountpoint
+	    if mountpoint -q /usr; then
+		dirs="$dirs /usr"
+	    fi
+	    
+	    # Add /var to dirs, if that is a mountpoint
+	    if mountpoint -q /var; then
+		dirs="$dirs /var"
+	    fi
+		
+	    exec @/usr/sbin/readahead-watch@ -o /etc/readahead/desktop $dirs
+	    
+	    #Never get here
+	    exit 1
+	};
+}
+
+daemon system/readahead/watcher {
+	need = system/initial/mountvirtfs;
+	also_start = system/readahead/stopper;
+	script daemon = {
+	    
+	    # If /usr or /var is mounted on another filesystem, make sure they will also be checked
+	    mountpoint -q /usr && ngc --instant -u system/readahead/watcher-desktop
+	    mountpoint -q /var && ngc --instant -u system/readahead/watcher-desktop
+	    
+	    # Okay, launch watcher.
+	    exec @/usr/sbin/readahead-watch@ -o /etc/readahead/boot;
+	    
+	    exit 1
+	};
+	pid_file = /var/run/readahead-watch.pid;
+}	
+
+# This is started, when /usr is surely mounted
+service system/readahead/desktop {
+	need = system/initial/mountvirtfs system/mountfs;
+	script start = {
+	    if [ -e /etc/readahead/desktop ]
+	    then
+		[ -x @/sbin/readahead-watch@ ] && exec @/sbin/readahead-watch@ -o /etc/readahead/desktop
+	    fi
+	    exit 0
+	};
+}
+		
+
 service system/readahead {
 	need = system/initial/mountvirtfs;
 
@@ -11,7 +77,8 @@
 	    # The recent implention uses @/sbin/readhead-watch@ to get the list
 	    if [ -e /etc/readahead/boot ]
 	    then
-		exec @/sbin/readahead-list@ /etc/readahead/boot
+		ngc --instant -u system/readahead/watcher &
+		exit 0
 	    else
 		# if the watcher exist, generate /etc/readahead/boot
 		[ -x @/sbin/readahead-watch@ ] && exec @/sbin/readahead-watch@ -o /etc/readahead/boot


More information about the Initng-svn mailing list