View | Details | Raw Unified | Return to bug 36572
Collapse All | Expand All

(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/conffiles/etc/init.d/squid3 (+156 lines)
Line 0 Link Here
1
#! /bin/sh
2
@%@UCRWARNING=# @%@
3
#
4
# squid3		Startup script for the SQUID HTTP proxy-cache.
5
#
6
# Version:	@(#)squid3.rc  1.0  07-Jul-2006  luigi@debian.org
7
#
8
### BEGIN INIT INFO
9
# Provides:          squid3
10
# Required-Start:    $network $remote_fs $syslog
11
# Required-Stop:     $network $remote_fs $syslog
12
# Should-Start:      $named
13
# Should-Stop:       $named
14
# Default-Start:     2 3 4 5
15
# Default-Stop:      0 1 6
16
# Short-Description: Squid HTTP Proxy version 3.x
17
### END INIT INFO
18
19
NAME=squid3
20
DESC="Squid HTTP Proxy 3.x"
21
DAEMON=/usr/sbin/squid3
22
PIDFILE=/var/run/$NAME.pid
23
CONFIG=/etc/squid3/squid.conf
24
SQUID_ARGS="-YC -f $CONFIG"
25
26
[ ! -f /etc/default/squid3 ] || . /etc/default/squid3
27
28
. /lib/lsb/init-functions
29
30
PATH=/bin:/usr/bin:/sbin:/usr/sbin
31
32
[ -x $DAEMON ] || exit 0
33
34
ulimit -n 65535
35
36
find_cache_dir () {
37
        w="     " # space tab
38
        res=`sed -ne '
39
                s/^'$1'['"$w"']\+[^'"$w"']\+['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
40
                t end;
41
                d;
42
                :end q' < $CONFIG`
43
        [ -n "$res" ] || res=$2
44
        echo "$res"
45
}
46
47
find_cache_type () {
48
	w=" 	" # space tab
49
	res=`sed -ne '
50
		s/^'$1'['"$w"']\+\([^'"$w"']\+\).*$/\1/p;
51
		t end;
52
		d;
53
		:end q' < $CONFIG`
54
	[ -n "$res" ] || res=$2
55
	echo "$res"
56
}
57
58
start () {
59
	cache_dir=`find_cache_dir cache_dir`
60
	cache_type=`find_cache_type cache_dir`
61
62
	#
63
    # Create spool dirs if they don't exist.
64
    #
65
	if [ "$cache_type" = "coss" -a -d "$cache_dir" -a ! -f "$cache_dir/stripe" ] || [ "$cache_type" != "coss" -a -d "$cache_dir" -a ! -d "$cache_dir/00" ]
66
	then
67
		log_warning_msg "Creating $DESC cache structure"
68
		$DAEMON -z -f $CONFIG
69
	fi
70
71
	umask 027
72
	ulimit -n 65535
73
	cd $cache_dir
74
	start-stop-daemon --quiet --start \
75
		--pidfile $PIDFILE \
76
		--exec $DAEMON -- $SQUID_ARGS < /dev/null
77
	return $?
78
}
79
80
stop () {
81
	PID=`cat $PIDFILE 2>/dev/null`
82
	start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
83
	#
84
	#	Now we have to wait until squid has _really_ stopped.
85
	#
86
	sleep 2
87
	if test -n "$PID" && kill -0 $PID 2>/dev/null
88
	then
89
		log_action_begin_msg " Waiting"
90
		cnt=0
91
		while kill -0 $PID 2>/dev/null
92
		do
93
			cnt=`expr $cnt + 1`
94
			if [ $cnt -gt 24 ]
95
			then
96
				log_action_end_msg 1
97
				return 1
98
			fi
99
			sleep 5
100
			log_action_cont_msg ""
101
		done
102
		log_action_end_msg 0
103
		return 0
104
	else
105
		return 0
106
	fi
107
}
108
109
case "$1" in
110
    start)
111
	# check ucr autostart setting
112
	if [ -f "/usr/share/univention-config-registry/init-autostart.lib" ]; then
113
		. "/usr/share/univention-config-registry/init-autostart.lib"
114
		check_autostart univention-squid squid/autostart
115
	fi
116
	log_daemon_msg "Starting $DESC" "$NAME"
117
	if start ; then
118
		log_end_msg $?
119
	else
120
		log_end_msg $?
121
	fi
122
	;;
123
    stop)
124
	log_daemon_msg "Stopping $DESC" "$NAME"
125
	if stop ; then
126
		log_end_msg $?
127
	else
128
		log_end_msg $?
129
	fi
130
	;;
131
    reload|force-reload)
132
	log_action_msg "Reloading $DESC configuration files"
133
	start-stop-daemon --stop --signal 1 \
134
		--pidfile $PIDFILE --quiet --exec $DAEMON
135
	log_action_end_msg 0
136
	;;
137
    restart)
138
	log_daemon_msg "Restarting $DESC" "$NAME"
139
	stop
140
	if start ; then
141
		log_end_msg $?
142
	else
143
		log_end_msg $?
144
	fi
145
	;;
146
    status)
147
	status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit 3
148
	;;
149
    *)
150
	echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}"
151
	exit 3
152
	;;
153
esac
154
155
exit 0
156
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/changelog (+6 lines)
Lines 1-3 Link Here
1
univention-squid (8.0.2-4) unstable; urgency=low
2
3
  * Bug #36572: Add autostart.lib support
4
5
 -- Philipp Hahn <hahn@univention.de>  Fri, 10 Apr 2015 12:34:04 +0200
6
1
univention-squid (8.0.2-3) unstable; urgency=low
7
univention-squid (8.0.2-3) unstable; urgency=low
2
8
3
  * Bug #36623: Support interfaces other then ethX
9
  * Bug #36623: Support interfaces other then ethX
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/control (+1 lines)
Lines 17-22 Depends: ${misc:Depends}, Link Here
17
 python-ipaddr,
17
 python-ipaddr,
18
 python-crypto,
18
 python-crypto,
19
 python-univention-lib,
19
 python-univention-lib,
20
 univention-base-files,
20
Breaks: squid
21
Breaks: squid
21
Recommends: univention-nagios-squid
22
Recommends: univention-nagios-squid
22
Suggests: univention-firewall
23
Suggests: univention-firewall
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/dirs (-1 lines)
Line 1 Link Here
1
usr/lib/univention-install/
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/ucslint.overrides (+4 lines)
Line 0 Link Here
1
# Foreign file
2
0004-56: conffiles/etc/init.d/squid3
3
0010-2: conffiles/etc/init.d/squid3
4
0013-2: conffiles/etc/init.d/squid3
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.conffiles (-6 lines)
Lines 1-6 Link Here
1
/etc/univention/registry.info/categories/univention-squid.cfg
2
/etc/univention/registry.info/variables/univention-squid.cfg
3
/etc/univention/templates/files/etc/squid3/squid.conf
4
/etc/univention/templates/files/etc/squid3/allowed_ldap_groups.conf
5
/etc/univention/templates/files/etc/security/packetfilter.d/20squid
6
/etc/univention/templates/files/etc/default/squid3
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.dirs (-3 lines)
Lines 1-3 Link Here
1
usr/lib/univention-server/server_password_change.d
2
usr/lib/squid3
3
usr/lib/univention-uninstall
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.postinst (-2 / +2 lines)
Lines 88-95 if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 6.0.9; the Link Here
88
	ucr commit /etc/squid3/squid.conf
88
	ucr commit /etc/squid3/squid.conf
89
fi
89
fi
90
90
91
/etc/init.d/squid3 stop
91
invoke-rc.d squid3 stop
92
/etc/init.d/squid3 start
92
invoke-rc.d squid3 start
93
93
94
# configure firewall
94
# configure firewall
95
ucr set security/packetfilter/package/univention-squid/tcp/3128/all="ACCEPT" \
95
ucr set security/packetfilter/package/univention-squid/tcp/3128/all="ACCEPT" \
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry (+3 lines)
Lines 50-52 Variables: interfaces/.*/address Link Here
50
Type: file
50
Type: file
51
File: etc/default/squid3
51
File: etc/default/squid3
52
Variables: hostname
52
Variables: hostname
53
54
Type: file
55
File: etc/init.d/squid3
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry-variables (+6 lines)
Lines 1-3 Link Here
1
[squid/autostart]
2
Description[de]=Die Variable konfiguriert den Startmodus des Web-Proxy-Dienstes. Wird sie auf 'no' oder 'disabled' gesetzt, kann der Dienst nicht gestartet werden. Wird die auf 'manually' gesetzt, erfolgt kein automatischer Start zum Systemstart, der Dienst kann aber später gezielt gestartet werden.
3
Description[en]=This variable configures the start mode of the web proxy service. If set to 'no' or 'disabled', the service cannot be started. If the variable is set to 'manually', the service isn't started during system boot, but can be enabled manually at a later point.
4
Type=str
5
Categories=service-webproxy,system-services
6
1
[squid/httpport]
7
[squid/httpport]
2
Description[de]=Ist diese Variable nicht gesetzt, ist der Web-Proxy über den Port 3128 erreichbar. Die Variable erlaubt die Konfiguration eines abweichenden Ports. Bei Verwendung von Univention Firewall muss dann zusätzlich die Paketfilterkonfiguration angepasst werden. Wird Dansguardian eingesetzt, ist dieser an Stelle von Squid unter dem konfigurierten Port erreichbar. Squid belegt dann den nächsthöheren Port.
8
Description[de]=Ist diese Variable nicht gesetzt, ist der Web-Proxy über den Port 3128 erreichbar. Die Variable erlaubt die Konfiguration eines abweichenden Ports. Bei Verwendung von Univention Firewall muss dann zusätzlich die Paketfilterkonfiguration angepasst werden. Wird Dansguardian eingesetzt, ist dieser an Stelle von Squid unter dem konfigurierten Port erreichbar. Squid belegt dann den nächsthöheren Port.
3
Description[en]=If this variable is unset, the web proxy can be accessed via port 3128. This variable allows the configuration of a different port. If Univention Firewall is used, the packet filter configuration must also be adjusted. If Dansguardian is used, it is accessible at the configured port instead of Squid. Squid then occupies the next-higher port.
9
Description[en]=If this variable is unset, the web proxy can be accessed via port 3128. This variable allows the configuration of a different port. If Univention Firewall is used, the packet filter configuration must also be adjusted. If Dansguardian is used, it is accessible at the configured port instead of Squid. Squid then occupies the next-higher port.
(-)a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-service (-4 / +3 lines)
Lines 1-5 Link Here
1
[squid3]
1
[squid]
2
description[de]=Squid Proxyserver
2
description[de]=Squid Web-Proxy Server
3
description[en]=Squid Proxyserver
3
description[en]=Squid web proxy server
4
icon=service/squid3
4
icon=service/squid3
5
programs=/usr/sbin/squid3
5
programs=/usr/sbin/squid3
6
- 

Return to bug 36572