From: Dario Faccin Date: Tue, 1 Aug 2023 15:39:36 +0000 (+0200) Subject: Changing MON Pebble Service command to enter the startup directory first X-Git-Tag: release-v15.0-start~31 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=df0501ce624a979cc28c7e184c7529a50e40857e;p=osm%2Fdevops.git Changing MON Pebble Service command to enter the startup directory first In rockcraft.yaml WORKDIR is not supported, so it needs to be specified in Pebble service definition by using working-dir parameter. However, working-dir is not supported in Juju 2.9.x. So, we are entering to the startup directory first as a workaround. Change-Id: I5949b16ce7e28dfb3f235eabd64062a5a185aa9c Signed-off-by: Dario Faccin --- diff --git a/installers/charm/osm-mon/src/charm.py b/installers/charm/osm-mon/src/charm.py index bb98ccf0..21114293 100755 --- a/installers/charm/osm-mon/src/charm.py +++ b/installers/charm/osm-mon/src/charm.py @@ -373,10 +373,11 @@ class OsmMonCharm(CharmBase): self.service_name: { "override": "replace", "summary": "mon service", - "command": "/bin/bash scripts/start.sh", + "command": "/bin/bash -c 'cd /app/osm_mon/ && /bin/bash start.sh'", "startup": "enabled", "user": "appuser", "group": "appuser", + "working-dir": "/app/osm_mon", # This parameter has no effect in Juju 2.9.x "environment": environment, } },