diff --git a/setup.sh b/setup.sh index 89a5ff5..72ebd9b 100755 --- a/setup.sh +++ b/setup.sh @@ -45,8 +45,8 @@ if $DRY_RUN; then fi # Create a system user and group if not exists (assuming perforce user exists) -if ! id -u perforce >/dev/null 2>&1; then - run_command "useradd -r -s /bin/false perforce" +if ! id -u ${SERVICE_USER} >/dev/null 2>&1; then + run_command "useradd -r -s /bin/bash ${SERVICE_USER}" fi # Create necessary directories @@ -59,11 +59,11 @@ run_command "install -m 0644 auth.yaml ${INSTALL_DIR}/auth.yaml" run_command "install -m 0644 config.yaml ${INSTALL_DIR}/config.yaml" run_command "install -m 0644 .p4config ${INSTALL_DIR}/.p4config" -# Set ownership for the files and directories to perforce or Service User +# Set ownership for the files and directories to the Service User +# Ensure all files in INSTALL_DIR and DATA_DIR are owned by SERVICE_USER run_command "chown -R ${SERVICE_USER}:${SERVICE_USER} ${INSTALL_DIR}" run_command "chown -R ${SERVICE_USER}:${SERVICE_USER} ${DATA_DIR}" -# Handle service file creation directly (no run_command for here-documents) if $DRY_RUN; then echo "[DRY RUN] Creating service file at ${SERVICE_FILE} with the following content:" cat <