]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
centos: Remove dangling syslog.service symlink
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 9 Feb 2023 16:47:20 +0000 (17:47 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 9 Feb 2023 17:10:56 +0000 (18:10 +0100)
Dangling symlinks trip up systemctl preset-all so let's remove this
one that's generated by the systemd spec in centos stream 8.

mkosi/distributions/centos.py

index 35d62f89f894ac207a6f925ad0cfb4116d0c16bd..a9e9e6d902013ba1325159fee38ffaae93f6c1de 100644 (file)
@@ -80,6 +80,10 @@ class CentosInstaller(DistributionInstaller):
 
         install_packages_dnf(state, packages, env)
 
+        syslog = state.root.joinpath("etc/systemd/system/syslog.service")
+        if release <= 8 and syslog.is_symlink() and not syslog.exists():
+            syslog.unlink()
+
         # On Fedora, the default rpmdb has moved to /usr/lib/sysimage/rpm so if that's the case we need to
         # move it back to /var/lib/rpm on CentOS.
         move_rpm_db(state.root)