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
(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".
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.
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 }
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 $?
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
Created attachment 403906 [details] ulogd-2.0.5.ebuild A proposed ebuild for ulogd 2.0.5
Created attachment 403908 [details] ulogd-2.0.5-remove-db-automagic.patch A needed patch for 2.0.5.
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>
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.
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.
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.
*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
(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.
(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
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
This is anything but fixed. Ian, please read comment #13.
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.
(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.
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]
Reopening for the systemd unit file update.
(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
(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.