[pve-devel] [PATCH zfsonlinux 10/16] Remove /etc/zfs/zed.d on purge

Stoiko Ivanov s.ivanov at proxmox.com
Thu Jun 17 15:52:17 CEST 2021


(cherry picked from debian-upstream [0] commits
d0ba1164dcf8e566a5134d8fadef4c84d5afdf6c and
3ddeaa236e758e3dee7a9eedac66a001a11953c3)

[0] https://salsa.debian.org/zfsonlinux-team/zfs/
Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 debian/zfs-zed.postrm | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 debian/zfs-zed.postrm

diff --git a/debian/zfs-zed.postrm b/debian/zfs-zed.postrm
new file mode 100644
index 00000000..e9aed3f4
--- /dev/null
+++ b/debian/zfs-zed.postrm
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+zedd="/usr/lib/zfs-linux/zed.d"
+etcd="/etc/zfs/zed.d"
+
+if [ "$1" = "purge" ] && [ -d "$etcd" ] ; then
+    # remove the overrides created in prerm
+    find "${etcd}" -maxdepth 1 -lname '/dev/null' -delete
+    # remove any dangling symlinks to old zedlets
+    find "${etcd}" -maxdepth 1 -lname "${zedd}/*" -xtype l  -delete
+    # clean up any empty directories
+    ( rmdir "$etcd" && rmdir "/etc/zfs" ) || true
+fi
+
+#DEBHELPER#
+
-- 
2.20.1






More information about the pve-devel mailing list