Skip to main content
Topic: Logwatch is broken due to missing journalctl (Read 1144 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Logwatch is broken due to missing journalctl

I used to use logwatch on Artix, but after an upgrade a while back, it no longer works.   There is a call to journalctl which does not exist on Artix (thankfully, thank you).

Devuan and Anti-X still have working versions of logwatch, and to the best of my knowledge, there are few if any traces of systemd on those.  Is there any chance of getting support for logwatch, or maybe a similar tool?

thanks

[Edited as I meant "journalctl" not "systemctl" -- sorry]

Re: Logwatch is broken due to missing journalctl

Reply #1
You can make AUR package for that. Try to recompile the original package and look if it is possible to omit loginctl dependency at configure stage
ARMtix

Re: Logwatch is broken due to missing journalctl

Reply #2
Could the Artix devs use the same mods made for other distros I mentioned?   I would think those would work for most distros converted from systemd.

Re: Logwatch is broken due to missing journalctl

Reply #3
It looks to me, upon some cursory investigation, that as of version 7.5.x of logwatch, there is a welded-in dependency on journalctl.  So fixing this will not be so straightforward.   (Nothing ever is, it seems, when it comes to the collateral damage from systemd.)

I think the simplest solution would be a journalctl shim.  I wrote one for systemctl to port openmediavault 3.0 to openrc or any other non-systemd distro.   (And it worked, flawlessly.)   I'd like to avoid having to write one for journalctl only because that program seems more bloated in terms of options.  Also, each logfile in the non-systemd world may use a slightly different format, which could make things... how shall I say it?   Interesting?

I'll also look for or file a bug against logwatch for this.

Re: Logwatch is broken due to missing journalctl

Reply #4
looking at the PKGBUILD  https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/logwatch
there's no "configure" stage since logwatch is a perl script and there is no compiling as such..
what there is: is some sed manipulation of the install script: (and some extra *.conf files added)
Code: [Select]
	sed \
-e '/BASEDIR=/d' \
-e '/CONFIGDIR=/d' \
-e '/TEMPDIR=/d' \
-e '/PERLEXE=/d' \
-e '/MANDIR=/d' \
-e '/ln -f -s $BASEDIR/d' \
-e "s|/lib/systemd/|$pkgdir/usr/lib/systemd/|g" \
-e "s|/usr/sbin/logwatch|$pkgdir/usr/bin/logwatch/|g" \
-i install_logwatch.sh
and then in the install section some more systemd related dirs and installation of the *.conf files..
and the  line running install_logwatch.sh with --systemd option..
here's an edit, omitting systemd stuff:
PKGBUILD:
Code: [Select]
# Maintainer: Sergej Pupykin <[email protected]>
# Maintainer: Pierre Schmitz <[email protected]>

pkgname=logwatch
pkgver=7.5.2
pkgrel=6
arch=('any')
pkgdesc="Logwatch is a customizable log analysis system."
url="http://www.logwatch.org/"
depends=('perl')
optdepends=('cron'
    'perl-date-manip: human readable dates')
license=('custom')
backup=(etc/logwatch/conf/logwatch.conf
etc/logwatch/conf/ignore.conf
etc/logwatch/conf/override.conf)
source=(https://downloads.sourceforge.net/project/logwatch/logwatch-$pkgver/logwatch-$pkgver.tar.gz)
sha256sums=('5d9c1a6eaf082b880c61895914824e347c6d63ad2a31cfc150f384a3e68ce5fb')

prepare() {
cd "$srcdir"/$pkgname-$pkgver
sed \
-e '/BASEDIR=/d' \
-e '/CONFIGDIR=/d' \
-e '/TEMPDIR=/d' \
-e '/PERLEXE=/d' \
-e '/MANDIR=/d' \
-e '/ln -f -s $BASEDIR/d' \
-e "s|/usr/sbin/logwatch|$pkgdir/usr/bin/logwatch/|g" \
-i install_logwatch.sh
}

package() {
cd "$srcdir"/$pkgname-$pkgver

install -dm0755 "$pkgdir"/usr/{bin,}

export BASEDIR="$pkgdir/usr/share/logwatch"
export CONFIGDIR="$pkgdir/etc/logwatch"
export TEMPDIR="$pkgdir/var/cache/logwatch"
export PERLEXE="$pkgdir/usr/bin/perl"
export MANDIR="$pkgdir/usr/share/man"
echo "$pkgdir/usr/share/logwatch" | sh install_logwatch.sh
ln -sf /usr/share/logwatch/scripts/logwatch.pl "$pkgdir"/usr/bin/logwatch
sed -i "s|$pkgdir||g" "$pkgdir"/usr/share/logwatch/scripts/logwatch.pl

install -m 0755 -d "$pkgdir"/usr/share/licenses/$pkgname/
install -m 0644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/
}
put it in a directory with(or without ) the source tarball and run makepkg ..  and see if it works out..