From 5510451bac77cbd490599e506619aa09d9b2607b Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 21 Jun 2008 14:10:59 +0000 Subject: We need to replace @LIB@ here. --- sh/.gitignore | 2 ++ sh/Makefile | 2 +- sh/init-common-post.sh | 28 ---------------------------- sh/init-common-post.sh.in | 28 ++++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 29 deletions(-) delete mode 100644 sh/init-common-post.sh create mode 100644 sh/init-common-post.sh.in (limited to 'sh') diff --git a/sh/.gitignore b/sh/.gitignore index 028281d..19dd499 100644 --- a/sh/.gitignore +++ b/sh/.gitignore @@ -3,6 +3,8 @@ gendepends.sh net.sh rc-functions.sh runscript.sh +init-common-post.sh +init-early.sh init.sh ifwatchd-carrier.sh ifwatchd-nocarrier.sh diff --git a/sh/Makefile b/sh/Makefile index efca980..7ee0433 100644 --- a/sh/Makefile +++ b/sh/Makefile @@ -1,5 +1,5 @@ DIR= ${PREFIX}/${RC_LIB}/sh -SRCS= functions.sh.in gendepends.sh.in \ +SRCS= functions.sh.in gendepends.sh.in init-common-post.sh.in \ rc-functions.sh.in runscript.sh.in INC= init-common-post.sh rc-mount.sh functions.sh rc-functions.sh BIN= gendepends.sh init.sh runscript.sh diff --git a/sh/init-common-post.sh b/sh/init-common-post.sh deleted file mode 100644 index 61f3863..0000000 --- a/sh/init-common-post.sh +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2007-2008 Roy Marples -# All rights reserved. Released under the 2-clause BSD license. - -retval=0 - -# 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 [ "${RC_SVCDIR}" != "/" ] && mkdir "${RC_SVCDIR}/.test.$$" 2>/dev/null; then - rmdir "${RC_SVCDIR}/.test.$$" - for x in ${RC_SVCDIR:-/@LIB@/rc/init.d}/*; do - [ -e "${x}" ] || continue - case ${x##*/} in - depconfig|deptree|ksoftlevel|rc.log);; - *) rm -rf "${x}";; - esac - done -else - mount_svcdir - retval=$? -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 ${retval} diff --git a/sh/init-common-post.sh.in b/sh/init-common-post.sh.in new file mode 100644 index 0000000..61f3863 --- /dev/null +++ b/sh/init-common-post.sh.in @@ -0,0 +1,28 @@ +# Copyright 2007-2008 Roy Marples +# All rights reserved. Released under the 2-clause BSD license. + +retval=0 + +# 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 [ "${RC_SVCDIR}" != "/" ] && mkdir "${RC_SVCDIR}/.test.$$" 2>/dev/null; then + rmdir "${RC_SVCDIR}/.test.$$" + for x in ${RC_SVCDIR:-/@LIB@/rc/init.d}/*; do + [ -e "${x}" ] || continue + case ${x##*/} in + depconfig|deptree|ksoftlevel|rc.log);; + *) rm -rf "${x}";; + esac + done +else + mount_svcdir + retval=$? +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 ${retval} -- cgit v1.2.3