From 4bde5309c5fd502eb3267dc003c1be038b23128f Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 18 Oct 2024 10:07:55 -0700 Subject: [PATCH] nextcloud: Fix install failure due to PrivateTmp=yes Fixes: #2463. - When FreedomBox service is run via systemd and if the unit has PrivateTmp=yes as was recently introduced, then 'podman exec --user www-data' fails with error 'Error: unable to find user www-data: no matching entries in passwd file'. - The problem seems isolated to this specific instance and does not seem to effect the container start up (which happens via systemd). Tests: - Without the patch, start FreedomBox service via systemd and install Nextcloud. It fails. - With the patch, install succeeds and functional tests for Nextcloud succeed. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/nextcloud/privileged.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plinth/modules/nextcloud/privileged.py b/plinth/modules/nextcloud/privileged.py index 1ef8c707b..04c378521 100644 --- a/plinth/modules/nextcloud/privileged.py +++ b/plinth/modules/nextcloud/privileged.py @@ -20,6 +20,7 @@ SERVICE_NAME = 'nextcloud-freedombox' VOLUME_NAME = 'nextcloud-freedombox' IMAGE_NAME = 'docker.io/library/nextcloud:stable-fpm' +WWW_DATA_UID = '33' DB_HOST = 'localhost' DB_NAME = 'nextcloud_fbx' DB_USER = 'nextcloud_fbx' @@ -76,7 +77,7 @@ def _run_in_container( env: dict[str, str] | None = None) -> subprocess.CompletedProcess: """Run a command inside the container.""" env_args = [f'--env={key}={value}' for key, value in (env or {}).items()] - command = ['podman', 'exec', '--user', 'www-data' + command = ['podman', 'exec', '--user', WWW_DATA_UID ] + env_args + [CONTAINER_NAME] + list(args) return subprocess.run(command, capture_output=capture_output, check=check)