Univention Bugzilla – Attachment 6817 Details for
Bug 36572
squid3/autostart=manually has no effect - Missing autostart.lib support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add autostart.lib support
36572-squid-Add-autostart.lib-support.patch (text/plain), 12.38 KB, created by
Philipp Hahn
on 2015-04-10 12:47:56 CEST
(
hide
)
Description:
Add autostart.lib support
Filename:
MIME Type:
Creator:
Philipp Hahn
Created:
2015-04-10 12:47:56 CEST
Size:
12.38 KB
patch
obsolete
>From 35c4386868882f991ea009c06dd23159e0fadbb8 Mon Sep 17 00:00:00 2001 >Message-Id: <35c4386868882f991ea009c06dd23159e0fadbb8.1428662828.git.hahn@univention.de> >From: Philipp Hahn <hahn@univention.de> >Date: Fri, 10 Apr 2015 12:41:41 +0200 >Subject: [PATCH] Bug #36572 squid: Add autostart.lib support >Organization: Univention GmbH, Bremen, Germany > >Add autostart lib support to init script. >Add UCRV description. >Fix discrepancy between service definition and autostart name. >Remove several obsolete files. >--- > .../univention-squid/conffiles/etc/init.d/squid3 | 156 +++++++++++++++++++++ > .../services/univention-squid/debian/changelog | 6 + > .../services/univention-squid/debian/control | 1 + > .../services/univention-squid/debian/dirs | 1 - > .../univention-squid/debian/ucslint.overrides | 4 + > .../debian/univention-squid.conffiles | 6 - > .../univention-squid/debian/univention-squid.dirs | 3 - > .../debian/univention-squid.postinst | 4 +- > .../univention-squid.univention-config-registry | 3 + > ...tion-squid.univention-config-registry-variables | 6 + > .../debian/univention-squid.univention-service | 6 +- > 11 files changed, 181 insertions(+), 15 deletions(-) > create mode 100755 branches/ucs-4.0/ucs-4.0-1/services/univention-squid/conffiles/etc/init.d/squid3 > delete mode 100644 branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/dirs > create mode 100644 branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/ucslint.overrides > delete mode 100644 branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.conffiles > delete mode 100644 branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.dirs > >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/conffiles/etc/init.d/squid3 b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/conffiles/etc/init.d/squid3 >new file mode 100755 >index 0000000..ecea9e2 >--- /dev/null >+++ b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/conffiles/etc/init.d/squid3 >@@ -0,0 +1,156 @@ >+#! /bin/sh >+@%@UCRWARNING=# @%@ >+# >+# squid3 Startup script for the SQUID HTTP proxy-cache. >+# >+# Version: @(#)squid3.rc 1.0 07-Jul-2006 luigi@debian.org >+# >+### BEGIN INIT INFO >+# Provides: squid3 >+# Required-Start: $network $remote_fs $syslog >+# Required-Stop: $network $remote_fs $syslog >+# Should-Start: $named >+# Should-Stop: $named >+# Default-Start: 2 3 4 5 >+# Default-Stop: 0 1 6 >+# Short-Description: Squid HTTP Proxy version 3.x >+### END INIT INFO >+ >+NAME=squid3 >+DESC="Squid HTTP Proxy 3.x" >+DAEMON=/usr/sbin/squid3 >+PIDFILE=/var/run/$NAME.pid >+CONFIG=/etc/squid3/squid.conf >+SQUID_ARGS="-YC -f $CONFIG" >+ >+[ ! -f /etc/default/squid3 ] || . /etc/default/squid3 >+ >+. /lib/lsb/init-functions >+ >+PATH=/bin:/usr/bin:/sbin:/usr/sbin >+ >+[ -x $DAEMON ] || exit 0 >+ >+ulimit -n 65535 >+ >+find_cache_dir () { >+ w=" " # space tab >+ res=`sed -ne ' >+ s/^'$1'['"$w"']\+[^'"$w"']\+['"$w"']\+\([^'"$w"']\+\).*$/\1/p; >+ t end; >+ d; >+ :end q' < $CONFIG` >+ [ -n "$res" ] || res=$2 >+ echo "$res" >+} >+ >+find_cache_type () { >+ w=" " # space tab >+ res=`sed -ne ' >+ s/^'$1'['"$w"']\+\([^'"$w"']\+\).*$/\1/p; >+ t end; >+ d; >+ :end q' < $CONFIG` >+ [ -n "$res" ] || res=$2 >+ echo "$res" >+} >+ >+start () { >+ cache_dir=`find_cache_dir cache_dir` >+ cache_type=`find_cache_type cache_dir` >+ >+ # >+ # Create spool dirs if they don't exist. >+ # >+ 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" ] >+ then >+ log_warning_msg "Creating $DESC cache structure" >+ $DAEMON -z -f $CONFIG >+ fi >+ >+ umask 027 >+ ulimit -n 65535 >+ cd $cache_dir >+ start-stop-daemon --quiet --start \ >+ --pidfile $PIDFILE \ >+ --exec $DAEMON -- $SQUID_ARGS < /dev/null >+ return $? >+} >+ >+stop () { >+ PID=`cat $PIDFILE 2>/dev/null` >+ start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON >+ # >+ # Now we have to wait until squid has _really_ stopped. >+ # >+ sleep 2 >+ if test -n "$PID" && kill -0 $PID 2>/dev/null >+ then >+ log_action_begin_msg " Waiting" >+ cnt=0 >+ while kill -0 $PID 2>/dev/null >+ do >+ cnt=`expr $cnt + 1` >+ if [ $cnt -gt 24 ] >+ then >+ log_action_end_msg 1 >+ return 1 >+ fi >+ sleep 5 >+ log_action_cont_msg "" >+ done >+ log_action_end_msg 0 >+ return 0 >+ else >+ return 0 >+ fi >+} >+ >+case "$1" in >+ start) >+ # check ucr autostart setting >+ if [ -f "/usr/share/univention-config-registry/init-autostart.lib" ]; then >+ . "/usr/share/univention-config-registry/init-autostart.lib" >+ check_autostart univention-squid squid/autostart >+ fi >+ log_daemon_msg "Starting $DESC" "$NAME" >+ if start ; then >+ log_end_msg $? >+ else >+ log_end_msg $? >+ fi >+ ;; >+ stop) >+ log_daemon_msg "Stopping $DESC" "$NAME" >+ if stop ; then >+ log_end_msg $? >+ else >+ log_end_msg $? >+ fi >+ ;; >+ reload|force-reload) >+ log_action_msg "Reloading $DESC configuration files" >+ start-stop-daemon --stop --signal 1 \ >+ --pidfile $PIDFILE --quiet --exec $DAEMON >+ log_action_end_msg 0 >+ ;; >+ restart) >+ log_daemon_msg "Restarting $DESC" "$NAME" >+ stop >+ if start ; then >+ log_end_msg $? >+ else >+ log_end_msg $? >+ fi >+ ;; >+ status) >+ status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit 3 >+ ;; >+ *) >+ echo "Usage: /etc/init.d/$NAME {start|stop|reload|force-reload|restart|status}" >+ exit 3 >+ ;; >+esac >+ >+exit 0 >+ >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/changelog b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/changelog >index 8e68e7a..34ded2a 100644 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/changelog >+++ b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/changelog >@@ -1,3 +1,9 @@ >+univention-squid (8.0.2-4) unstable; urgency=low >+ >+ * Bug #36572: Add autostart.lib support >+ >+ -- Philipp Hahn <hahn@univention.de> Fri, 10 Apr 2015 12:34:04 +0200 >+ > univention-squid (8.0.2-3) unstable; urgency=low > > * Bug #36623: Support interfaces other then ethX >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/control b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/control >index 02a8bba..ee251ba 100644 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/control >+++ b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/control >@@ -17,6 +17,7 @@ Depends: ${misc:Depends}, > python-ipaddr, > python-crypto, > python-univention-lib, >+ univention-base-files, > Breaks: squid > Recommends: univention-nagios-squid > Suggests: univention-firewall >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/dirs b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/dirs >deleted file mode 100644 >index ea86a97..0000000 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/dirs >+++ /dev/null >@@ -1 +0,0 @@ >-usr/lib/univention-install/ >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/ucslint.overrides b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/ucslint.overrides >new file mode 100644 >index 0000000..7a2b01e >--- /dev/null >+++ b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/ucslint.overrides >@@ -0,0 +1,4 @@ >+# Foreign file >+0004-56: conffiles/etc/init.d/squid3 >+0010-2: conffiles/etc/init.d/squid3 >+0013-2: conffiles/etc/init.d/squid3 >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.conffiles b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.conffiles >deleted file mode 100644 >index b2f9408..0000000 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.conffiles >+++ /dev/null >@@ -1,6 +0,0 @@ >-/etc/univention/registry.info/categories/univention-squid.cfg >-/etc/univention/registry.info/variables/univention-squid.cfg >-/etc/univention/templates/files/etc/squid3/squid.conf >-/etc/univention/templates/files/etc/squid3/allowed_ldap_groups.conf >-/etc/univention/templates/files/etc/security/packetfilter.d/20squid >-/etc/univention/templates/files/etc/default/squid3 >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.dirs b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.dirs >deleted file mode 100644 >index aa7426e..0000000 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.dirs >+++ /dev/null >@@ -1,3 +0,0 @@ >-usr/lib/univention-server/server_password_change.d >-usr/lib/squid3 >-usr/lib/univention-uninstall >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.postinst b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.postinst >index 64d5908..a868f6e 100644 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.postinst >+++ b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.postinst >@@ -88,8 +88,8 @@ if [ "$1" = configure -a -n "$2" ] && dpkg --compare-versions "$2" lt 6.0.9; the > ucr commit /etc/squid3/squid.conf > fi > >-/etc/init.d/squid3 stop >-/etc/init.d/squid3 start >+invoke-rc.d squid3 stop >+invoke-rc.d squid3 start > > # configure firewall > ucr set security/packetfilter/package/univention-squid/tcp/3128/all="ACCEPT" \ >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry >index 7b005bb..4d27be7 100644 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry >+++ b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry >@@ -50,3 +50,6 @@ Variables: interfaces/.*/address > Type: file > File: etc/default/squid3 > Variables: hostname >+ >+Type: file >+File: etc/init.d/squid3 >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry-variables b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry-variables >index bc0b925..90fe3f3 100644 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry-variables >+++ b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-config-registry-variables >@@ -1,3 +1,9 @@ >+[squid/autostart] >+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. >+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. >+Type=str >+Categories=service-webproxy,system-services >+ > [squid/httpport] > 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. > 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. >diff --git a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-service b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-service >index b0dec4a..2d8bf38 100644 >--- a/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-service >+++ b/branches/ucs-4.0/ucs-4.0-1/services/univention-squid/debian/univention-squid.univention-service >@@ -1,5 +1,5 @@ >-[squid3] >-description[de]=Squid Proxyserver >-description[en]=Squid Proxyserver >+[squid] >+description[de]=Squid Web-Proxy Server >+description[en]=Squid web proxy server > icon=service/squid3 > programs=/usr/sbin/squid3 >-- >1.9.1 >
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 36572
: 6817