Gentoo Archives: gentoo-commits

From: "Diego Petteno (flameeyes)" <flameeyes@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-proxy/ufdbguard/files: ufdb.confd ufdb.initd
Date: Sun, 01 May 2011 16:06:00
Message-Id: 20110501160551.13BB920054@flycatcher.gentoo.org
1 flameeyes 11/05/01 16:05:51
2
3 Modified: ufdb.confd ufdb.initd
4 Log:
5 Update init script to wait to see if ufdb successfully started; add urls to the generated tables if present; add a variable to set options for ufdbGenTable and default to -W.
6
7 (Portage version: 2.2.0_alpha30/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.2 net-proxy/ufdbguard/files/ufdb.confd
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/ufdbguard/files/ufdb.confd?rev=1.2&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/ufdbguard/files/ufdb.confd?rev=1.2&content-type=text/plain
14 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/ufdbguard/files/ufdb.confd?r1=1.1&r2=1.2
15
16 Index: ufdb.confd
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdb.confd,v
19 retrieving revision 1.1
20 retrieving revision 1.2
21 diff -u -r1.1 -r1.2
22 --- ufdb.confd 7 Dec 2010 09:11:50 -0000 1.1
23 +++ ufdb.confd 1 May 2011 16:05:50 -0000 1.2
24 @@ -1,9 +1,13 @@
25 # -*- sh -*-
26 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdb.confd,v 1.1 2010/12/07 09:11:50 flameeyes Exp $
27 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdb.confd,v 1.2 2011/05/01 16:05:50 flameeyes Exp $
28
29 # Tables to re-generate when starting or reloading ufdbguard
30 UFDB_GT="alwaysallow alwaysdeny"
31
32 +# Options passed to ufdbGenTable when generating the tables listed in
33 +# UFDB_GT
34 +GENTABLE_OPTIONS="-W"
35 +
36 # User under which to run ufdbguard; it should be the same as the
37 # proxy server you're using, so by default it is squid.
38 UFDB_USER="squid"
39
40
41
42 1.2 net-proxy/ufdbguard/files/ufdb.initd
43
44 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/ufdbguard/files/ufdb.initd?rev=1.2&view=markup
45 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/ufdbguard/files/ufdb.initd?rev=1.2&content-type=text/plain
46 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-proxy/ufdbguard/files/ufdb.initd?r1=1.1&r2=1.2
47
48 Index: ufdb.initd
49 ===================================================================
50 RCS file: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdb.initd,v
51 retrieving revision 1.1
52 retrieving revision 1.2
53 diff -u -r1.1 -r1.2
54 --- ufdb.initd 7 Dec 2010 09:11:50 -0000 1.1
55 +++ ufdb.initd 1 May 2011 16:05:50 -0000 1.2
56 @@ -1,7 +1,7 @@
57 #!/sbin/runscript
58 -# Copyright 1999-2010 Gentoo Foundation
59 +# Copyright 1999-2011 Gentoo Foundation
60 # Distributed under the terms of the GNU General Public License v2
61 -# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdb.initd,v 1.1 2010/12/07 09:11:50 flameeyes Exp $
62 +# $Header: /var/cvsroot/gentoo-x86/net-proxy/ufdbguard/files/ufdb.initd,v 1.2 2011/05/01 16:05:50 flameeyes Exp $
63
64 # reconfig is what the upstream documentation suggests, so let's
65 # provide it for compatibility.
66 @@ -21,10 +21,14 @@
67 local dbhome=$(get_config dbhome)
68
69 for gt in ${UFDB_GT} ; do
70 - if [ -f "${dbhome}/${gt}/domains" ] ; then
71 - einfo "Generating domainlist ${gt}"
72 - ufdbGenTable -t "${gt}" -d "${dbhome}/${gt}/domains"
73 - fi
74 + [ -f "${dbhome}/${gt}/domains" ] || continue
75 +
76 + urls=
77 + [ -f "${dbhome}/${gt}/urls" ] && urls="${dbhome}/${gt}/urls"
78 +
79 + ebegin "Generating domainlist ${gt}"
80 + ufdbGenTable ${GENTABLE_OPTIONS} -t "${gt}" -d "${dbhome}/${gt}/domains" ${urls:+-u "${urls}"}
81 + eend $?
82 done
83 }
84
85 @@ -44,7 +48,9 @@
86 fi
87
88 ebegin "Starting ufdbGuard"
89 - start-stop-daemon --start --chuid ${UFDB_USER} \
90 + start-stop-daemon --start \
91 + --chuid ${UFDB_USER} \
92 + --wait 1500 \
93 --exec /usr/libexec/ufdbguard/ufdbguardd \
94 --pidfile /var/run/ufdbguard/ufdbguardd.pid -- \
95 -c /etc/ufdbGuard.conf ${UFDB_OPTS}