summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sh/init-common-post.sh')
-rw-r--r--sh/init-common-post.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/sh/init-common-post.sh b/sh/init-common-post.sh
new file mode 100644
index 00000000..ec535eb6
--- /dev/null
+++ b/sh/init-common-post.sh
@@ -0,0 +1,22 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# mount $svcdir as something we can write to if it's not rw
+# On vservers, / is always rw at this point, so we need to clean out
+# the old service state data
+if touch "${RC_SVCDIR}/.test" 2>/dev/null ; then
+ rm -rf "${RC_SVCDIR}/.test" \
+ $(ls -d1 "${RC_SVCDIR:-/lib/rcscripts/init.d}"/* 2>/dev/null | \
+ grep -Ev "/(deptree|ksoftlevel)$")
+else
+ mount_svcdir
+fi
+
+echo "sysinit" > "${RC_SVCDIR}/softlevel"
+
+# sysinit is now done, so allow init scripts to run normally
+[ -e /dev/.rcsysinit ] && rm -f /dev/.rcsysinit
+
+exit 0
+
+# vim: set ts=4 :