]>
git.ipfire.org Git - thirdparty/squid.git/blob - tools/sysvinit/squid.rc
3 ## Copyright (C) 1996-2017 The Squid Software Foundation and contributors
5 ## Squid software is distributed under GPLv2+ license and includes
6 ## contributions from numerous individuals and organizations.
7 ## Please see the COPYING and CONTRIBUTORS files for details.
10 # Squid Internet Object Cache startup
11 # AUTHOR: Markus Gyger <mgyger@itr.ch>
12 # This is squid's startup file /sbin/init.d/squid or /etc/init.d/squid
15 PATH
=/usr
/local
/squid
/sbin
:/usr
/sbin
:/usr
/bin
:/sbin
:/bin
22 if [ -f /sbin
/chkconfig
]
23 then if /sbin
/chkconfig squid
24 then if [ -f /var
/config
/squid.options
]
25 then .
/var
/config
/squid.options
32 elif [ -f /usr
/sbin
/rcmgr
]
33 then SQUID
=`/usr/sbin/rcmgr get SQUID 0`
34 SQUID_OPTIONS
=`/usr/sbin/rcmgr get SQUID_OPTIONS "-s"`
35 SQUID_RESPAWN
=`/usr/sbin/rcmgr get SQUID_RESPAWN 1`
38 elif [ -f /etc
/rc.config
]
55 while [ $fails -le 5 ]
56 do start
=`date +%d%H%M%S`
58 then logger
-t "$1" -p local4.notice \
59 "respawn[$$]: Exiting due to shutdown"
63 time=`expr $stop - $start`
64 [ "$time" -gt 10 ] && fails
=0
65 fails
=`expr $fails + 1`
68 logger
-t "$1" -p local4.alert \
69 "respawn[$$]: Exiting due to repeated, frequent failures"
76 echo "Start Squid Internet Object Cache"
80 echo "Stopping Squid Internet Object Cache"
84 config ||
exit 2 # Squid not enabled
86 if whence
=`type squid 2>&1`
88 if [ 0 = "${SQUID_RESPAWN-}" ]
89 then squid
${SQUID_OPTIONS-} &
90 else respawn squid
${SQUID_OPTIONS-} &
93 else echo "ERROR: $whence" >&2
99 config ||
exit 2 # Squid not enabled
101 squid
${SQUID_OPTIONS-} -k shutdown ||
exit 1
104 reconf
*|rotate|int
*|debug|check|
kill)
107 squid
${SQUID_OPTIONS-} -k "$1"
111 echo "usage: $0 {start|stop|reconfigure|rotate|interrupt|debug|check|kill}" >&2
112 echo " start start squid" >&2
113 echo " stop clean shutdown" >&2
114 echo " reconfigure reread configuration files" >&2
115 echo " rotate rotate log files" >&2
116 echo " interrupt quick clean shutdown " >&2
117 echo " debug toggle debug logging" >&2
118 echo " check check for running squid" >&2
119 echo " kill terminate squid by brute force" >&2
125 [ $?
-eq 0 ] # only 0 and 1 exit values allowed