diff options
author | Lukasz Woznicki <75632179+makr11st@users.noreply.github.com> | 2021-11-15 09:47:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 09:47:43 +0000 |
commit | 3284e897b8ec53ca29ec63baecd5fcf56cd04aeb (patch) | |
tree | 49e22630010826a2f2797c58d6807b0bd43d14a0 /configuration/debian/tedge_mapper | |
parent | 0d6460469d039e0221161144c077863544778416 (diff) |
[CIT-671] Add more explicit message when service manager is not found (#568)
* Add more explicit message when service manager is not found
* Add message on disconnect
* Add conditional use of systemctl in deb scripts
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
Diffstat (limited to 'configuration/debian/tedge_mapper')
-rw-r--r-- | configuration/debian/tedge_mapper/prerm | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/configuration/debian/tedge_mapper/prerm b/configuration/debian/tedge_mapper/prerm index 4473ec06..a8563a9e 100644 --- a/configuration/debian/tedge_mapper/prerm +++ b/configuration/debian/tedge_mapper/prerm @@ -9,24 +9,27 @@ print_hint() { echo "Known mappers are: tedge-mapper-c8y, tedge-mapper-collectd, tedge-mapper-sm-c8y, tedge-mapper-az". } -if systemctl is-active --quiet tedge-mapper-c8y; then - print_hint "tedge-mapper-c8y" - exit 1 -fi +# Reenable the services only if systemctl is available +if command -v systemctl >/dev/null; then + if systemctl is-active --quiet tedge-mapper-c8y; then + print_hint "tedge-mapper-c8y" + exit 1 + fi -if systemctl is-active --quiet tedge-mapper-sm-c8y; then - print_hint "tedge-mapper-sm-c8y" - exit 1 -fi + if systemctl is-active --quiet tedge-mapper-sm-c8y; then + print_hint "tedge-mapper-sm-c8y" + exit 1 + fi -if systemctl is-active --quiet tedge-mapper-collectd; then - print_hint "tedge-mapper-collectd" - exit 1 -fi + if systemctl is-active --quiet tedge-mapper-collectd; then + print_hint "tedge-mapper-collectd" + exit 1 + fi -if systemctl is-active --quiet tedge-mapper-az; then - print_hint "tedge-mapper-az" - exit 1 + if systemctl is-active --quiet tedge-mapper-az; then + print_hint "tedge-mapper-az" + exit 1 + fi fi #DEBHELPER# |