diff options
author | Benedikt Boehm <hollow@gentoo.org> | 2005-09-26 14:29:47 +0000 |
---|---|---|
committer | Benedikt Boehm <hollow@gentoo.org> | 2005-09-26 14:29:47 +0000 |
commit | 04e3d8d8d4d5099d0be47fc3db870bd5f9ffc134 (patch) | |
tree | 0a263ff3b2d8bd27d58ed29fc8cf551f2b58c2d4 /sbin/rc-daemon.sh | |
parent | fix init timeout (diff) | |
download | baselayout-vserver-04e3d8d8d4d5099d0be47fc3db870bd5f9ffc134.tar.gz baselayout-vserver-04e3d8d8d4d5099d0be47fc3db870bd5f9ffc134.tar.bz2 baselayout-vserver-04e3d8d8d4d5099d0be47fc3db870bd5f9ffc134.zip |
sync with baselayout trunk, rev 1550
svn path=/baselayout-vserver/trunk/; revision=41
Diffstat (limited to 'sbin/rc-daemon.sh')
-rwxr-xr-x | sbin/rc-daemon.sh | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sbin/rc-daemon.sh b/sbin/rc-daemon.sh index fab3577..e5cc63e 100755 --- a/sbin/rc-daemon.sh +++ b/sbin/rc-daemon.sh @@ -358,8 +358,17 @@ start-stop-daemon() { # We started the daemon sucessfully # so we add it to our state local max="${#RC_DAEMONS[@]}" - RC_DAEMONS[max]="${cmd}" - RC_PIDFILES[max]="${pidfile}" + for (( i=0; i<${max}; i++ )); do + if [[ ${RC_DAEMONS[i]} == "{cmd}" \ + && ${RC_PIDFILES[i]}="${pidfile}" ]]; then + break + fi + done + + if [[ ${i} == "${max}" ]]; then + RC_DAEMONS[max]="${cmd}" + RC_PIDFILES[max]="${pidfile}" + fi fi fi |