ALT Linux Bugzilla
– Attachment 5906 Details for
Bug 29236
Некорректная остановка squid
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
Патч на squid.init
squid.init.patch (text/plain), 1.66 KB, created by
Alex Moskalenko
on 2013-08-14 15:36:54 MSK
(
hide
)
Description:
Патч на squid.init
Filename:
MIME Type:
Creator:
Alex Moskalenko
Created:
2013-08-14 15:36:54 MSK
Size:
1.66 KB
patch
obsolete
>--- squid.init.old 2013-07-31 13:38:45.643089281 +0400 >+++ squid.init 2013-08-14 15:09:06.014941702 +0400 >@@ -29,6 +29,7 @@ > > SQUID=/usr/sbin/squid > SQUID_ULIMIT=4096 >+SQUID_SHUTDOWN_TIMEOUT=60 > SQUID_CONF="/etc/squid/squid.conf" > > # Overwrite something >@@ -39,6 +40,8 @@ > LOCKFILE=/var/lock/subsys/squid > PIDFILE="$(sed -rn '/^[[:blank:]]*pid_filename[[:blank:]]/s/^[[:blank:]]*pid_filename[[:blank:]]+([^[:blank:]])+[[:blank:]]*$/\1/' "$SQUID_CONF")" > PIDFILE="${PIDFILE:-/var/run/squid.pid}" >+SQUIDUSER="$(sed -rn '/^[[:blank:]]*cache_effective_user[[:blank:]]/s/^[[:blank:]]*cache_effective_user[[:blank:]]+([^[:blank:]])+[[:blank:]]*$/\1/' "$SQUID_CONF")" >+SQUIDUSER="${SQUIDUSER:-squid}" > RETVAL=0 > > start() >@@ -61,14 +64,21 @@ > > stop() > { >- local p=$(cat "$PIDFILE" 2>/dev/null) >- if start-stop-daemon -q --pid "$PIDFILE" --user squid --stop --test >/dev/null; then >+ local p=$(cat "$PIDFILE" 2>/dev/null) t >+ if start-stop-daemon -q --pid "$PIDFILE" --user $SQUIDUSER --stop --test >/dev/null; then > msg_stopping squid > $SQUID -f "$SQUID_CONF" -k shutdown > RETVAL=$? > if [ $RETVAL = 0 ]; then >- while [ "x$(LANG=C stat -c "%U %F" /proc/$p 2>/dev/null)" = "xsquid directory" ]; do >+ t=0 >+ while [ "x$(LANG=C stat -c "%U %F" /proc/$p 2>/dev/null)" = "x$SQUIDUSER directory" ]; do > sleep 1 >+ if [ $t -ge $SQUID_SHUTDOWN_TIMEOUT ]; then >+ echo -n "timeout!" >+ failure >+ return 1 >+ fi >+ let t=$t+1 > done > rm -f "$LOCKFILE" > success >@@ -120,7 +130,7 @@ > [ -e "$LOCKFILE" ] && reload > ;; > status) >- status --pidfile "$PIDFILE" --expect-user squid squid >+ status --pidfile "$PIDFILE" --expect-user $SQUIDUSER squid > RETVAL=$? > ;; > *)
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 29236
: 5906