Skip to content

Commit

Permalink
fix data directory permissions (#143)
Browse files Browse the repository at this point in the history
  • Loading branch information
delgod authored May 19, 2023
1 parent 5fca9e9 commit 4494a94
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4494a94

Please sign in to comment.