From 4494a942fa1b34792ee8f53fd4169bb55ee429cc Mon Sep 17 00:00:00 2001 From: Mykola Marzhan <303592+delgod@users.noreply.github.com> Date: Fri, 19 May 2023 13:36:26 +0200 Subject: [PATCH] fix data directory permissions (#143) --- src/charm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index 228bf8721..3a5fce2fa 100755 --- a/src/charm.py +++ b/src/charm.py @@ -456,7 +456,7 @@ def _fix_data_dir(container: Container) -> None: assert len(paths) == 1, "list_files doesn't return only the directory itself" logger.debug(f"Data directory ownership: {paths[0].user}:{paths[0].group}") if paths[0].user != UNIX_USER or paths[0].group != UNIX_GROUP: - container.exec(f"chown -o {UNIX_USER} -g {UNIX_GROUP} -R {DATA_DIR}".split(" ")) + container.exec(f"chown {UNIX_USER}:{UNIX_GROUP} -R {DATA_DIR}".split(" ")) def get_hostname_by_unit(self, unit_name: str) -> str: """Create a DNS name for a MongoDB unit.