[Pkg-sysvinit-commits] r943 -
sysvinit/trunk/debian/initscripts/etc/init.d
Petter Reinholdtsen
pere at costa.debian.org
Wed Sep 20 11:24:30 UTC 2006
Author: pere
Date: 2006-09-20 11:24:30 +0000 (Wed, 20 Sep 2006)
New Revision: 943
Modified:
sysvinit/trunk/debian/initscripts/etc/init.d/bootclean
sysvinit/trunk/debian/initscripts/etc/init.d/umountfs
sysvinit/trunk/debian/initscripts/etc/init.d/umountnfs.sh
Log:
Leftover from making tmpfs on /var/run and /var/lock optional.
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/bootclean
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/bootclean 2006-09-20 10:16:20 UTC (rev 942)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/bootclean 2006-09-20 11:24:30 UTC (rev 943)
@@ -2,7 +2,7 @@
#
# bootclean
#
-# Clean /tmp
+# Clean /tmp. Clean /var/run and /var/lock if not mounted as tmpfs
#
# DO NOT RUN AFTER S:55bootmisc.sh and do not run this script directly
# in runlevel S. Instead write an initscript to call it.
@@ -116,12 +116,62 @@
return 0
}
+clean_lock() {
+ if [ yes = "$TMPLOCK" ] ; then
+ return 0
+ fi
+
+ cd /var/lock || { log_failure_msg "bootclean: Could not cd to /var/lock." ; return 1 ; }
+
+ [ "$VERBOSE" = no ] || log_action_begin_msg "Cleaning /var/lock"
+ report_err()
+ {
+ if [ "$VERBOSE" = no ]
+ then
+ log_failure_msg "bootclean: Failure cleaning /var/lock."
+ else
+ log_action_end_msg 1 "bootclean: Failure cleaning /var/lock"
+ fi
+ }
+ find . ! -type d \
+ -print0 | xargs -0r rm -f -- \
+ || { report_err ; return 1 ; }
+ [ "$VERBOSE" = no ] || log_action_end_msg 0
+ mkflagfile /var/lock/.clean || return 1
+ return 0
+}
+
+clean_run() {
+ if [ yes = "$TMPRUN" ] ; then
+ return 0
+ fi
+
+ cd /var/run || { log_action_end_msg 1 "bootclean: Could not cd to /var/run." ; return 1 ; }
+
+ [ "$VERBOSE" = no ] || log_action_begin_msg "Cleaning /var/run"
+ report_err()
+ {
+ if [ "$VERBOSE" = no ]
+ then
+ log_failure_msg "bootclean: Failure cleaning /var/run."
+ else
+ log_action_end_msg 1 "bootclean: Failure cleaning /var/run"
+ fi
+ }
+ find . ! -xtype d ! -name utmp ! -name innd.pid \
+ -print0 | xargs -0r rm -f -- \
+ || { report_err ; return 1 ; }
+ [ "$VERBOSE" = no ] || log_action_end_msg 0
+ mkflagfile /var/run/.clean || return 1
+ return 0
+}
+
which find >/dev/null 2>&1 || exit 1
which xargs >/dev/null 2>&1 || exit 1
# If there are flag files that have not been created by root
# then remove them
-for D in /tmp
+for D in /tmp /var/run /var/lock
do
if [ -f $D/.clean ]
then
@@ -137,9 +187,11 @@
fi
done
-[ -f /tmp/.clean ] && exit 0
+[ -f /tmp/.clean ] && [ -f /var/run/.clean ] && [ -f /var/lock/.clean ] && exit 0
ES=0
[ -d /tmp ] && ! [ -f /tmp/.clean ] && { clean_tmp || ES=1 ; }
+[ -d /var/run ] && ! [ -f /var/run/.clean ] && { clean_run || ES=1 ; }
+[ -d /var/lock ] && ! [ -f /var/lock/.clean ] && { clean_lock || ES=1 ; }
exit $ES
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/umountfs
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/umountfs 2006-09-20 10:16:20 UTC (rev 942)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/umountfs 2006-09-20 11:24:30 UTC (rev 943)
@@ -66,9 +66,19 @@
while read DEV MTPT FSTYPE REST
do
case "$MTPT" in
- /|/proc|/dev|/.dev|/dev/pts|/dev/shm|/proc/*|/sys|/var/run|/var/lock)
+ /|/proc|/dev|/.dev|/dev/pts|/dev/shm|/proc/*|/sys)
continue
;;
+ /var/run)
+ if [ yes = "$TMPRUN" ] ; then
+ continue
+ fi
+ ;;
+ /var/lock)
+ if [ yes = "$TMPLOCK" ] ; then
+ continue
+ fi
+ ;;
esac
case "$FSTYPE" in
proc|procfs|linprocfs|devfs|sysfs|usbfs|usbdevfs|devpts)
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/umountnfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/umountnfs.sh 2006-09-20 10:16:20 UTC (rev 942)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/umountnfs.sh 2006-09-20 11:24:30 UTC (rev 943)
@@ -48,9 +48,19 @@
while read DEV MTPT FSTYPE OPTS REST
do
case "$MTPT" in
- /|/proc|/dev|/dev/pts|/dev/shm|/proc/*|/sys|/var/run|/var/lock)
+ /|/proc|/dev|/dev/pts|/dev/shm|/proc/*|/sys)
continue
;;
+ /var/run)
+ if [ yes = "$TMPRUN" ] ; then
+ continue
+ fi
+ ;;
+ /var/lock)
+ if [ yes = "$TMPLOCK" ] ; then
+ continue
+ fi
+ ;;
esac
case "$FSTYPE" in
nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs)
More information about the Pkg-sysvinit-commits
mailing list