[csw-devel] SF.net SVN: gar:[5315] csw/mgar/pkg/squid/trunk/files/cswsquid
valholla at users.sourceforge.net
valholla at users.sourceforge.net
Thu Jun 18 23:12:58 CEST 2009
Revision: 5315
http://gar.svn.sourceforge.net/gar/?rev=5315&view=rev
Author: valholla
Date: 2009-06-18 21:12:57 +0000 (Thu, 18 Jun 2009)
Log Message:
-----------
tweak postinstall
Modified Paths:
--------------
csw/mgar/pkg/squid/trunk/files/cswsquid
Modified: csw/mgar/pkg/squid/trunk/files/cswsquid
===================================================================
--- csw/mgar/pkg/squid/trunk/files/cswsquid 2009-06-18 20:50:25 UTC (rev 5314)
+++ csw/mgar/pkg/squid/trunk/files/cswsquid 2009-06-18 21:12:57 UTC (rev 5315)
@@ -6,6 +6,7 @@
CSWSBIN=${CSWPREFIX}/sbin
SQUID_DAEMON=${CSWSBIN}/squid
SQUID_CONF=${CSWETC}/squid.conf
+SQUID_PIDFILE=/var/opt/csw/squid/logs/squid.pid
if [ -f /lib/svc/share/smf_include.sh ]; then
. /lib/svc/share/smf_include.sh
@@ -14,13 +15,13 @@
case "$1" in
'start')
if [ -x ${SQUID_DAEMON} -a -f ${SQUID_CONF} ]; then
- if [ "_xx_" != "_x`pgrep squid`x_" ]; then
+ if [ -f ${SQUID_PIDFILE} ]; then
echo 'squid server is already running'
- exit 0
+ exit 0
else
echo 'starting squid server.'
${SQUID_DAEMON} -D &
- exit 0
+ exit 0
fi
else
echo '**** NOTICE ****'
@@ -32,27 +33,26 @@
;;
'stop')
if [ -x ${SQUID_DAEMON} -a -f ${SQUID_CONF} ]; then
- if [ "_xx_" != "_x`pgrep squid`x_" ]; then
+ if [ -f ${SQUID_PIDFILE} ]; then
## stop gracefully
- echo 'stopping squid server... please wait for cleanup...'
- ${SQUID_DAEMON} -k shutdown
- if [ "_xx_" != "_x`pgrep squid`x_" ]; then
- echo 'squid server still running, killing...'
- pkill -9 squid
- fi
- exit 0
+ echo 'stopping squid server... please wait for cleanup...'
+ ${SQUID_DAEMON} -k shutdown
+ rm -f /var/opt/csw/squid/logs/squid.pid
+ exit 0
else
## Not running
echo 'squid server is already down'
- exit 0
+ rm -f /var/opt/csw/squid/logs/squid.pid
+ exit 0
fi
else
echo '**** NOTICE ****'
echo 'Squid server not properly installed'
echo 'Forcing Down!'
pkill -9 squid
+ rm -f /var/opt/csw/squid/logs/squid.pid
exit 1
- fi
+ fi
;;
*)
@@ -62,3 +62,4 @@
esac
exit 0
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list