aboutsummaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-05-29 14:15:12 +0100
committerRoy Marples <roy@marples.name>2009-05-29 14:15:12 +0100
commit83e82c452e89bf27de2a7b01bc2356c9050b2a18 (patch)
treea4f8843c7c02a6b51abb06a16f0a9a6665facc71 /sh
parent9c5faf231ccf50695270034ab63f747fa2bef1d7 (diff)
parenta518d34549fd80268e9c70d2300808b63c54825c (diff)
Merge branch 'master' of ssh://roy.marples.name/var/git/openrc
Diffstat (limited to 'sh')
-rw-r--r--sh/Makefile7
-rw-r--r--sh/functions.sh.in6
-rw-r--r--sh/init-common-post.sh.in9
-rw-r--r--sh/init-early.sh.Linux.in13
-rw-r--r--sh/init.sh.BSD.in4
-rw-r--r--sh/init.sh.Linux.in4
-rw-r--r--sh/rc-functions.sh.in10
-rw-r--r--sh/runscript.sh.in4
8 files changed, 29 insertions, 28 deletions
diff --git a/sh/Makefile b/sh/Makefile
index 7ee04338..73d46418 100644
--- a/sh/Makefile
+++ b/sh/Makefile
@@ -1,4 +1,4 @@
-DIR= ${PREFIX}/${RC_LIB}/sh
+DIR= ${LIBEXECDIR}/sh
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
@@ -13,9 +13,8 @@ include ${MK}/scripts.mk
_installafter:
${INSTALL} -d ${DESTDIR}/${INITDIR}
- @# Put functions.sh into the init.d dir so 3rd party apps don't have to
- @# be multilib aware
- ln -snf ${PREFIX}/${RC_LIB}/sh/functions.sh ${DESTDIR}/${INITDIR} || exit $$?
+ @# Put functions.sh into init for backwards compat
+ ln -snf ${LIBEXECDIR}/sh/functions.sh ${DESTDIR}/${INITDIR} || exit $$?
check test::
./runtests.sh
diff --git a/sh/functions.sh.in b/sh/functions.sh.in
index 3f4a15ac..da2e51a9 100644
--- a/sh/functions.sh.in
+++ b/sh/functions.sh.in
@@ -47,7 +47,7 @@ _sanitize_path()
local IFS=":" p= path=
for p in $PATH; do
case "$p" in
- @PREFIX@/@LIB@/rc/bin|@PREFIX@/@LIB@/rc/sbin);;
+ @LIBEXECDIR@/bin|@LIBEXECDIR@/sbin);;
@PREFIX@/bin|@PREFIX@/sbin|/usr/bin|/usr/sbin);;
@PKG_PREFIX@/bin|@PKG_PREFIX@/sbin);;
@LOCAL_PREFIX@/bin|@LOCAL_PREFIX@/sbin);;
@@ -70,7 +70,7 @@ _PREFIX=@PREFIX@
_PKG_PREFIX=@PKG_PREFIX@
_LOCAL_PREFIX=@LOCAL_PREFIX@
_LOCAL_PREFIX=${_LOCAL_PREFIX:-/usr/local}
-_PATH=@PREFIX@/@LIB@/rc/bin
+_PATH=@LIBEXECDIR@/bin
case "$_PREFIX" in
"$_PKG_PREFIX"|"$_LOCAL_PREFIX") ;;
*) _PATH="$_PATH:$_PREFIX/bin:$_PREFIX/sbin";;
@@ -104,7 +104,7 @@ else
# the last ecmd
for _e in ebegin eend error errorn einfo einfon ewarn ewarnn ewend \
vebegin veend veinfo vewarn vewend; do
- eval "$_e() { local _r; @PREFIX@/@LIB@/rc/bin/$_e \"\$@\"; _r=$?; \
+ eval "$_e() { local _r; @LIBEXECDIR@/bin/$_e \"\$@\"; _r=$?; \
export EINFO_LASTCMD=$_e; return \$_r; }"
done
unset _e
diff --git a/sh/init-common-post.sh.in b/sh/init-common-post.sh.in
index 10ec9541..0649cb31 100644
--- a/sh/init-common-post.sh.in
+++ b/sh/init-common-post.sh.in
@@ -1,10 +1,11 @@
-# Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
+# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
# mount $RC_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
-: ${RC_SVCDIR:=/@LIB@/rc/init.d}
+: ${RC_LIBEXECDIR:=@LIBEXECDIR@}
+: ${RC_SVCDIR:=@LIBEXECDIR@/init.d}
case "$(rc --sys)" in
OPENVZ|VSERVER) rm -rf "$RC_SVCDIR"/*;;
*) if mountinfo --quiet "$RC_SVCDIR"; then
@@ -16,8 +17,8 @@ case "$(rc --sys)" in
esac
retval=$?
-if [ -e "$RC_LIBDIR"/cache/deptree ]; then
- cp -p "$RC_LIBDIR"/cache/* "$RC_SVCDIR" 2>/dev/null
+if [ -e "$RC_LIBEXECDIR"/cache/deptree ]; then
+ cp -p "$RC_LIBEXECDIR"/cache/* "$RC_SVCDIR" 2>/dev/null
fi
echo sysinit >"$RC_SVCDIR"/softlevel
diff --git a/sh/init-early.sh.Linux.in b/sh/init-early.sh.Linux.in
index a533d52b..e13af131 100644
--- a/sh/init-early.sh.Linux.in
+++ b/sh/init-early.sh.Linux.in
@@ -3,8 +3,9 @@
# All rights reserved. Released under the 2-clause BSD license.
: ${CONSOLE:=/dev/console}
+: ${RC_LIBEXECDIR:=@LIBEXECDIR@}
-if [ -e "$RC_LIBDIR"/console/unicode ]; then
+if [ -e "$RC_LIBEXECDIR"/console/unicode ]; then
termencoding="%G"
kmode="-u"
else
@@ -16,10 +17,10 @@ fi
if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/consolefont \
-o -e /etc/runlevels/"$RC_BOOTLEVEL"/consolefont ]; then
printf "\033%s" "$termencoding" >"$CONSOLE" 2>/dev/null
- if [ -r "$RC_LIBDIR"/console/font -a -x /bin/setfont ]; then
- font="$(cat "$RC_LIBDIR"/console/font)"
+ if [ -r "$RC_LIBEXECDIR"/console/font -a -x /bin/setfont ]; then
+ font="$(cat "$RC_LIBEXECDIR"/console/font)"
[ -c "$CONSOLE" ] && cons="-C $CONSOLE"
- setfont $cons "$RC_LIBDIR"/console/"$font" 2>/dev/null
+ setfont $cons "$RC_LIBEXECDIR"/console/"$font" 2>/dev/null
fi
fi
@@ -27,8 +28,8 @@ fi
if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/keymaps \
-o -e /etc/runlevels/"$RC_BOOTLEVEL"/keymaps ]; then
kbd_mode $kmode -C "$CONSOLE" 2>/dev/null
- if [ -r "$RC_LIBDIR"/console/keymap ]; then
- loadkeys "$RC_LIBDIR"/console/keymap 2>/dev/null
+ if [ -r "$RC_LIBEXECDIR"/console/keymap ]; then
+ loadkeys "$RC_LIBEXECDIR"/console/keymap 2>/dev/null
fi
fi
diff --git a/sh/init.sh.BSD.in b/sh/init.sh.BSD.in
index 2472825a..de3b4366 100644
--- a/sh/init.sh.BSD.in
+++ b/sh/init.sh.BSD.in
@@ -21,7 +21,7 @@ mount_svcdir()
fi
}
-. "$RC_LIBDIR"/sh/functions.sh
+. "$RC_LIBEXECDIR"/sh/functions.sh
[ -r /etc/rc.conf ] && . /etc/rc.conf
# Disable devd until we need it
@@ -29,4 +29,4 @@ if [ -z "$RC_SYS" -a "$RC_UNAME" = "FreeBSD" ]; then
sysctl hw.bus.devctl_disable=1 >/dev/null
fi
-. "$RC_LIBDIR"/sh/init-common-post.sh
+. "$RC_LIBEXECDIR"/sh/init-common-post.sh
diff --git a/sh/init.sh.Linux.in b/sh/init.sh.Linux.in
index b98a5708..23be1952 100644
--- a/sh/init.sh.Linux.in
+++ b/sh/init.sh.Linux.in
@@ -38,7 +38,7 @@ mount_svcdir()
fi
}
-. /etc/init.d/functions.sh
+. "$RC_LIBEXECDIR"/sh/functions.sh
[ -r /etc/rc.conf ] && . /etc/rc.conf
# By default VServer already has /proc mounted, but OpenVZ does not!
@@ -68,4 +68,4 @@ if $mountproc; then
eend $?
fi
-. "$RC_LIBDIR"/sh/init-common-post.sh
+. "$RC_LIBEXECDIR"/sh/init-common-post.sh
diff --git a/sh/rc-functions.sh.in b/sh/rc-functions.sh.in
index 6e1ef01f..2a656bc8 100644
--- a/sh/rc-functions.sh.in
+++ b/sh/rc-functions.sh.in
@@ -4,7 +4,7 @@
has_addon()
{
- [ -e "$RC_LIBDIR/addons/$1.sh" -o -e /@LIB@/rcscripts/addons/"$1".sh ]
+ [ -e /@LIB@/rc/addons/"$1".sh -o -e /@LIB@/rcscripts/addons/"$1".sh ]
}
_addon_warn()
@@ -17,9 +17,9 @@ _addon_warn()
import_addon()
{
- if [ -e "$RC_LIBDIR/addons/$1.sh" ]; then
+ if [ -e /@LIB@/rc/addons/"$1".sh ]; then
_addon_warn
- . "$RC_LIBDIR/addons/$1.sh"
+ . /@LIB@/rc/addons/"$1".sh
elif [ -e /@LIB@/rcscripts/addons/"$1".sh ]; then
_addon_warn
. /@LIB@/rcscripts/addons/"$1".sh
@@ -86,6 +86,6 @@ get_bootparam()
# Add our sbin to $PATH
case "$PATH" in
- "$RC_LIBDIR"/sbin|"$RC_LIBDIR"/sbin:*);;
- *) export PATH="$RC_LIBDIR/sbin:$PATH";;
+ "$RC_LIBEXECDIR"/sbin|"$RC_LIBEXECDIR"/sbin:*);;
+ *) export PATH="$RC_LIBEXECDIR/sbin:$PATH";;
esac
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index a8172dc4..d7020e35 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -5,7 +5,7 @@
# All rights reserved. Released under the 2-clause BSD license.
. @SYSCONFDIR@/init.d/functions.sh
-. "$RC_LIBDIR"/sh/rc-functions.sh
+. @LIBEXECDIR@/sh/rc-functions.sh
# Support LiveCD foo
if [ -r /sbin/livecd-functions.sh ]; then
@@ -84,7 +84,7 @@ start()
service_inactive && _inactive=true
mark_service_inactive
fi
- start-stop-daemon --start \
+ eval start-stop-daemon --start \
--exec $command \
${procname:+--name} $procname \
${pidfile:+--pidfile} $pidfile \