diff --git a/10/prebuilds/usr/local/bin/appcommon.sh b/10/prebuilds/usr/local/bin/appcommon.sh index df9a65c..b60e3ec 100644 --- a/10/prebuilds/usr/local/bin/appcommon.sh +++ b/10/prebuilds/usr/local/bin/appcommon.sh @@ -177,7 +177,7 @@ postgresql_conf_set() { # $1 - 变量 # $2 - 值(列表) postgresql_hba_set() { - replace_in_file "${PG_HBA_FILE}" "${key}" "${value}" false + replace_in_file "${PG_HBA_FILE}" "$1" "$2" false } # 更新 pg_ident.conf 配置文件中指定变量值 diff --git a/10/prebuilds/usr/local/bin/entrypoint.sh b/10/prebuilds/usr/local/bin/entrypoint.sh index 4140ffa..9affa54 100644 --- a/10/prebuilds/usr/local/bin/entrypoint.sh +++ b/10/prebuilds/usr/local/bin/entrypoint.sh @@ -59,12 +59,13 @@ _main() { # 以root用户启动时,修改相应目录的所属用户信息为APP_USER,确保切换用户时,权限正常 for dir in ${APP_DIRS}; do LOG_D "Change ownership and permissions of $dir" - configure_permissions_ownership "$dir" -f 755 -d 755 -u "${APP_USER}" + chmod 0755 "$dir" + configure_permissions_ownership "$dir" -u "${APP_USER}" -g "${APP_GROUP}" done # 解决 PostgreSQL 目录权限过于开放,无法初始化问题:FATAL: data directory "/srv/data/postgresql" has group or world access LOG_D "Lack of permissions on data directory: ${PG_DATA_DIR}" - chmod -R 0700 ${PG_DATA_DIR} ${APP_DATA_DIR} + chmod 0700 ${PG_DATA_DIR} ${APP_DATA_DIR} # 解决使用gosu后,nginx: [emerg] open() "/dev/stdout" failed (13: Permission denied) LOG_D "Change permissions of stdout/stderr to 0622"