bircoph 15/01/09 00:13:32 Added: polipo.initd-2 polipo.crond-2 Log: Version bump. Fix bugs 504030, 510056, 520598. Provide security update for bug 385307. Add init.d script multiplexing. Update crond file to support multiplexing. Signed-off-by: Andrew Savchenko <birc...@gentoo.org> (Portage version: 2.2.15/cvs/Linux i686, signed Manifest commit with key 565953B95372756C)
Revision Changes Path 1.1 net-proxy/polipo/files/polipo.initd-2 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/polipo/files/polipo.initd-2?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/polipo/files/polipo.initd-2?rev=1.1&content-type=text/plain Index: polipo.initd-2 =================================================================== #!/sbin/runscript # Copyright 1999-2015 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-proxy/polipo/files/polipo.initd-2,v 1.1 2015/01/09 00:13:32 bircoph Exp $ CONFFILE="/etc/polipo/config${SVCNAME#polipo}" PIDFILE="/var/run/${SVCNAME}.pid" depend() { need net } checkconfig() { { polipo -v -c "${CONFFILE}" || return 1 ; } | { local retvalue=0 local name type value desc while read name type value desc ; do case ${name} in configFile) if [ "${value}" = "(none)" ] ; then eerror "Unable to read configuration file /etc/polipo/config" retvalue=1 fi ;; daemonise) if [ "${value}" != "false" ] ; then eerror "Configuration option not supported by this init script: ${name}=${value}" retvalue=1 fi ;; pidFile) if [ "${value}" != "(none)" ] ; then eerror "Configuration option not supported by this init script: ${name}=${value}" retvalue=1 fi ;; diskCacheRoot) if [ "${value}" != "(none)" ] ; then # Ensure that cache directory exists and have proper permissions if ! [[ -d "{value}" ]]; then mkdir -p -m 0750 "${value}" chown polipo:polipo "${value}" fi fi ;; esac done return ${retvalue} } } start() { checkconfig || return 1 ebegin "Starting Polipo HTTP proxy" start-stop-daemon --start --user polipo \ --background --pidfile "${PIDFILE}" --make-pidfile \ --exec /usr/bin/polipo -- -c "${CONFFILE}" eend $? } stop() { ebegin "Stopping Polipo HTTP proxy" start-stop-daemon --stop --pidfile "${PIDFILE}" eend $? } 1.1 net-proxy/polipo/files/polipo.crond-2 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/polipo/files/polipo.crond-2?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/polipo/files/polipo.crond-2?rev=1.1&content-type=text/plain Index: polipo.crond-2 =================================================================== #!/bin/bash # Loop through all init.d instances for f in /etc/init.d/polipo*; do # only proceed if daemon is running "${f}" --quiet status || continue myname="${f#/etc/init.d/polipo}" conffile="/etc/polipo/config${myname}" pidfile="/var/run/polipo${myname}.pid" # check if disk cache is enabled polipo -v -c "${CONFFILE}" | awk '$1 ~ /diskCacheRoot/ { if ($3 == "(none)") exit 1}' || continue # Expire old cached objects kill -USR1 $(cat "${pidfile}") sleep 1 nice -n 15 su -s "/bin/sh" -c "polipo -c ${conffile} -x" polipo > /dev/null kill -USR2 $(cat "${pidfile}") done