From 7efcec020d35491fae66e65c3bcad6e7c9d83638 Mon Sep 17 00:00:00 2001 From: Caleb Connolly Date: Sun, 10 Dec 2023 18:00:13 +0000 Subject: [PATCH] postmarketos-base: disable openrc syslog service (MR 4617) Ensure that we don't have two logging daemons running! Signed-off-by: Caleb Connolly --- main/postmarketos-base/APKBUILD | 2 +- .../postmarketos-base.post-upgrade | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/main/postmarketos-base/APKBUILD b/main/postmarketos-base/APKBUILD index febcc7bd4..36f0d7c79 100644 --- a/main/postmarketos-base/APKBUILD +++ b/main/postmarketos-base/APKBUILD @@ -1,6 +1,6 @@ pkgname=postmarketos-base pkgver=31 -pkgrel=0 +pkgrel=1 pkgdesc="Meta package for minimal postmarketOS base" url="https://postmarketos.org" arch="noarch" diff --git a/main/postmarketos-base/postmarketos-base.post-upgrade b/main/postmarketos-base/postmarketos-base.post-upgrade index dae9c7469..96d2fcd9c 100644 --- a/main/postmarketos-base/postmarketos-base.post-upgrade +++ b/main/postmarketos-base/postmarketos-base.post-upgrade @@ -5,15 +5,23 @@ # service! (build.postmarketos.org#85) # The old version of the package is passed in as the second argument -OLD_VER="$(echo $2 | cut -d "-" -f 1)" +OLD_VER="$2" +NEW_VER="$1" +old_ver_less() { + [ "$OLD_VER" != "$1" -a "$(echo -e "$1\n$OLD_VER" | sort -V | head -n1)" = "$OLD_VER" ] +} -# postmarketos-base version 30 moves us from openrc-syslog to logbookd -# so enable the logbookd service if we're upgrading from an older version. -# If we're upgrading from a newer version, then we're already using logbookd -# and the user may have disabled the service, so don't re-enable it. -if [ $OLD_VER -lt 30 ]; then +# postmarketos-base version 30 moved us to logbookd but we forgot to disable +# syslog... The easiest way to solve this is to just do the upgrade again, sorry +# to anyone who manually disabled logbookd again... +if old_ver_less "31-r1"; then echo "## postmarketos-base migrating to logbookd ##" + echo "## The initial upgrade didn't disable syslog, we're doing that now ##" + echo "## If you want to keep using syslog, undo the following changes ##" + set -x rc-update add logbookd boot + rc-update del syslog boot + set +x fi # Fixup old pmOS installations that run setup-timezone without "-i" option