aboutsummaryrefslogtreecommitdiff
path: root/sh/init-common-post.sh
blob: a89b12fe98b4d346afbbac0c7f2fd09d837b4c5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 echo 2>/dev/null >"${RC_SVCDIR}/.test.$$" ; 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 :