build(deb): deb pkg enable/disable emqx system

This commit is contained in:
William Yang 2021-12-03 17:58:21 +01:00
parent 4402327da0
commit 75eafcd630
2 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,12 @@ chmod -R 0755 /usr/lib/emqx/bin
ln -s /usr/lib/emqx/bin/emqx /usr/bin/emqx
ln -s /usr/lib/emqx/bin/emqx_ctl /usr/bin/emqx_ctl
if systemctl status --no-pager; then
systemctl enable emqx;
else
echo "systemd is not in use, skip enable emqx"
fi
case "$1" in
configure)
;;

View File

@ -55,6 +55,11 @@ case "$1" in
if [ -d /usr/lib/emqx ]; then
rm -r /usr/lib/emqx
fi
if pidof systemd; then
systemctl disable emqx;
rm -f /etc/systemd/emqx.service
fi
;;
remove)