summaryrefslogtreecommitdiff
path: root/linux/deb/01-fs-hello-kamal/package/DEBIAN
diff options
context:
space:
mode:
authorKamal Wickramanayake <kamal@inbox.lk>2026-05-23 16:16:24 +0530
committerKamal Wickramanayake <kamal@inbox.lk>2026-05-23 16:16:24 +0530
commit849a23ebf231e66560e6b1d88059645be0d73c08 (patch)
treec398731ba2865b546e6d46fdec4f95aac7ae708c /linux/deb/01-fs-hello-kamal/package/DEBIAN
parent161707cc2eab1d76a15684ef105bf1e2ecca154d (diff)
Added prerm and postrm scripts to deb file creation packages
Diffstat (limited to 'linux/deb/01-fs-hello-kamal/package/DEBIAN')
-rwxr-xr-xlinux/deb/01-fs-hello-kamal/package/DEBIAN/postrm18
-rwxr-xr-xlinux/deb/01-fs-hello-kamal/package/DEBIAN/prerm9
2 files changed, 27 insertions, 0 deletions
diff --git a/linux/deb/01-fs-hello-kamal/package/DEBIAN/postrm b/linux/deb/01-fs-hello-kamal/package/DEBIAN/postrm
new file mode 100755
index 0000000..b188553
--- /dev/null
+++ b/linux/deb/01-fs-hello-kamal/package/DEBIAN/postrm
@@ -0,0 +1,18 @@
+#!/bin/bash
+set -e
+
+# Check if the package is being purged (erased entirely including configs)
+if [ "$1" = "purge" ]; then
+ # Delete configuration files, logs, or created users
+ # rm -rf /var/log/your_package/
+ #deluser --quiet your_user || true
+fi
+
+# Run ldconfig if your package installs shared libraries
+if [ "$1" = "remove" ] || [ "$1" = "upgrade" ]; then
+ # ldconfig
+fi
+
+# postrm script must exit with 0
+exit 0
+
diff --git a/linux/deb/01-fs-hello-kamal/package/DEBIAN/prerm b/linux/deb/01-fs-hello-kamal/package/DEBIAN/prerm
new file mode 100755
index 0000000..95ede71
--- /dev/null
+++ b/linux/deb/01-fs-hello-kamal/package/DEBIAN/prerm
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+
+# Stop associated services before files are removed
+# ...
+
+# prerm script must exit with 0
+exit 0
+