summaryrefslogtreecommitdiff
path: root/debian/patches/rc.patch
blob: 964662c79881734cd3fd4abf203716e01f6ff8ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
More debianish rc scripts
---
 daemons/rc.sh |   43 ++++++++++++++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 11 deletions(-)

--- a/daemons/rc.sh
+++ b/daemons/rc.sh
@@ -19,14 +19,17 @@ then
 	echo Automatic boot in progress...
 	date
 
-	/sbin/fsck --preen --writable
+	fsysopts / --update --readonly
+	/sbin/fsck -p -A
 
 	case $? in
 	# Successful completion
 	0)
+		fsysopts / --update --writable
 		;;
 	# Filesystem modified (but ok now)
 	1)
+		fsysopts / --update --writable
 		;;
 	# Filesystem modified, filesystem should be restarted
 	# Ideally we would only restart the filesystem
@@ -85,12 +88,26 @@ if test -d /tmp; then
 
 fi
 if test -d /var/run; then
-  (cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
+  (cd /var/run && {
+    find . ! -type d ! -name utmp ! -name innd.pid \
+      -exec rm -f -- {} \;
+    cp /dev/null utmp
+    if grep -q ^utmp: /etc/group
+    then
+	chmod 664 utmp
+	chgrp utmp utmp
+    fi; })
 fi
 echo done
 
-# This file must exist for e2fsck to work. XXX
-touch /var/run/mtab
+# See whether procfs is set up
+if ! test -e /proc/cmdline ; then
+  settrans -c /proc /hurd/procfs --compatible
+fi
+
+# This file must exist for e2fsck to work.
+ln -s /proc/mounts /var/run/mtab
+ln -sf /proc/mounts /etc/mtab
 
 #echo -n restoring pty permissions...
 #chmod 666 /dev/tty[pqrs]*
@@ -104,15 +120,25 @@ touch /var/run/mtab
 
 chmod 664 /etc/motd
 
-echo -n starting daemons:
-
-/sbin/syslogd	&& echo -n ' syslogd'
-/sbin/inetd	&& echo -n ' inetd'
-
-if test -x /sbin/sendmail -a -r /etc/sendmail.cf; then
-  /sbin/sendmail -bd -q30m	&& echo -n ' sendmail'
-fi
+(
+	trap ":" INT QUIT TSTP
 
-echo .
+	if [ -d /etc/rc.boot ]
+	then
+		for i in /etc/rc.boot/S*
+		do
+			[ ! -f $i ] && continue
+			$i start
+		done
+	fi
+	if [ -d /etc/rc2.d ]
+	then
+		for i in /etc/rc2.d/S*
+		do
+			[ ! -f $i ] && continue
+			$i start
+		done
+	fi
+)
 
 date