Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 70285 Details for
Bug 107492
rc-daemon.sh does not always stop services properly
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes stopping
rc-daemon.sh.diff (text/plain), 1.70 KB, created by
Roy Marples (RETIRED)
on 2005-10-10 05:19:41 UTC
(
hide
)
Description:
Fixes stopping
Filename:
MIME Type:
Creator:
Roy Marples (RETIRED)
Created:
2005-10-10 05:19:41 UTC
Size:
1.70 KB
patch
obsolete
>--- rc-daemon.sh 2005-09-08 15:40:02.000000000 +0100 >+++ /lib/rcscripts/sh/rc-daemon.sh 2005-10-10 13:08:22.000000000 +0100 >@@ -128,7 +128,7 @@ > # via pkill > # Returns 0 if successfuly otherwise 1 > rc_try_kill_pid() { >- local pid="$1" signal="${2:-TERM}" session="${3:-false}" i s >+ local pid="$1" signal="${2:-TERM}" session="${3:-false}" i s p e > > # We split RC_RETRY_TIMEOUT into tenths of seconds > # So we return as fast as possible >@@ -137,14 +137,24 @@ > for (( i=0; i<RC_RETRY_COUNT*10; i++ )); do > if ${session} ; then > if [[ -x /usr/bin/pkill ]]; then >- /usr/bin/pkill "-${signal}" -s "${pid}" || return 0 >+ pkill "-${signal}" -s "${pid}" >+ pgrep -s "${pid}" >/dev/null || return 0 > else >- local pids=$(/bin/ps -eo pid,sid | /bin/sed -n 's/'${pid}'$//p') >+ local pids=$(ps -eo pid,sid | sed -n 's/'${pid}'$//p') > [[ -z ${pids} ]] && return 0 >- /bin/kill -s "${signal}" ${pids} 2>/dev/null >+ kill -s "${signal}" ${pids} 2>/dev/null >+ e=false >+ for p in ${pids}; do >+ if [[ -d "/proc/${pid}" ]]; then >+ e=true >+ break >+ fi >+ done >+ ${e} || return 0 > fi > else >- /bin/kill -s "${signal}" "${pid}" 2>/dev/null || return 0 >+ kill -s "${signal}" "${pid}" 2>/dev/null >+ [[ ! -d "/proc/${pid}" ]] && return 0 > fi > LC_ALL=C /bin/sleep "${s}" > done >@@ -267,12 +277,12 @@ > > for pid in ${pids}; do > if [[ ${RC_FAIL_ON_ZOMBIE} == "yes" ]]; then >- /bin/ps -p "${pid}" &>/dev/null || return 1 >+ ps -p "${pid}" &>/dev/null || return 1 > fi > > if rc_kill_pid "${pid}" false ; then > # Remove the pidfile if the process didn't >- [[ -f ${pidfile} ]] && /bin/rm -f "${pidfile}" >+ [[ -f ${pidfile} ]] && rm -f "${pidfile}" > else > retval=1 > fi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 107492
:
69401
|
70285
|
70286
|
70296
|
70321