Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEB: disable service on purge instead of removal, restart on upgrade #218

Merged
merged 2 commits into from
Feb 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions install/debian/postinst.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ fi

systemctl daemon-reload || true

# Only enable/start on initial install
# Add/update state file, required for purge action in postrm
deb-systemd-helper update-state $NAME.service || true

# Only enable on initial install
if [ -z "$2" ]; then
systemctl -q enable $NAME || true
systemctl start $NAME || true
Expand All @@ -49,7 +52,7 @@ else
systemctl -q enable $NAME || true
fi

systemctl try-restart $NAME || true
systemctl restart $NAME || true
fi

echo
Expand Down
3 changes: 3 additions & 0 deletions install/debian/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ case "$1" in
;;

purge)
# Disable service
deb-systemd-helper purge $NAME.service || true

# Remove all files
rm -rf /etc/$NAME /var/lib/$NAME /var/log/$NAME

Expand Down
1 change: 0 additions & 1 deletion install/debian/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ NAME=fah-client
case "$1" in
remove)
systemctl stop $NAME || true
systemctl -q disable $NAME || true
;;
esac