aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-06-25 11:00:12 +0200
committerKurt J. Bosch <kjb-temp-2009@alpenjodel.de>2011-06-28 14:33:17 +0200
commit7a37977456afa9b11467cfb9feef450274346202 (patch)
tree6495001395a347d64caa057f6e9dab76da4a2092 /functions
parent52299efc246f6f83aac76b39330845aa93742542 (diff)
downloadinitscripts-7a37977456afa9b11467cfb9feef450274346202.tar.xz
Fix local statements missing in ck_depends, ck_pidfile, do_unlock, kill_everything
Diffstat (limited to 'functions')
-rw-r--r--functions4
1 files changed, 4 insertions, 0 deletions
diff --git a/functions b/functions
index c6416d9..6e4fc3a 100644
--- a/functions
+++ b/functions
@@ -210,6 +210,7 @@ start_daemon() {
# Never use this function, it causes daemons to be stoped in the wrong order.
# The only way to start a daemon at boot is to add it to the DAEMONS array.
ck_depends() {
+ local daemon
for daemon in "$@"; do
ck_daemon "$daemon" && start_daemon "$daemon"
done
@@ -251,6 +252,7 @@ get_pid() {
# Check if PID-file $1 is still the active PID-file for command $2
ck_pidfile() {
if [[ -f "$1" ]]; then
+ local fpid ppid
read -r fpid <"$1"
ppid=$(get_pid $2)
[[ "$fpid" = "$ppid" ]] && return 0
@@ -270,6 +272,7 @@ kill_everything() {
# $1 = where we are being called from.
# This is used to determine which hooks to run.
# Find daemons NOT in the DAEMONS array. Shut these down first
+ local daemon
for daemon in /run/daemons/*; do
[[ -f $daemon ]] || continue
daemon=${daemon##*/}
@@ -277,6 +280,7 @@ kill_everything() {
done
# Shutdown daemons in reverse order
+ local i
for (( i=${#DAEMONS[@]}-1; i>=0; i-- )); do
[[ ${DAEMONS[i]} = '!'* ]] && continue
ck_daemon ${DAEMONS[i]#@} || stop_daemon ${DAEMONS[i]#@}