summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2007-02-12 11:13:22 +0000
committerAlin Năstac <mrness@gentoo.org>2007-02-12 11:13:22 +0000
commit0c4cdfec9ed4f17227d4c815b188be58e034b6ad (patch)
tree55191367a2477e1e747a1731b8a84a8e721b9073 /net-proxy
parentBump to 0.2.3 (diff)
downloadgentoo-2-0c4cdfec9ed4f17227d4c815b188be58e034b6ad.tar.gz
gentoo-2-0c4cdfec9ed4f17227d4c815b188be58e034b6ad.tar.bz2
gentoo-2-0c4cdfec9ed4f17227d4c815b188be58e034b6ad.zip
Check configuration at service startup.
(Portage version: 2.1.1-r2)
Diffstat (limited to 'net-proxy')
-rw-r--r--net-proxy/polipo/ChangeLog5
-rw-r--r--net-proxy/polipo/files/polipo.initd46
2 files changed, 41 insertions, 10 deletions
diff --git a/net-proxy/polipo/ChangeLog b/net-proxy/polipo/ChangeLog
index 49912a2624c6..e2ff3f01520d 100644
--- a/net-proxy/polipo/ChangeLog
+++ b/net-proxy/polipo/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for net-proxy/polipo
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-proxy/polipo/ChangeLog,v 1.12 2007/02/08 09:40:10 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/polipo/ChangeLog,v 1.13 2007/02/12 11:13:22 mrness Exp $
+
+ 12 Feb 2007; Alin Nastac <mrness@gentoo.org> files/polipo.initd:
+ Check configuration at service startup.
*polipo-0.9.12 (08 Feb 2007)
diff --git a/net-proxy/polipo/files/polipo.initd b/net-proxy/polipo/files/polipo.initd
index d950dd1f1c29..8f2435677e37 100644
--- a/net-proxy/polipo/files/polipo.initd
+++ b/net-proxy/polipo/files/polipo.initd
@@ -1,21 +1,49 @@
#!/sbin/runscript
# Copyright 1999-2005 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,v 1.2 2006/09/06 20:29:15 mrness Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-proxy/polipo/files/polipo.initd,v 1.3 2007/02/12 11:13:22 mrness Exp $
depend() {
need net
}
-start() {
- ebegin "Starting Polipo HTTP proxy"
+checkconfig() {
+ polipo -v | (
+ local retvalue=0
+ local name value desc
+ while read name 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
+ ;;
+ esac
+ done
+ return ${retvalue}
+ )
+ [[ ${PIPESTATUS[0]} == 0 && ${PIPESTATUS[1]} == 0 ]]
+ return $?
+}
- if [ ! -f "/etc/polipo/config" ]; then
- eerror "Unable to read configuration file: /etc/polipo/config"
- return 1
- fi
+start() {
+ checkconfig || return 1
- start-stop-daemon --start --quiet --chuid polipo \
+ ebegin "Starting Polipo HTTP proxy"
+ start-stop-daemon --start --chuid polipo \
--background --pidfile /var/run/polipo.pid --make-pidfile \
--exec /usr/bin/polipo
eend $?
@@ -23,6 +51,6 @@ start() {
stop() {
ebegin "Stopping Polipo HTTP proxy"
- start-stop-daemon --stop --quiet --pidfile /var/run/polipo.pid
+ start-stop-daemon --stop --pidfile /var/run/polipo.pid
eend $?
}