From 40341fcd7e66b8a72e0407bb509d149305aa529a Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Fri, 22 Apr 2011 07:30:10 -0500 Subject: do not run services if openrc did not boot the system X-Gentoo-Bug: 364159 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=364159 --- sh/runscript.sh.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sh/runscript.sh.in') diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in index 229d1ee..71935a0 100644 --- a/sh/runscript.sh.in +++ b/sh/runscript.sh.in @@ -16,6 +16,18 @@ sourcex() fi } +if [ ! -e ${RC_SVCDIR}/softlevel ]; then + eerror "You are attempting to run an openrc service on a" + eerror "system which openrc did not boot." + eerror "You may be inside a chroot or you may have used" + eerror "another initialization system to boot this system." + eerror "In this situation, you will get unpredictable results!" + eerror + eerror "If you really want to do this, issue the following command:" + eerror "touch ${RC_SVCDIR}/softlevel" + exit 1 +fi + sourcex "@SYSCONFDIR@/init.d/functions.sh" sourcex "@LIBEXECDIR@/sh/rc-functions.sh" -- cgit v1.2.3