summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-03-23 01:25:51 +0000
committerjkh <jkh@FreeBSD.org>1995-03-23 01:25:51 +0000
commitb78acc64020a93daf9c1c1651623b5b6c6d1f6b7 (patch)
treee2434c2147331347f87b31eec2061838fba0a76e /etc
parenteab2c349799b5be274b03a396e9730509da13f9d (diff)
downloadFreeBSD-src-b78acc64020a93daf9c1c1651623b5b6c6d1f6b7.zip
FreeBSD-src-b78acc64020a93daf9c1c1651623b5b6c6d1f6b7.tar.gz
Add a home for system maintainance tasks.
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.maint71
1 files changed, 71 insertions, 0 deletions
diff --git a/etc/rc.maint b/etc/rc.maint
new file mode 100644
index 0000000..641b133
--- /dev/null
+++ b/etc/rc.maint
@@ -0,0 +1,71 @@
+#!/bin/sh
+# $Id: rc,v 1.50 1995/03/22 03:29:52 ache Exp $
+# From: @(#)rc 5.27 (Berkeley) 6/5/91
+
+# Various maintainance tasks to be done as the system is coming up
+
+echo '** Begin system maintainance tasks **'
+
+# /var/crash should be a directory or a symbolic link
+# to the crash directory if core dumps are to be saved.
+if [ "X${savecore}" = X"YES" -a -d /var/crash ]; then
+ echo; echo -n checking for core dump...
+ savecore /var/crash
+ echo done.
+fi
+
+# clean up left-over files
+rm -f /etc/nologin
+rm -f /var/spool/lock/*
+rm -f /var/spool/uucp/.Temp/*
+(cd /var/run && { rm -rf -- *; cp /dev/null utmp; chmod 644 utmp; })
+
+echo 'system logger'
+rm -f /dev/log
+syslogd
+
+# Check the quotas
+if [ "X${check_quotas}" = X"YES" ]; then
+ echo 'checking quotas:'
+ quotacheck -a
+ echo ' done.'
+ quotaon -a
+fi
+
+# build ps databases
+kvm_mkdb
+dev_mkdb
+
+# snapshot any kernel -c changes back to disk
+echo 'check for kernel -c changes'
+/sbin/dset -q
+
+# Whack the pty perms back into shape.
+chmod 666 /dev/tty[pqrs]*
+
+# check the password temp/lock file
+if [ -f /etc/ptmp ]
+then
+ logger -s -p auth.err \
+ "password file may be incorrect -- /etc/ptmp exists"
+fi
+
+# Recover vi editor files.
+virecovery=/var/tmp/vi.recover/recover.*
+if [ "$virecovery" != "/var/tmp/vi.recover/recover.*" ]; then
+ echo 'Recovering vi editor sessions'
+ for i in $virecovery; do
+ sendmail -t < $i
+ done
+fi
+
+echo clearing /tmp
+
+# prune quickly with one rm, then use find to clean up /tmp/[lq]*
+# (not needed with mfs /tmp, but doesn't hurt there...)
+(cd /tmp && rm -rf [a-km-pr-zA-Z]* &&
+ find -d . ! -name . ! -name lost+found ! -name quotas -exec rm -rf -- {} \;)
+
+if [ "X${accounting}" = X"YES" -a -d /var/account ]; then
+ echo 'turning on accounting'; accton /var/account/acct
+fi
OpenPOWER on IntegriCloud