grafana/packaging
MichaIng 71e5024d7a
Packaging: Stop and disable service on DEB package removal (#59580)
* Stop and disable service on DEB package removal

The condition for this code to run applies on package removal only, not on upgrade or reinstall which generally invoke the prerm script as well.

Currently the service keeps running after package removal, failing at some point due to missing files. And if enabled, the attempted service start on every boot is doomed to fail.

If the invoke-rc.d command exists, it can be assumed that update-rc.d exists as well, as both are part of the same init-system-helpers package in dpkg distro repositories.

If neither systemd, nor the init system helper package is installed, the service is not tried to be disabled, since we cannot know a safe method to do so.

Compared to the postinst script, "set -e" is skipped here, since we do not run any command which is allowed to fail the whole package removal.

Signed-off-by: MichaIng <micha@dietpi.com>

* Add postrm script to package build

Signed-off-by: MichaIng <micha@dietpi.com>

* Remove redundant check

Co-authored-by: Dan Cech <dan@aussiedan.com>

---------

Signed-off-by: MichaIng <micha@dietpi.com>
Co-authored-by: Dan Cech <dan@aussiedan.com>
2023-02-21 10:40:38 -05:00
..
autocomplete Switch grafana server command to use urfave/cli/v2 (#60684) 2022-12-24 22:33:18 -05:00
deb Packaging: Stop and disable service on DEB package removal (#59580) 2023-02-21 10:40:38 -05:00
docker Build: Unify custom dockerfiles, fix missing semicolon (#59615) 2022-12-01 11:08:31 -05:00
mac/bin Server: Switch from separate server & cli to a unified grafana binary (#58286) 2022-11-22 11:53:43 -05:00
rpm Server: Switch from separate server & cli to a unified grafana binary (#58286) 2022-11-22 11:53:43 -05:00
wrappers Build: don't remove grafana-server and grafana-cli binaries from deb and rpm packages (#59890) 2022-12-06 10:36:43 -05:00