wok rev 2384
squid: Add reload command. Use squid to start/stop daemon.
author | Eric Joseph-Alexandre <erjo@slitaz.org> |
---|---|
date | Mon Mar 09 22:35:43 2009 +0100 (2009-03-09) |
parents | aecb1ba84c83 |
children | 0e9145fbcce7 |
files | squid/stuff/etc/init.d/squid |
line diff
1.1 --- a/squid/stuff/etc/init.d/squid Mon Mar 09 20:19:06 2009 +0100 1.2 +++ b/squid/stuff/etc/init.d/squid Mon Mar 09 22:35:43 2009 +0100 1.3 @@ -27,7 +27,7 @@ 1.4 [ -n "$cache_dir" ] || cache_dir=/var/cache 1.5 if [ -d "$cache_dir" -a ! -d "$cache_dir/00" ]; then 1.6 echo -n "Creating squid spool directory structure" 1.7 - $DAEMON -z 1.8 + $DAEMON -z > /dev/null 2>&1 1.9 status 1.10 fi 1.11 echo -n "Starting $DESC: $NAME... " 1.12 @@ -41,25 +41,33 @@ 1.13 exit 1 1.14 fi 1.15 echo -n "Stopping $DESC: $NAME... " 1.16 - kill `cat $PIDFILE` 1.17 + $DAEMON -k kill 1.18 status 1.19 + rm -f $PIDFILE 1.20 sleep 2 1.21 ;; 1.22 + reload) 1.23 + if [ ! -f $PIDFILE ] ; then 1.24 + echo "$NAME is not running." 1.25 + exit 1 1.26 + fi 1.27 + echo -n "Reloading $DESC configuration... " 1.28 + $DAEMON -k reconfigure 1.29 + status 1.30 + ;; 1.31 restart) 1.32 if [ ! -f $PIDFILE ] ; then 1.33 echo "$NAME is not running." 1.34 exit 1 1.35 fi 1.36 echo -n "Restarting $DESC: $NAME... " 1.37 - kill `cat $PIDFILE` 1.38 - sleep 2 1.39 - $DAEMON $OPTIONS 1.40 + $DAEMON -k kill && $DAEMON $OPTIONS 1.41 status 1.42 sleep 2 1.43 ;; 1.44 *) 1.45 echo "" 1.46 - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.47 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|reload|restart]" 1.48 echo "" 1.49 exit 1 1.50 ;;