summaryrefslogtreecommitdiff
path: root/sh/runscript.sh.in
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2011-04-22 07:30:10 -0500
committerWilliam Hubbs <williamh@gentoo.org>2011-05-11 14:54:41 -0500
commit40341fcd7e66b8a72e0407bb509d149305aa529a (patch)
tree76ec76d0fa605f5a91c7f353a6263f859fcf1b04 /sh/runscript.sh.in
parent8fcaba9a22ac0deda7dc6a8d5f270d1df08f9966 (diff)
downloadopenrc-40341fcd7e66b8a72e0407bb509d149305aa529a.tar.gz
openrc-40341fcd7e66b8a72e0407bb509d149305aa529a.tar.bz2
openrc-40341fcd7e66b8a72e0407bb509d149305aa529a.tar.xz
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
Diffstat (limited to 'sh/runscript.sh.in')
-rw-r--r--sh/runscript.sh.in12
1 files changed, 12 insertions, 0 deletions
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"