]> Zhao Yanbai Git Server - minix.git/commitdiff
mfs no longer needs access to VIRCOPY, Added rs.inet. Start inet with
authorPhilip Homburg <philip@cs.vu.nl>
Wed, 15 Aug 2007 12:56:35 +0000 (12:56 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Wed, 15 Aug 2007 12:56:35 +0000 (12:56 +0000)
rs.inet as the restart script.

etc/Makefile
etc/drivers.conf
etc/rs.inet [new file with mode: 0755]
etc/usr/rc

index 004f1a28dc6ca399971471ab47274955984883a1..814fd0ae722ff950ebc421283be8463de5a38ad1 100644 (file)
@@ -1,7 +1,10 @@
 
 ETC=/etc/
 USRETC=/usr/etc/
-FILES1=fstab group hostname.file inet.conf motd.install mtab passwd profile protocols rc services termcap ttytab utmp rc.cd binary_sizes binary_sizes.big binary_sizes.xxl rc.rescue syslog.conf rc.daemons.dist rs.single make.conf drivers.conf
+FILES1=fstab group hostname.file inet.conf motd.install mtab passwd profile \
+       protocols rc services termcap ttytab utmp rc.cd binary_sizes \
+       binary_sizes.big binary_sizes.xxl rc.rescue syslog.conf \
+       rc.daemons.dist rs.inet rs.single make.conf drivers.conf
 FILES2=shadow
 FILES3=daily dhcptags.conf rc
 
index 957b251a3953d0a5ddd240115f28bd0cd3299288..24edd49a626991040105e7c09f9d48beb60e2bfa 100644 (file)
@@ -176,7 +176,6 @@ driver mfs
 {
        system
                EXIT            #  2
-               VIRCOPY         # 15
                TIMES           # 25
                SAFECOPYFROM    # 31
                SAFECOPYTO      # 32
diff --git a/etc/rs.inet b/etc/rs.inet
new file mode 100755 (executable)
index 0000000..c0d1058
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+# 'Recovery' script that doesn't. This script is to be used for drivers that
+# should not be restarted. Instead, the scripts configures the driver 'down'.
+
+kill_by_name()
+{
+       label="$1"
+       pid=`ps ax | grep "$label" | grep -v grep |
+               sed 's,[        ]*\([0-9]*\).*,\1,`
+       if [ X"$pid" = X ]
+       then
+               return 1        # No such process
+       fi
+       echo "killing pid $pid for $label"
+       kill -9 $pid
+}
+
+daemonize()
+{
+    # Function to start a daemon, if it exists.
+    local IFS=':'
+    local name="$1"
+    test "$1" = tcpd && name="$2"
+
+    for dir in $PATH
+    do
+       if [ -f "$dir/$1" ]
+       then
+
+            # check if this service is disabled at the boot monitor.
+            if disabled $name; then return; fi
+
+           echo -n " $name"
+           "$@" &
+           return
+       fi
+    done
+}
+
+disabled()
+{
+    ifs="$IFS"; IFS=,
+    for skip in `sysenv disable`
+    do 
+        if [ "$skip" = "$1" ]
+       then     
+                IFS="$ifs"; unset ifs
+               return 0
+       fi
+    done
+    IFS="$ifs"; unset ifs
+    return 1
+}
+
+exec > /dev/console
+echo "Arguments: $@"
+
+kill_by_name dhcpd
+kill_by_name nonamed
+kill_by_name syslogd
+sleep 1
+service restart "$1"
+sleep 1
+daemonize dhcpd
+daemonize nonamed -L
+daemonize syslogd
index e41e3d7e3c7780bfffebede71ade7989b0da43e4..e9f52a966acbbe14e3cdb4cd7e14e44ba9904825 100644 (file)
@@ -100,7 +100,7 @@ start)
             eval up $driver $arg -period 5HZ
         fi
     done
-    up inet 
+    up inet -script /etc/rs.inet
     up printer -dev /dev/lp -period 10HZ
     echo .