Initial commit: logcorrelator with unified packaging (DEB + RPM using fpm)
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
29
packaging/deb/prerm
Normal file
29
packaging/deb/prerm
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# prerm script for logcorrelator .deb package
|
||||
|
||||
case "$1" in
|
||||
remove|deconfigure)
|
||||
# Stop and disable the service
|
||||
if [ -x /bin/systemctl ] && [ -d /run/systemd/system ]; then
|
||||
systemctl stop logcorrelator.service 2>/dev/null || true
|
||||
systemctl disable logcorrelator.service 2>/dev/null || true
|
||||
systemctl daemon-reload
|
||||
fi
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
# On upgrade, just stop the service (will be restarted by postinst)
|
||||
if [ -x /bin/systemctl ] && [ -d /run/systemd/system ]; then
|
||||
systemctl stop logcorrelator.service 2>/dev/null || true
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "prerm called with unknown argument '$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user