diff --git a/package/deb/postrm b/package/deb/postrm index e69de29bb..c913aa083 100644 --- a/package/deb/postrm +++ b/package/deb/postrm @@ -0,0 +1,5 @@ +#!/bin/sh +set -e + +# Reload systemd unit +systemctl daemon-reload diff --git a/package/deb/prerm b/package/deb/prerm new file mode 100644 index 000000000..32ea7d4ca --- /dev/null +++ b/package/deb/prerm @@ -0,0 +1,5 @@ +#!/bin/sh +set -e + +# Reload systemd unit +systemctl stop victoria-metrics diff --git a/package/package_deb.sh b/package/package_deb.sh index d3e2272c4..545a082c9 100755 --- a/package/package_deb.sh +++ b/package/package_deb.sh @@ -46,7 +46,6 @@ echo "*** Out .deb : ${OUT_DEB}" # Copy the binary cp "./bin/${EXENAME_SRC}" "${TEMPDIR}/usr/sbin/${EXENAME_DST}" -file "${TEMPDIR}/usr/sbin/${EXENAME_DST}" # Copy supporting files @@ -70,6 +69,7 @@ cp "${PACKDIR}/deb/conffile" "${TEMPDIR}/conffile" # Copy postinst and postrm cp "${PACKDIR}/deb/postinst" "${TEMPDIR}/postinst" +cp "${PACKDIR}/deb/prerm" "${TEMPDIR}/prerm" cp "${PACKDIR}/deb/postrm" "${TEMPDIR}/postrm" ( @@ -84,8 +84,8 @@ cp "${PACKDIR}/deb/postrm" "${TEMPDIR}/postrm" # Archive control chmod 644 control md5sums - chmod 755 postrm postinst - fakeroot -- tar -c --xz -f ./control.tar.xz ./control ./md5sums ./postinst ./postrm + chmod 755 postinst postrm prerm + fakeroot -- tar -c --xz -f ./control.tar.xz ./control ./md5sums ./postinst ./prerm ./postrm # Archive data