Ensure that our scripts call prefixed runscript.

This commit is contained in:
Roy Marples 2008-03-02 21:14:01 +00:00
parent a12dbdc6c9
commit 67c5fd6bb8
56 changed files with 89 additions and 75 deletions

View File

@ -6,7 +6,9 @@ NAME= openrc
VERSION= 0.1
PKG= ${NAME}-${VERSION}
SUBDIR= conf.d doc etc init.d man net runlevels sh src
SUBDIR= conf.d doc etc init.d man net sh src
# We need to ensure that runlevels is done last
SUBDIR+= runlevels
INSTALLAFTER= _installafter

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,8 +1,8 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
command=@PREFIX@/sbin/avahi-dnsconfd
command=@PKG_PREFIX@/sbin/avahi-dnsconfd
command_args="${avahi_dnsconfd_args} -D"
pidfile=@VARBASE@/run/avahi-dnsconfd.pid
name="Avahi DNS Configuration Daemon"

View File

@ -1,8 +1,8 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
command=@PREFIX@%%/sbin/avahi-daemon
command=@PKG_PREFIX@/sbin/avahi-daemon
command_args="${avahid_args} -D"
pidfile=@VARBASE@/run/avahi-daemon/pid
name="Avahi Service Advertisement Daemon"

View File

@ -1,8 +1,8 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
command=@PREFIX@%%/bin/dbus-daemon
command=@PKG_PREFIX@/bin/dbus-daemon
pidfile=@VARBASE@/run/dbus/dbus.pid
command_args="${dbusd_args---system}"
name="Message Bus Daemon"

View File

@ -1,8 +1,8 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
command=@PREFIX@/sbin/dnsmasq
command=@PKG_PREFIX@/sbin/dnsmasq
command_args=${dnsmasq_args}
pidfile=@VARBASE@/run/dnsmasq.pid
required_files=/etc/dnsmasq.conf

View File

@ -1,8 +1,8 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
command=@PREFIX@/sbin/hald
command=@PKG_PREFIX@/sbin/hald
pidfile=@VARBASE@/run/hald/hald.pid
command_args="${hald_args}"
name="Hardware Abstraction Layer Daemon"

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,14 +1,14 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
vpn=${SVCNAME#*.}
name="OpenVPN"
[ "${vpn}" != "openvpn" ] && name="${name} (${vpn})"
command=@PREFIX@/sbin/openvpn
command=@PKG_PREFIX@/sbin/openvpn
pidfile=@VARBASE@/run/"${SVCNAME}".pid
openvpn_dir=${openvpn_dir:-@PREFIX@/etc/openvpn}
openvpn_dir=${openvpn_dir:-@PKG_PREFIX@/etc/openvpn}
openvpn_config=${openvpn_config:-${openvpn_dir}/${vpn}.conf}
command_args="${openvpn_args} --daemon --config ${openvpn_config} --writepid ${pidfile}"
required_dirs="${openvpn_dir}"

View File

@ -1,8 +1,8 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
command=@PREFIX@/sbin/polkitd
command=@PKG_PREFIX@/sbin/polkitd
pidfile=@VARBASE@/run/polkitd/polkitd.pid
command_args="${polkitd_args}"
name="PolicyKit Daemon"

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

View File

@ -1,12 +1,12 @@
# Install rules for our scripts
# Copyright 2007-2008 Roy Marples <roy@marples.name>
_IN_SH= ls -1 | sed -n -e 's:\.in$$::p' | xargs
_IN_SH= ls -1 | sed -n -e 's:\.in$$::p' | xargs; echo
_IN!= ${_IN_SH}
OBJS+= ${_IN}$(shell ${_IN_SH})
# We store the contents of the directory for ease of use in Makefiles
_CONTENTS_SH= ls -1 | grep -v "\(Makefile\|.in$$\)" | sed -e 's:\.in$$::g' | xargs
_CONTENTS_SH= ls -1 | grep -v Makefile | sed -e 's:\.in$$::g' | sort -u | xargs
_CONTENTS!= ${_CONTENTS_SH}
CONTENTS= ${_CONTENTS}$(shell ${_CONTENTS_SH})
@ -14,10 +14,13 @@ include ${MK}/sys.mk
include ${MK}/os.mk
# Tweak our shell scripts
.SUFFIXES: .sh.in
.SUFFIXES: .sh.in .in
.sh.in.sh:
sed -e 's:@SHELL@:${SH}:g' -e 's:@LIB@:${LIBNAME}:g' -e 's:@PREFIX@:${PREFIX}:g' -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g' $< > $@
.in:
sed -e 's:@PREFIX@:${PREFIX}:g' -e 's:@PKG_PREFIX@:${PKG_PREFIX}:g' $< > $@
all: ${OBJS}
realinstall: ${BIN} ${CONF} ${CONF_APPEND}

View File

@ -17,11 +17,20 @@ all:
install:
if ! test -d "${BOOTDIR}"; then \
${INSTALL} -d ${BOOTDIR} || exit $$?; \
for x in ${BOOT}; do ln -snf /etc/init.d/"$$x" ${BOOTDIR}/"$$x" || exit $$?; done \
for x in ${BOOT}; do \
if test -n "${PREFIX}"; then \
grep -q "keyword .*noprefix" ${PREFIX}/etc/init.d/"$$x" && continue; \
fi; \
ln -snf ${PREFIX}/etc/init.d/"$$x" ${BOOTDIR}/"$$x" || exit $$?; \
done \
fi
if ! test -d "${DEFAULTDIR}"; then \
${INSTALL} -d ${DEFAULTDIR} || exit $$?; \
for x in ${DEFAULT}; do ln -snf /etc/init.d/"$$x" ${DEFAULTDIR}/"$$x" || exit $$?; done \
for x in ${DEFAULT}; do \
if test -n "${PREFIX}"; then \
grep -q "keyword .*noprefix" ${PREFIX}/etc/init.d/"$$x" && continue; \
fi; \
ln -snf ${PREFIX}/etc/init.d/"$$x" ${DEFAULTDIR}/"$$x" || exit $$?; done \
fi
clean:

View File

@ -13,7 +13,7 @@ include ${MK}/scripts.mk
_installafter:
${INSTALL} -d ${DESTDIR}/${PREFIX}/etc/init.d
@# Provide an init script for the loopback interface
ln -snf ${RC_LIB}/sh/net.sh ${DESTDIR}/${PREFIX}/etc/init.d/${NET_LO} || exit $$?
ln -snf ${PREFIX}/${RC_LIB}/sh/net.sh ${DESTDIR}/${PREFIX}/etc/init.d/${NET_LO} || exit $$?
@# Put functions.sh into the init.d dir so 3rd party apps don't have to
@# be multilib aware
ln -snf ${RC_LIB}/sh/functions.sh ${DESTDIR}/${PREFIX}/etc/init.d || exit $$?
ln -snf ${PREFIX}/${RC_LIB}/sh/functions.sh ${DESTDIR}/${PREFIX}/etc/init.d || exit $$?

View File

@ -43,8 +43,8 @@ _sanitize_path()
local IFS=":" p= path=
for p in ${PATH}; do
case "${p}" in
@PREFIX@/lib/rc/sbin|/bin|/sbin|/usr/bin|/usr/sbin|@PKG_PREFIX@/bin|@PKG_PREFIX@/sbin);;
*) path="${path}:${p}";;
@PREFIX@/lib/rc/sbin|@PREFIX@/bin|@PREFIX@/sbin|/usr/bin|/usr/sbin|@PKG_PREFIX@/bin|@PKG_PREFIX@/sbin);;
*) path="${path}${path:+:}${p}";;
esac
done
@ -60,7 +60,7 @@ if [ -n "${ZSH_VERSION}" ]; then
fi
# Add our bin to $PATH
export PATH="@PREFIX@/lib/rc/bin:/bin:/sbin:/usr/bin:/usr/sbin:@PKG_PREFIX@/bin:@PKG_PREFIX@/sbin:$(_sanitize_path "${PATH}")"
export PATH="@PREFIX@/lib/rc/bin:@PREFIX@/bin:@PREFIX@/sbin:/usr/bin:/usr/sbin:@PKG_PREFIX@/bin:@PKG_PREFIX@/sbin:$(_sanitize_path "${PATH}")"
unset _sanitize_path
for arg; do

View File

@ -4,7 +4,7 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
. /etc/init.d/functions.sh
. @PREFIX@/etc/init.d/functions.sh
config() {
[ -n "$*" ] && echo "${SVCNAME} config $*" >&3
@ -31,7 +31,7 @@ depend() {
:
}
for _dir in /etc/init.d /usr/local/etc/init.d; do
for _dir in @PREFIX@/etc/init.d @PKG_PREFIX@/etc/init.d; do
[ -d "${_dir}" ] || continue
cd "${_dir}"
for SVCNAME in *; do
@ -39,7 +39,7 @@ for _dir in /etc/init.d /usr/local/etc/init.d; do
# Only generate dependencies for runscripts
read one two < "${SVCNAME}"
[ "${one}" = "#!/sbin/runscript" ] || continue
[ "${one}" = "#!@PREFIX@/sbin/runscript" ] || continue
unset one two
export SVCNAME=${SVCNAME##*/}
@ -59,7 +59,7 @@ for _dir in /etc/init.d /usr/local/etc/init.d; do
. "${_dir}/../conf.d/${SVCNAME}"
fi
[ -e /etc/rc.conf ] && . /etc/rc.conf
[ -e @PREFIX@/etc/rc.conf ] && . @PREFIX@/etc/rc.conf
if . "${_dir}/${SVCNAME}"; then
echo "${SVCNAME}" >&3

View File

@ -1,4 +1,4 @@
#!/sbin/runscript
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
@ -21,7 +21,7 @@ depend()
need localmount
after bootmisc
provide net
keyword nojail
keyword nojail noprefix
case "${IFACE}" in
lo|lo0);;

View File

@ -4,7 +4,7 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
. /etc/init.d/functions.sh
. @PREFIX@/etc/init.d/functions.sh
. "${RC_LIBDIR}"/sh/rc-functions.sh
# Support LiveCD foo
@ -59,7 +59,7 @@ elif [ -e "/etc/conf.d/${SVCNAME}" ]; then
fi
# Load any system overrides
[ -e /etc/rc.conf ] && . /etc/rc.conf
[ -e @PREFIX@/etc/rc.conf ] && . @PREFIX@/etc/rc.conf
# Apply any ulimit defined
[ -n "${rc_ulimit:-${RC_ULIMIT}}" ] && ulimit ${rc_ulimit:-${RC_ULIMIT}}