* 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>
* avoid the need for a second bulky binary for grafana-cli
* look for grafana-server in $PATH as well as same directory
* implement unified "grafana" command
* update dockerfiles, fix grafana-cli -v
* update packaging to work with single binary
- add wrapper scripts for grafana and grafana-server
- update and sync package files
- implement --sign flag of build package command
- stop packaging scripts folder, they are not useful for end users
- add support for --configOverrides in server command
- remove unused nfpm.yaml config file
* windows support
In systemd `After=` merely codes an ordering relation and does not start
other units.
Grafana needs to specify that it wants to start up _after_ either of the
supported DB services have started, _if they start_.
Enabling the database services, however, is out of scope for Grafana.
The current script only tries to start the already running grafana process after an upgrade. This leads to errors due to changed js and css hashes while grafana is delivering the old ones. To load the new sources we need to restart grafana after an upgrade.
The umask as 0027 will generates permissions like:
0640 - for files
0750 - for directories
This should solve the grafana.db being accesable by any user for new installations.