/[vps]/baselayout-vserver/branches/baselayout-1_12/sbin/rc-daemon.sh
Gentoo

Diff of /baselayout-vserver/branches/baselayout-1_12/sbin/rc-daemon.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 413 Revision 414
84 84
85# void rc_setup_daemon_vars(void) 85# void rc_setup_daemon_vars(void)
86# 86#
87# Setup our vars based on the start-stop-daemon command 87# Setup our vars based on the start-stop-daemon command
88rc_setup_daemon_vars() { 88rc_setup_daemon_vars() {
89 local name i
90 local -a sargs=( "${args%% \'--\' *}" ) 89 local -a sargs=( "${args%% \'--\' *}" ) eargs=()
91 local -a eargs
92 local x="${args// \'--\' /}" 90 local x="${args// \'--\' /}" i=
93 [[ ${x} != "${args}" ]] && eargs=( "${args##* \'--\' }" ) 91 [[ ${x} != "${args}" ]] && eargs=( "${args##* \'--\' }" )
94 92
95 eval rc_shift_args "${sargs[@]}" 93 eval rc_shift_args "${sargs[@]}"
96 94
97 [[ -z ${cmd} ]] && cmd="${name}" 95 [[ -n ${name} ]] && cmd="${name}"
98 96
99 # We may want to launch the daemon with a custom command 97 # We may want to launch the daemon with a custom command
100 # This is mainly useful for debugging with apps like valgrind, strace 98 # This is mainly useful for debugging with apps like valgrind, strace
101 local bash_service="$( bash_variable "${SVCNAME}" )" 99 local bash_service="$( bash_variable "${SVCNAME}" )"
102 if [[ -n ${RC_DAEMON} ]]; then 100 if [[ -n ${RC_DAEMON} ]]; then
153 fi 151 fi
154 done 152 done
155 ${e} || return 0 153 ${e} || return 0
156 fi 154 fi
157 else 155 else
158 kill -s "${signal}" "${pid}" 2>/dev/null 156 [[ ${i} == "0" ]] && kill -s "${signal}" "${pid}" 2>/dev/null
159 [[ ! -d "/proc/${pid}" ]] && return 0 157 [[ ! -d "/proc/${pid}" ]] && return 0
160 fi 158 fi
161 LC_ALL=C /bin/sleep "${s}" 159 LC_ALL=C /bin/sleep "${s}"
162 done 160 done
163 161
352# Provide a wrapper to start-stop-daemon 350# Provide a wrapper to start-stop-daemon
353# Return the result of start_daemon or stop_daemon depending on 351# Return the result of start_daemon or stop_daemon depending on
354# how we are called 352# how we are called
355start-stop-daemon() { 353start-stop-daemon() {
356 local args="$( requote "$@" )" result i 354 local args="$( requote "$@" )" result i
357 local cmd pidfile pid stopping signal nothing=false 355 local cmd name pidfile pid stopping signal nothing=false
358 local daemonfile= 356 local daemonfile=
359 local -a RC_DAEMONS=() RC_PIDFILES=() 357 local -a RC_DAEMONS=() RC_PIDFILES=()
360 358
361 if [[ -n ${SVCNAME} ]] ; then 359 if [[ -n ${SVCNAME} ]] ; then
362 daemonfile="${svcdir}/daemons/${SVCNAME}" 360 daemonfile="${svcdir}/daemons/${SVCNAME}"

Legend:
Removed from v.413  
changed lines
  Added in v.414

  ViewVC Help
Powered by ViewVC 1.1.20