aboutsummaryrefslogtreecommitdiff
path: root/init.d/bootmisc
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-03-02 21:13:21 +0000
committerRoy Marples <roy@marples.name>2008-03-02 21:13:21 +0000
commita12dbdc6c93a7d63591610378e3e570b7c7d2143 (patch)
tree22cd968f4bb32bedf82e091c9ffee798d247c51e /init.d/bootmisc
parent7c092fbc7904be18510eed08c72cbad974db8adc (diff)
Don't check for root in prefix.
Diffstat (limited to 'init.d/bootmisc')
-rwxr-xr-xinit.d/bootmisc131
1 files changed, 0 insertions, 131 deletions
diff --git a/init.d/bootmisc b/init.d/bootmisc
deleted file mode 100755
index a66c93f3..00000000
--- a/init.d/bootmisc
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/sbin/runscript
-# Copyright 2007-2008 Roy Marples <roy@marples.name>
-# All rights reserved. Released under the 2-clause BSD license.
-
-depend()
-{
- use hostname
- need localmount
- before logger
- after clock sysctl
-}
-
-cleanup_tmp_dir()
-{
- local dir=$1
-
- mkdir -p "${dir}"
- cd "${dir}"
- if yesno ${wipe_tmp:-${WIPE_TMP:-yes}}; then
- ebegin "Wiping ${dir} directory"
- local startopts="-x . -depth" delete="-exec rm -rf -- {} ;"
-
- if [ "${RC_UNAME}" = "Linux" ]; then
- startopts=". -xdev -depth"
- # busybox find / rm cannot handle --
- delete="-delete"
- fi
-
- # Faster than find
- rm -rf -- [b-ikm-pr-zA-Z0-9\.]*
-
- find ${startopts} ! -name . \
- ! -path ./lost+found \
- ! -path "./lost+found/*" \
- ! -path ./quota.user \
- ! -path "./quota.user/*" \
- ! -path ./aquota.user \
- ! -path "./aquota.user/*" \
- ! -path ./quota.group \
- ! -path "./quota.group/*" \
- ! -path ./aquota.group \
- ! -path "./aquota.group/*" \
- ! -path ./journal \
- ! -path "./journal/*" \
- ${delete} \
- -type d -prune
- eend 0
- else
- ebegin "Cleaning ${dir} directory"
- rm -rf -- "${dir}"/.X*-lock "${dir}"/esrv* "${dir}"/kio* \
- "${dir}"/jpsock.* "${dir}"/.fam* "${dir}"/.esd* \
- "${dir}"/orbit-* "${dir}"/ssh-* "${dir}"/ksocket-* \
- "${dir}"/.*-unix
- eend 0
- fi
-}
-
-start()
-{
- if ! mkdir /.test.$$ 2>/dev/null; then
- ewarn "Skipping /var and /tmp initialization (ro root?)"
- return 0
- fi
- rmdir /.test.$$
-
- # Ensure that our basic dirs exist
- for x in /var/log /var/run /tmp; do
- if ! [ -d "${x}" ]; then
- if ! mkdir -p "${x}"; then
- eend 1 "failed to create needed directory ${x}"
- return 1
- fi
- fi
- done
-
- ebegin "Creating user login records"
- cp /dev/null /var/run/utmp
- [ -e /var/log/wtmp ] || cp /dev/null /var/log/wtmp
- chmod 0644 /var/run/utmp /var/log/wtmp
- eend 0
-
- ebegin "Cleaning /var/run"
- for x in $(find /var/run ! -type d ! -name utmp ! -name random-seed \
- ! -name ld-elf.so.hints ! -name ld.so.hints);
- do
- [ ! -f "${x}" ] && continue
- # Do not remove pidfiles of already running daemons
- case "${x}" in
- *.pid)
- start-stop-daemon --test --quiet --stop \
- --pidfile "${x}"
- [ $? -eq 0 ] && continue
- ;;
- esac
- rm -f -- "${x}"
- done
- eend 0
-
- # Clean up /tmp directories
- local tmp=
- for tmp in ${wipe_tmp_dirs-/tmp}; do
- cleanup_tmp_dir "${tmp}"
- done
- chmod +t /tmp /var/tmp
-
- # Make sure our X11 stuff have the correct permissions
- # Omit the chown as bootmisc is run before network is up
- # and users may be using lame LDAP auth #139411
- rm -rf /tmp/.ICE-unix /tmp/.X11-unix
- mkdir -p /tmp/.ICE-unix /tmp/.X11-unix
- chmod 1777 /tmp/.ICE-unix /tmp/.X11-unix
- [ -x /sbin/restorecon ] && restorecon /tmp/.ICE-unix /tmp/.X11-unix
-
- # Create an 'after-boot' dmesg log
- if [ "${RC_SYS}" != "VPS" ]; then
- dmesg > /var/log/dmesg
- chmod 640 /var/log/dmesg
- fi
-
- rm -f /etc/nologin
-}
-
-stop()
-{
- # Write a halt record if we're shutting down
- case "${RC_SOFTLEVEL}" in
- reboot|shutdown) [ "${RC_UNAME}" = "Linux" ] && halt -w;;
- esac
-
- return 0
-}