From 14f4e8679fde3e4ec96c9660efb029a510f4c35f Mon Sep 17 00:00:00 2001 From: Will Woods Date: Fri, 5 Aug 2011 17:25:57 -0400 Subject: [PATCH] Remove broken symbolic links during cleanup removing packages sadly doesn't run their %post scripts, so a lot of broken links are left around for systemd units and/or sysvinit scripts. So, after other cleanup, remove any broken links in /etc, /usr, or /lib. --- share/runtime-cleanup.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/runtime-cleanup.tmpl b/share/runtime-cleanup.tmpl index 2d6fbcb6..cda5ee1c 100644 --- a/share/runtime-cleanup.tmpl +++ b/share/runtime-cleanup.tmpl @@ -468,3 +468,7 @@ removefrom ${product.name}-logos /usr/share/pixmaps/* /usr/share/plymouth/* ## cleanup_python_files() runcmd find ${root} -name "*.pyo" -type f -delete runcmd find ${root} -name "*.pyc" -type f -exec ln -sf /dev/null {} \; + +## remove any broken links in /etc, /usr, /lib +## NOTE: not checking /var because we want to keep /var/run +runcmd chroot ${root} find -L /etc /usr /lib -xdev -type l -delete