summaryrefslogtreecommitdiff
path: root/daemons
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-06-17 16:28:41 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-06-17 16:28:41 +0000
commitbd8b827b92a2d7d07c20f7a54b9c6117b03ad92a (patch)
tree1801e269d3eb8b1d66f0c6b5152b9108547684c7 /daemons
parent29463f17c5fe49f6b0f3c1aba59fb739e2d81f5a (diff)
Initial revision
Diffstat (limited to 'daemons')
-rw-r--r--daemons/rc.sh77
1 files changed, 77 insertions, 0 deletions
diff --git a/daemons/rc.sh b/daemons/rc.sh
new file mode 100644
index 00000000..eab3680d
--- /dev/null
+++ b/daemons/rc.sh
@@ -0,0 +1,77 @@
+#!/bin/sh
+PATH=/bin:/sbin
+
+if [ -r /fastboot ]
+then
+ rm -f /fastboot
+ echo Fast boot ... skipping disk checks
+elif [ $1x = autobootx ]
+then
+ echo Automatic reboot in progress...
+ date
+
+ # Find the filesystem by a kludge, and extract the root device name.
+ fsargs = `ps -MaxHww --fmt=%command | grep exec-server-task | head -1`
+ dev = `echo $fsargs | sed 's/^.* \([^ ]*\)$/\1/' `
+ type = `echo $fsargs | sed 's/^\/hurd\/\(.*\)\.static.*$/\1/' `
+
+ fsck.$type -p /dev/r$dev
+
+ case $? in
+
+# Successful completion
+ 0)
+ date
+ ;;
+
+# Filesystem modified
+ 1)
+ 2)
+ fsysopts / -uw
+ date
+ ;;
+
+# Fsck couldn't fix it.
+ 4)
+ 8)
+ echo "Automatic reboot failed... help!"
+ exit 1
+ ;;
+
+# SIGINT
+ 130)
+ echo "Reboot interrupted"
+ exit 1
+ ;;
+
+# Oh dear.
+ *)
+ echo "Unknown error in reboot"
+ exit 1
+ ;;
+else
+ date
+endif
+
+# Until new hostname functions are in place
+test -r /etc/hostname && hostname `cat /etc/hostname`
+
+echo -n cleaning lock files...
+rm -f /etc/nologin
+rm -f /var/lock/LCK.*
+echo done
+
+echo -n clearing /tmp...
+(cd /tmp; find . ! -name . ! -name lost+found ! -name quotas -exec rm -r {} \; )
+echo done
+
+chmod 664 /etc/motd
+chmod 666 /dev/tty[pqrs]*
+
+echo -n starting daemons:
+/sbin/syslogd; echo -n ' syslogd'
+/sbin/inetd; echo -n ' inet'
+echo .
+
+
+date