summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.d.misc/dnsmasq8
-rw-r--r--init.d.misc/named2
-rwxr-xr-xinit.d/halt.sh9
-rwxr-xr-xsh/runscript.sh13
4 files changed, 26 insertions, 6 deletions
diff --git a/init.d.misc/dnsmasq b/init.d.misc/dnsmasq
index b068c87..f4ff121 100644
--- a/init.d.misc/dnsmasq
+++ b/init.d.misc/dnsmasq
@@ -29,8 +29,16 @@ command_args=${dnsmasq_args}
pidfile=/var/run/dnsmasq.pid
required_files=/usr/local/etc/dnsmasq.conf
+extra_started_commands="reload"
+
depend() {
provide dns
need localmount net
after bootmisc
}
+
+reload() {
+ ebegin "Reloading ${SVCNAME}"
+ start-stop-daemon --signal SIGHUP --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/init.d.misc/named b/init.d.misc/named
index 7e853ab..901502a 100644
--- a/init.d.misc/named
+++ b/init.d.misc/named
@@ -27,7 +27,7 @@ command=/usr/sbin/named
command_args=${named_args}
pidfile=/var/run/named/pid
name="Domain Name server"
-extra_commands="reload"
+extra_started_commands="reload"
namedb=/etc/namedb
named_uid=${named_uid:-bind}
diff --git a/init.d/halt.sh b/init.d/halt.sh
index 2e4dabe..aa73a6d 100755
--- a/init.d/halt.sh
+++ b/init.d/halt.sh
@@ -58,14 +58,15 @@ if [ "${RC_SYS}" = "VPS" ]; then
fi
# If $svcdir is still mounted, preserve it if we can
-
mnt=$(mountinfo --node "${RC_SVCDIR}")
if [ -n "${mnt}" -a -w "${RC_LIBDIR}" ]; then
f_opts="-m -c"
[ "${RC_UNAME}" = "Linux" ] && f_opts="-c"
- if [ -n "$(fuser ${f_opts} "${svcdir}" 2>/dev/null)" ]; then
- fuser -k ${f_opts} "${svcdir}" >/dev/null 2>&1
- sleep 2
+ if type fuser >/dev/null 2>&1; then
+ if [ -n "$(fuser ${f_opts} "${svcdir}" 2>/dev/null)" ]; then
+ fuser -k ${f_opts} "${svcdir}" >/dev/null 2>&1
+ sleep 2
+ fi
fi
cp -p "${RC_SVCDIR}"/deptree "${RC_SVCDIR}"/depconfig \
"${RC_SVCDIR}"/softlevel "${RC_SVCDIR}"/nettree \
diff --git a/sh/runscript.sh b/sh/runscript.sh
index 44ebd81..641febc 100755
--- a/sh/runscript.sh
+++ b/sh/runscript.sh
@@ -144,7 +144,8 @@ fi
while [ -n "$1" ]; do
# See if we have the required function and run it
- for _cmd in describe start stop ${extra_commands:-${opts}}; do
+ for _cmd in describe start stop ${extra_commands:-${opts}} \
+ ${extra_started_commands}; do
if [ "${_cmd}" = "$1" ]; then
if type "$1" >/dev/null 2>&1; then
# If we're in the background, we may wish to fake some
@@ -159,6 +160,16 @@ while [ -n "$1" ]; do
fi
done
fi
+ # Check to see if we need to be started before we can run
+ # this command
+ for _cmd in ${extra_started_commands}; do
+ if [ "${_cmd}" = "$1" ]; then
+ if ! service_started "${SVCNAME}"; then
+ eerror "${SVCNAME}: cannot \`$1' as it has not been started"
+ exit 1
+ fi
+ fi
+ done
unset _cmd
if type "$1"_pre >/dev/null 2>&1; then
"$1"_pre || exit $?