From 8a0859b3cd1a6652fc7aa87680dd8c233eba4262 Mon Sep 17 00:00:00 2001 From: gatici Date: Mon, 31 Jul 2023 16:18:42 +0300 Subject: [PATCH] Changing RO 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: I44bbe0beeafce3932218a0df1d38191a14cb4a8a Signed-off-by: gatici --- installers/charm/osm-ro/src/charm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/installers/charm/osm-ro/src/charm.py b/installers/charm/osm-ro/src/charm.py index 84c0ee30..89da4f12 100755 --- a/installers/charm/osm-ro/src/charm.py +++ b/installers/charm/osm-ro/src/charm.py @@ -302,10 +302,11 @@ class OsmRoCharm(CharmBase): "ro": { "override": "replace", "summary": "ro service", - "command": "python3 -u -m osm_ng_ro.ro_main", + "command": "/bin/sh -c 'cd /app/osm_ro && python3 -u -m osm_ng_ro.ro_main'", # cd /app/osm_nbi is needed until we upgrade Juju to 3.x. "startup": "enabled", "user": USER, "group": GROUP, + "working-dir": "/app/osm_ro", # This parameter has no effect in Juju 2.9.x. "environment": { # General configuration "OSMRO_LOG_LEVEL": self.config["log-level"].upper(), -- 2.25.1