Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 550330 - app-admin/ulogd-2.0.5 version bump
Summary: app-admin/ulogd-2.0.5 version bump
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Coacher
URL:
Whiteboard:
Keywords: EBUILD, PATCH
Depends on:
Blocks: 546386
  Show dependency tree
 
Reported: 2015-05-25 03:40 UTC by Coacher
Modified: 2015-06-08 20:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ulogd.service (ulogd.service,323 bytes, text/plain)
2015-05-25 03:52 UTC, Coacher
Details
ulogd.logrotate (ulogd.logrotate,193 bytes, text/plain)
2015-05-25 04:04 UTC, Coacher
Details
ulogd.init (ulogd.init,910 bytes, text/plain)
2015-05-25 04:13 UTC, Coacher
Details
ulogd-2.0.4.ebuild (ulogd-2.0.4.ebuild,3.32 KB, text/plain)
2015-05-25 04:41 UTC, Coacher
Details
ulogd-2.0.5.ebuild (ulogd-2.0.5-r9999.ebuild,3.31 KB, text/plain)
2015-05-25 04:41 UTC, Coacher
Details
ulogd-2.0.5-remove-db-automagic.patch (ulogd-2.0.5-remove-db-automagic.patch,1.43 KB, text/plain)
2015-05-25 04:42 UTC, Coacher
Details
metadata.xml (metadata.xml,1.14 KB, text/plain)
2015-05-25 04:45 UTC, Coacher
Details
ulogd-2.0.5.ebuild (ulogd-2.0.5.ebuild,3.30 KB, text/plain)
2015-05-29 20:02 UTC, Coacher
Details
ulogd.service (ulogd.service,356 bytes, text/plain)
2015-06-03 11:24 UTC, Coacher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Coacher 2015-05-25 03:40:36 UTC
Hello.

This version bump has 3 goals:
1. introduction of systemd unit file for ulogd and other files/ directory updates
2. introduction of ulogd-2.0.5 ebuild
3. removal of ulogd-2.0.4 ebuild

I'll provide all the necessary changes below. @proxy-maint please add them in tree.

Since it is a bit more complex than usual I can also create a pull request on GitHub. Should I do that?

Reproducible: Always
Comment 1 Coacher 2015-05-25 03:45:05 UTC
(In reply to Coacher from comment #0)
> 3. removal of ulogd-2.0.4 ebuild

My mistake. It should be "removal of ulogd-2.0.3 ebuild".
Comment 2 Coacher 2015-05-25 03:52:20 UTC
Created attachment 403898 [details]
ulogd.service

systemd unit file for ulogd.

See also https://bugs.gentoo.org/show_bug.cgi?id=546386.

Lacks the ability to reopen logs (compared to OpenRC initscript), since systemd provides only the command for daemon reloading, not logfiles reopening.
Comment 3 Coacher 2015-05-25 04:04:55 UTC
Created attachment 403900 [details]
ulogd.logrotate

Logrotate script is updated to reopen logfiles via `kill` command so it will work in systemd environments. Also it now handles all logfiles under '/var/log/ulogd/' directory so users have one less thing to bother.

Please rename it to "ulogd.logrotate" since we don't have ulogd-1 for a while.

Diff:

--- a/app-admin/ulogd/files/ulogd.logrotate
+++ b/app-admin/ulogd/files/ulogd.logrotate
@@ -1,9 +1,9 @@
-/var/log/ulogd/ulogd.log /var/log/ulogd/ulogd_syslogemu.log {
+/var/log/ulogd/*.log {
     sharedscripts
     missingok
     notifempty
     create 0640 ulogd
     postrotate
-        /etc/init.d/ulogd reopen_logs > /dev/null
+        [ -f /run/ulogd.pid ] && /bin/kill -HUP $(cat /run/ulogd.pid)
     endscript
 }
Comment 4 Coacher 2015-05-25 04:13:52 UTC
Created attachment 403902 [details]
ulogd.init

OpenRC initscript is updated to have a better internal variables initialization. Also 'reopen_logs' extra command is renamed to just 'reopen' to keep it simple and clean.

Please rename it to "ulogd.init". The "-2-ng" part was meaningful in the past for pre-2.0.3 ebuilds, now it is obsolete and should go away.

Diff:

--- a/app-admin/ulogd/files/ulogd.init
+++ b/app-admin/ulogd/files/ulogd.init
@@ -1,13 +1,13 @@
 #!/sbin/runscript
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/ulogd/files/ulogd-2-ng.init,v 1.2 2014/08/22 10:31:59 dlan Exp $
+# $Header: $

-ULOGD_PIDFILE="/run/ulogd.pid"
-ULOGD_BINARY="/usr/sbin/ulogd"
-ULOGD_OPTS="--daemon --uid ulogd --pidfile ${ULOGD_PIDFILE}"
+extra_started_commands="reload reopen"

-extra_started_commands="reload reopen_logs"
+: ${ULOGD_BINARY:=/usr/sbin/ulogd}
+: ${ULOGD_PIDFILE:=/run/${SVCNAME}.pid}
+: ${ULOGD_OPTS:=--daemon --uid ulogd --pidfile ${ULOGD_PIDFILE}}

 depend() {
        before iptables ip6tables ebtables firewall
@@ -34,7 +34,7 @@ reload() {
        eend $?
 }

-reopen_logs() {
+reopen() {
        ebegin "Reopening ${SVCNAME} logfiles"
        start-stop-daemon --signal HUP --pidfile ${ULOGD_PIDFILE}
        eend $?
Comment 5 Coacher 2015-05-25 04:41:16 UTC
Created attachment 403904 [details]
ulogd-2.0.4.ebuild

ulogd-2.0.4 (mostly stable) ebuild should be updated to install systemd unit and handle renames. Also make repoman happy about postgres slot dependency.

Logrotate and initscript changes are very minor and functionality is not changed at all, only the way it is provided is changed slightly. So, it should be safe to simply update the current ebuild.

Diff:

--- a/app-admin/ulogd/ulogd-2.0.4.ebuild
+++ b/app-admin/ulogd/ulogd-2.0.4.ebuild
@@ -1,12 +1,12 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/ulogd/ulogd-2.0.4.ebuild,v 1.9 2015/01/28 10:26:01 ago Exp $
+# $Header: $

 EAPI="5"

 AUTOTOOLS_AUTORECONF=1
 AUTOTOOLS_IN_SOURCE_BUILD=1
-inherit autotools-utils eutils linux-info readme.gentoo user
+inherit autotools-utils eutils linux-info readme.gentoo systemd user

 DESCRIPTION="A userspace logging daemon for netfilter/iptables related logging"
 HOMEPAGE="http://netfilter.org/projects/ulogd/index.html"
@@ -30,7 +30,7 @@ RDEPEND="net-firewall/iptables
        nflog? ( >=net-libs/libnetfilter_log-1.0.0 )
        mysql? ( virtual/mysql )
        pcap? ( net-libs/libpcap )
-       postgres? ( dev-db/postgresql )
+       postgres? ( dev-db/postgresql:= )
        sqlite? ( dev-db/sqlite:3 )"

 DEPEND="${RDEPEND}
@@ -40,6 +40,8 @@ DEPEND="${RDEPEND}
                virtual/latex-base
        )"

+PATCHES=( "${FILESDIR}/${P}-linux-headers-3.17-ipt_ulog.patch" )
+
 DOCS=( AUTHORS README TODO )
 DOC_CONTENTS="You must have at least one logging stack enabled to make ulogd work.
 Please edit example configuration located at /etc/ulogd.conf"
@@ -72,8 +74,6 @@ pkg_setup() {
 }

 src_prepare() {
-       epatch "${FILESDIR}/${P}-linux-headers-3.17-ipt_ulog.patch"
-
        # - make all logs to be kept in a single dir /var/log/ulogd
        # - place sockets in /run instead of /tmp
        sed -i \
@@ -129,10 +129,11 @@ src_install() {
        fowners root:ulogd /etc/ulogd.conf
        fperms 640 /etc/ulogd.conf

-       newinitd "${FILESDIR}/${PN}-2-ng.init" ${PN}
+       newinitd "${FILESDIR}/${PN}.init" ${PN}
+       systemd_dounit "${FILESDIR}/${PN}.service"

        insinto /etc/logrotate.d
-       newins "${FILESDIR}/${PN}-2.logrotate" ${PN}
+       newins "${FILESDIR}/${PN}.logrotate" ${PN}

        diropts -o ulogd -g ulogd
        keepdir /var/log/ulogd
Comment 6 Coacher 2015-05-25 04:41:58 UTC
Created attachment 403906 [details]
ulogd-2.0.5.ebuild

A proposed ebuild for ulogd 2.0.5
Comment 7 Coacher 2015-05-25 04:42:59 UTC
Created attachment 403908 [details]
ulogd-2.0.5-remove-db-automagic.patch

A needed patch for 2.0.5.
Comment 8 Coacher 2015-05-25 04:45:07 UTC
Created attachment 403910 [details]
metadata.xml

ulogd-2.0.5 has a new ulog USE. Update metadata.xml accordingly. Also fix typo.

Diff:

--- a/app-admin/ulogd/metadata.xml
+++ b/app-admin/ulogd/metadata.xml
@@ -12,7 +12,8 @@
                <flag name='postgres'>Build PGSQL output plugin to save packets in a postgres database.</flag>
                <flag name='sqlite'>Build SQLITE3 output plugin to save packets in a sqlite database.</flag>
                <flag name='nflog'>Build NFLOG input plugin to support stateless packet-based logging via nfnetlink_queue.</flag>
-               <flag name='nfct'>Build NFCT input plugin to support stateful flow-based via nf_conntrack_netlink.</flag>
+               <flag name='nfct'>Build NFCT input plugin to support stateful flow-based logging via nf_conntrack_netlink.</flag>
                <flag name='nfacct'>Build NFACCT input plugin to support traffic accounting via nfnetlink_acct.</flag>
+               <flag name='ulog'>Build ULOG input plugin to support deprecated packet-based logging via ULOG target.</flag>
        </use>
 </pkgmetadata>
Comment 9 Coacher 2015-05-25 04:48:23 UTC
Please also remove ulogd-2.0.3 since it fails to build with already stable >=linux-headers-3.17

Again this is a big update. Maybe creating a pull request on GitHub is a better idea? I am just not sure if the GitHub PR is a suitable way of interaction for @proxy-maint team.
Comment 10 Coacher 2015-05-29 20:02:47 UTC
Created attachment 404296 [details]
ulogd-2.0.5.ebuild

Since this bug has not been picked up by the @proxy-maint team yet I'd like to attach ulogd-2.0.5.ebuild with a bit more cleanups.
Comment 11 Ian Delaney (RETIRED) gentoo-dev 2015-05-30 05:06:22 UTC
Re the ulogd-2.0.4.ebuild added in the list of Attachments. most of the diffs between this and the ulogd-2.0.4.ebuild present in portage result in an altered state of the installed package in the fs, so it needs to be revbumped. I shall next begin run testing the ebuilds. I cannot figure what happened in
ulogd-2.0.n-r9999.ebuild → ulogd-2.0.n.ebuild
I think they were re-named but in the end it doesn't matter.
Plan is to add new files to FILESDIR, revbump 2.0.4 and bump to 2.0.5.
Comment 12 Ian Delaney (RETIRED) gentoo-dev 2015-05-30 09:41:13 UTC
*ulogd-2.0.4-r1 (30 May 2015)
*ulogd-2.0.5 (30 May 2015)

  30 May 2015; Ian Delaney <idella4@gentoo.org>
  +files/ulogd-2.0.5-remove-db-automagic.patch, +files/ulogd.init,
  +files/ulogd.logrotate, +files/ulogd.service, +ulogd-2.0.4-r1.ebuild,
  +ulogd-2.0.5.ebuild, -files/ulogd-2-ng.init, -files/ulogd-2.logrotate,
  -ulogd-2.0.3.ebuild, metadata.xml:
  revbump; upgrade -2.0.4 with support of systemd via new system files listed.
  bump; additional support as for revbump, all files and patches by maintainer
  from bug #550330, add use flag ulog to metadata, rm old version -2.0.3

Shall wait for a confirmation all these files have been entered cleanly. All pass run testing
Comment 13 Coacher 2015-05-30 20:02:33 UTC
(In reply to Ian Delaney from comment #11)
> Re the ulogd-2.0.4.ebuild added in the list of Attachments. most of the
> diffs between this and the ulogd-2.0.4.ebuild present in portage result in
> an altered state of the installed package in the fs, so it needs to be
> revbumped.

Yes, files are changed, but only the ones shipped by Gentoo, i.e. systemd unit, initscript, logrotate script. I hoped we can use updated versions of these files with the already stable 2.0.4 ebuild. Can we?

> I cannot figure what happened in ulogd-2.0.n-r9999.ebuild → ulogd-2.0.n.ebuild
> I think they were re-named but in the end it doesn't matter.

Yes, exactly this. I use '-r9999' suffixes in my overlay where I test ulogd ebuilds. I edited filenames through the bugzilla interface to avoid possible confusion. I can see that nevertheless it was a bit confusing. Sorry.


(In reply to Ian Delaney from comment #11)
> Shall wait for a confirmation all these files have been entered cleanly.

Unfortunately, now ulogd-2.0.4 will fail to merge because initscript and logrotate script were renamed. Though this rename happened on my request I've had in mind that the existing ulogd-2.0.4 ebuild will be updated, not revbumped.

Please either update ulogd-2.0.4 with the changes I've posted above, or restore files/ulogd-2-ng.init and files/ulogd-2.logrotate files.
Comment 14 Coacher 2015-05-30 20:09:38 UTC
(In reply to Ian Delaney from comment #12)
> Shall wait for a confirmation all these files have been entered cleanly. All
> pass run testing

Also metadata.xml was not updated properly. ulog USE flag was added properly, but there is also a typo in nfct USE flag description. Please refer to comment #8
Comment 15 Ian Delaney (RETIRED) gentoo-dev 2015-05-31 04:10:09 UTC
right i skipped over Comment 8

  31 May 2015; Ian Delaney <idella4@gentoo.org> metadata.xml:
  correction to description of a use flag in metadata, noted in bug #550330
Comment 16 Coacher 2015-05-31 15:56:28 UTC
This is anything but fixed.

Ian, please read comment #13.
Comment 17 Ian Delaney (RETIRED) gentoo-dev 2015-06-01 02:20:19 UTC
Your premis appears to be that the change to ulogd-2.0.4.ebuild could be done without a revbump.  The new init files ulogd.init  ulogd.logrotate  ulogd.service amount to a change of state to the installed system of the package. The addition of the systemd eclass alone is enough to warrant a revbump, however the ulogd-2-ng.init & ulogd-2.logrotate do need re-adding. On removing the ulogd-2.0.4.ebuild and the matching init files, I then realised the ulogd-2.0.4.ebuild was a stable, re-added it and missed re-adding the matching init files, my slip there sadly.

  01 Jun 2015; Ian Delaney <idella4@gentoo.org> +files/ulogd-2-ng.init,
  +files/ulogd-2.logrotate:
  re-add wrongly deleted init files for ulogd-2.0.4.ebuild

I would think you would like to get the ulogd-2.0.4-r1.ebuild made stable allowing the purging of the ulogd-2.0.4.ebuild and those init files and/or ulogd-2.0.5.ebuild made stable after the std. period bug free.
Comment 18 Coacher 2015-06-03 11:07:29 UTC
(In reply to Ian Delaney from comment #17)
> Your premis appears to be that the change to ulogd-2.0.4.ebuild could be
> done without a revbump.  The new init files ulogd.init  ulogd.logrotate 
> ulogd.service amount to a change of state to the installed system of the
> package. The addition of the systemd eclass alone is enough to warrant a
> revbump, however the ulogd-2-ng.init & ulogd-2.logrotate do need re-adding.

Ok. I can see your point here.

> On removing the ulogd-2.0.4.ebuild and the matching init files, I then
> realised the ulogd-2.0.4.ebuild was a stable, re-added it and missed
> re-adding the matching init files, my slip there sadly.

No problems. 

Thank you for your time on this one, Ian.
Comment 19 Coacher 2015-06-03 11:24:05 UTC
Created attachment 404510 [details]
ulogd.service

@proxy-maint please update ulogd service file with this new version. This update changes the unit type from `simple` to `forking`, which helps to detect startup failures. The related discussion can be found in the bug #546386.

This is a minor followup for the ulogd-2.0.5 version bump so I hope it's fine to keep it in the same bugreport.

Diff:
--- a/app-admin/ulogd/files/ulogd.service
+++ b/app-admin/ulogd/files/ulogd.service
@@ -4,8 +4,9 @@ Before=iptables.service ip6tables.service
 After=mysql.service postgresql.service

 [Service]
-Type=simple
-ExecStart=/usr/sbin/ulogd --uid ulogd --pidfile /run/ulogd.pid
+Type=forking
+PIDFile=/run/ulogd.pid
+ExecStart=/usr/sbin/ulogd --daemon --uid ulogd --pidfile /run/ulogd.pid
 ExecReload=/bin/kill -USR1 $MAINPID

 [Install]
Comment 20 Coacher 2015-06-03 11:26:23 UTC
Reopening for the systemd unit file update.
Comment 21 Ian Delaney (RETIRED) gentoo-dev 2015-06-06 03:34:12 UTC
(In reply to Coacher from comment #19)
> Created attachment 404510 [details]
> ulogd.service
> 
> This is a minor followup for the ulogd-2.0.5 version bump so I hope it's
> fine to keep it in the same bugreport.
> 
That's fine. 

  06 Jun 2015; Ian Delaney <idella4@gentoo.org> files/ulogd.service:
  update to systemd unit file ulogd.service wrt Bug #550330
Comment 22 Coacher 2015-06-08 20:04:56 UTC
(In reply to Ian Delaney from comment #21)
>   06 Jun 2015; Ian Delaney <idella4@gentoo.org> files/ulogd.service:
>   update to systemd unit file ulogd.service wrt Bug #550330

Great! All files were added/updated properly. Thank you very much Ian.

Closing.