diff options
Diffstat (limited to 'sbin/rc-daemon.sh')
-rwxr-xr-x | sbin/rc-daemon.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/rc-daemon.sh b/sbin/rc-daemon.sh index c8cccb5..7e67dcc 100755 --- a/sbin/rc-daemon.sh +++ b/sbin/rc-daemon.sh @@ -101,9 +101,8 @@ rc_setup_daemon_vars() { # We may want to launch the daemon with a custom command # This is mainly useful for debugging with apps like valgrind, strace local bash_service="$( bash_variable "${myservice}" )" - eval x=\"\$\{RC_DAEMON_${bash_service}\}\" - if [[ -n ${x} ]]; then - local -a d=( ${x} ) + if [[ -n ${RC_DAEMON} ]]; then + local -a d=( ${RC_DAEMON} ) if ${stopping}; then args="--stop" else @@ -145,7 +144,7 @@ rc_try_kill_pid() { pkill "-${signal}" -s "${pid}" pgrep -s "${pid}" >/dev/null || return 0 else - local pids="$(ps -eo pid,sid | sed -n 's/'${pid}'$//p')" + local pids="$(ps -eo pid,sid | sed -n "s/ ${pid}\$//p")" [[ -z ${pids} ]] && return 0 kill -s "${signal}" ${pids} 2>/dev/null e=false @@ -297,7 +296,7 @@ rc_stop_daemon() { else local npids for pid in ${pids} ; do - npids="${npids} $(ps -eo pid,ppid | sed -n 's/'"${pid}"'$//p')" + npids="${npids} $(ps -eo pid,ppid | sed -n "s/ ${pid}\$//p")" done pids="${pids} ${npids}" fi |