1 |
commit: 5180c7569d058ba8265c2eacaee2d097111fcd38 |
2 |
Author: Ilya Tumaykin <itumaykin <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Oct 30 13:54:53 2015 +0000 |
4 |
Commit: Ian Delaney <idella4 <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 30 16:26:20 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5180c756 |
7 |
|
8 |
app-admin/ulogd: add 200 ms delay on daemon start |
9 |
|
10 |
Gentoo-Bug: 564396 |
11 |
|
12 |
app-admin/ulogd/files/ulogd.init-r2 | 42 ++++++++++ |
13 |
app-admin/ulogd/ulogd-2.0.5-r3.ebuild | 145 ++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 187 insertions(+) |
15 |
|
16 |
diff --git a/app-admin/ulogd/files/ulogd.init-r2 b/app-admin/ulogd/files/ulogd.init-r2 |
17 |
new file mode 100644 |
18 |
index 0000000..c994507 |
19 |
--- /dev/null |
20 |
+++ b/app-admin/ulogd/files/ulogd.init-r2 |
21 |
@@ -0,0 +1,42 @@ |
22 |
+#!/sbin/runscript |
23 |
+# Copyright 1999-2015 Gentoo Foundation |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+# $Id$ |
26 |
+ |
27 |
+extra_started_commands="reload reopen" |
28 |
+ |
29 |
+: ${ULOGD_BINARY:=/usr/sbin/ulogd} |
30 |
+: ${ULOGD_PIDFILE:=/run/${SVCNAME}.pid} |
31 |
+: ${ULOGD_WAIT:=200} |
32 |
+: ${ULOGD_OPTS:=--daemon --uid ulogd --pidfile ${ULOGD_PIDFILE}} |
33 |
+ |
34 |
+depend() { |
35 |
+ before iptables ip6tables ebtables nftables firewall |
36 |
+ after mysql postgresql |
37 |
+} |
38 |
+ |
39 |
+start() { |
40 |
+ ebegin "Starting ${SVCNAME}" |
41 |
+ start-stop-daemon --start \ |
42 |
+ --exec ${ULOGD_BINARY} --pidfile ${ULOGD_PIDFILE} --wait ${ULOGD_WAIT} \ |
43 |
+ -- ${ULOGD_OPTS} |
44 |
+ eend $? |
45 |
+} |
46 |
+ |
47 |
+stop() { |
48 |
+ ebegin "Stopping ${SVCNAME}" |
49 |
+ start-stop-daemon --stop --pidfile ${ULOGD_PIDFILE} |
50 |
+ eend $? |
51 |
+} |
52 |
+ |
53 |
+reload() { |
54 |
+ ebegin "Reloading ${SVCNAME} configuration" |
55 |
+ start-stop-daemon --signal USR1 --pidfile ${ULOGD_PIDFILE} |
56 |
+ eend $? |
57 |
+} |
58 |
+ |
59 |
+reopen() { |
60 |
+ ebegin "Reopening ${SVCNAME} logfiles" |
61 |
+ start-stop-daemon --signal HUP --pidfile ${ULOGD_PIDFILE} |
62 |
+ eend $? |
63 |
+} |
64 |
|
65 |
diff --git a/app-admin/ulogd/ulogd-2.0.5-r3.ebuild b/app-admin/ulogd/ulogd-2.0.5-r3.ebuild |
66 |
new file mode 100644 |
67 |
index 0000000..71cf91e |
68 |
--- /dev/null |
69 |
+++ b/app-admin/ulogd/ulogd-2.0.5-r3.ebuild |
70 |
@@ -0,0 +1,145 @@ |
71 |
+# Copyright 1999-2015 Gentoo Foundation |
72 |
+# Distributed under the terms of the GNU General Public License v2 |
73 |
+# $Id$ |
74 |
+ |
75 |
+EAPI=5 |
76 |
+ |
77 |
+AUTOTOOLS_AUTORECONF=1 |
78 |
+AUTOTOOLS_IN_SOURCE_BUILD=1 |
79 |
+ |
80 |
+inherit autotools-utils eutils flag-o-matic linux-info readme.gentoo systemd user |
81 |
+ |
82 |
+DESCRIPTION="A userspace logging daemon for netfilter/iptables related logging" |
83 |
+HOMEPAGE="http://netfilter.org/projects/ulogd/index.html" |
84 |
+SRC_URI="ftp://ftp.netfilter.org/pub/${PN}/${P}.tar.bz2 |
85 |
+ http://www.netfilter.org/projects/${PN}/files/${P}.tar.bz2" |
86 |
+ |
87 |
+LICENSE="GPL-2" |
88 |
+SLOT="0" |
89 |
+KEYWORDS="~amd64 ~ia64 ~ppc ~x86" |
90 |
+IUSE="dbi doc json mysql nfacct +nfct +nflog pcap postgres sqlite -ulog" |
91 |
+ |
92 |
+RDEPEND=" |
93 |
+ || ( net-firewall/iptables net-firewall/nftables ) |
94 |
+ >=net-libs/libnfnetlink-1.0.1 |
95 |
+ dbi? ( dev-db/libdbi ) |
96 |
+ json? ( dev-libs/jansson ) |
97 |
+ nfacct? ( |
98 |
+ >=net-libs/libmnl-1.0.3 |
99 |
+ >=net-libs/libnetfilter_acct-1.0.1 |
100 |
+ ) |
101 |
+ nfct? ( >=net-libs/libnetfilter_conntrack-1.0.2 ) |
102 |
+ nflog? ( >=net-libs/libnetfilter_log-1.0.0 ) |
103 |
+ mysql? ( virtual/mysql ) |
104 |
+ pcap? ( net-libs/libpcap ) |
105 |
+ postgres? ( dev-db/postgresql:= ) |
106 |
+ sqlite? ( dev-db/sqlite:3 ) |
107 |
+" |
108 |
+DEPEND="${RDEPEND} |
109 |
+ doc? ( |
110 |
+ app-text/linuxdoc-tools |
111 |
+ app-text/texlive-core |
112 |
+ virtual/latex-base |
113 |
+ ) |
114 |
+" |
115 |
+ |
116 |
+PATCHES=( "${FILESDIR}/${P}-remove-db-automagic.patch" ) |
117 |
+ |
118 |
+DOCS=( AUTHORS README TODO ) |
119 |
+DOC_CONTENTS=" |
120 |
+ You must have at least one logging stack enabled to make ulogd work. |
121 |
+ Please edit example configuration located at /etc/ulogd.conf |
122 |
+" |
123 |
+ |
124 |
+pkg_setup() { |
125 |
+ enewgroup ulogd |
126 |
+ enewuser ulogd -1 -1 /var/log/ulogd ulogd |
127 |
+ |
128 |
+ linux-info_pkg_setup |
129 |
+ |
130 |
+ if kernel_is lt 2 6 14; then |
131 |
+ die "ulogd requires kernel newer than 2.6.14" |
132 |
+ fi |
133 |
+ |
134 |
+ if kernel_is lt 2 6 18; then |
135 |
+ ewarn "You are using kernel older than 2.6.18" |
136 |
+ ewarn "Some ulogd features may be unavailable" |
137 |
+ fi |
138 |
+ |
139 |
+ if use nfacct && kernel_is lt 3 3 0; then |
140 |
+ ewarn "NFACCT input plugin requires kernel newer than 3.3.0" |
141 |
+ fi |
142 |
+ |
143 |
+ if use ulog && kernel_is gt 3 17 0; then |
144 |
+ ewarn "ULOG target was removed since 3.17.0 kernel release" |
145 |
+ ewarn "Consider enabling NFACCT, NFCT or NFLOG support" |
146 |
+ fi |
147 |
+} |
148 |
+ |
149 |
+src_prepare() { |
150 |
+ # - make all logs to be kept in a single dir /var/log/ulogd |
151 |
+ # - place sockets in /run instead of /tmp |
152 |
+ sed -i \ |
153 |
+ -e 's:var/log:var/log/ulogd:g' \ |
154 |
+ -e 's:tmp:run:g' \ |
155 |
+ ulogd.conf.in || die 'sed on ulogd.conf.in failed' |
156 |
+ |
157 |
+ append-lfs-flags |
158 |
+ autotools-utils_src_prepare |
159 |
+} |
160 |
+ |
161 |
+src_configure() { |
162 |
+ local myeconfargs=( |
163 |
+ $(use_with dbi) |
164 |
+ $(use_with json jansson) |
165 |
+ $(use_enable nfacct) |
166 |
+ $(use_enable nfct) |
167 |
+ $(use_enable nflog) |
168 |
+ $(use_with mysql) |
169 |
+ $(use_with pcap) |
170 |
+ $(use_with postgres pgsql) |
171 |
+ $(use_with sqlite) |
172 |
+ $(use_enable ulog) |
173 |
+ ) |
174 |
+ autotools-utils_src_configure |
175 |
+} |
176 |
+ |
177 |
+src_compile() { |
178 |
+ autotools-utils_src_compile |
179 |
+ |
180 |
+ if use doc; then |
181 |
+ # Prevent access violations from bitmap font files generation |
182 |
+ export VARTEXFONTS="${T}"/fonts |
183 |
+ emake -C doc |
184 |
+ fi |
185 |
+} |
186 |
+ |
187 |
+src_install() { |
188 |
+ autotools-utils_src_install |
189 |
+ readme.gentoo_create_doc |
190 |
+ prune_libtool_files --modules |
191 |
+ |
192 |
+ if use doc; then |
193 |
+ dohtml doc/${PN}.html |
194 |
+ dodoc doc/${PN}.dvi doc/${PN}.txt doc/${PN}.ps |
195 |
+ fi |
196 |
+ |
197 |
+ use sqlite && dodoc doc/sqlite3.table |
198 |
+ use mysql && dodoc doc/mysql-*.sql |
199 |
+ use postgres && dodoc doc/pgsql-*.sql |
200 |
+ doman ${PN}.8 |
201 |
+ |
202 |
+ insinto /etc |
203 |
+ doins ${PN}.conf |
204 |
+ fowners root:ulogd /etc/ulogd.conf |
205 |
+ fperms 640 /etc/ulogd.conf |
206 |
+ |
207 |
+ newinitd "${FILESDIR}/${PN}.init-r2" ${PN} |
208 |
+ systemd_newunit "${FILESDIR}/${PN}.service-r1" ${PN}.service |
209 |
+ |
210 |
+ insinto /etc/logrotate.d |
211 |
+ newins "${FILESDIR}/${PN}.logrotate" ${PN} |
212 |
+ |
213 |
+ diropts -o ulogd -g ulogd |
214 |
+ keepdir /var/log/ulogd |
215 |
+} |