Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 70321 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]
fix locale issue with last patch
rc-daemon.sh.diff (text/plain), 1.93 KB, created by
Roy Marples (RETIRED)
on 2005-10-10 13:59:33 UTC
(
hide
)
Description:
fix locale issue with last patch
Filename:
MIME Type:
Creator:
Roy Marples (RETIRED)
Created:
2005-10-10 13:59:33 UTC
Size:
1.93 KB
patch
obsolete
>--- rc-daemon.sh 2005-09-08 15:40:02.000000000 +0100 >+++ /lib/rcscripts/sh/rc-daemon.sh 2005-10-10 16:01:09.000000000 +0100 >@@ -68,6 +68,9 @@ > --pid=*) > pidfile="${1##--pid=}" > ;; >+# --retry) >+# addvar="RC_RETRY_COUNT" >+# ;; > -s|--signal) > addvar="signal" > ;; >@@ -128,23 +131,33 @@ > # 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 >- (( s=${RC_RETRY_TIMEOUT}/10 )) >+ s=$( LC_ALL=C awk "BEGIN { print ${RC_RETRY_TIMEOUT}/10 }" ) > > 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/${p}" ]]; 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 +280,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