From 1bc73f1e7892ca499683ef2d7002db1de09cd322 Mon Sep 17 00:00:00 2001 From: wilmardo Date: Sun, 5 Apr 2020 20:58:47 +0200 Subject: [PATCH 1/2] chore: fix indenting in userSetup.sh Signed-off-by: wilmardo --- transmission/userSetup.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/transmission/userSetup.sh b/transmission/userSetup.sh index eea5137ad..c1da9d0a8 100644 --- a/transmission/userSetup.sh +++ b/transmission/userSetup.sh @@ -6,8 +6,12 @@ RUN_AS=root if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then RUN_AS=abc - if [ ! "$(id -u ${RUN_AS})" -eq "$PUID" ]; then usermod -o -u "$PUID" ${RUN_AS} ; fi - if [ ! "$(id -g ${RUN_AS})" -eq "$PGID" ]; then groupmod -o -g "$PGID" ${RUN_AS} ; fi + if [ ! "$(id -u ${RUN_AS})" -eq "$PUID" ]; then + usermod -o -u "$PUID" ${RUN_AS}; + fi + if [ ! "$(id -g ${RUN_AS})" -eq "$PGID" ]; then + groupmod -o -g "$PGID" ${RUN_AS}; + fi # Make sure directories exist before chown and chmod mkdir -p /config \ @@ -27,18 +31,18 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then ${TRANSMISSION_HOME} if [ "$GLOBAL_APPLY_PERMISSIONS" = true ] ; then - echo "Setting owner for transmission paths to ${PUID}:${PGID}" + echo "Setting owner for transmission paths to ${PUID}:${PGID}" chown -R ${RUN_AS}:${RUN_AS} \ ${TRANSMISSION_DOWNLOAD_DIR} \ ${TRANSMISSION_INCOMPLETE_DIR} \ ${TRANSMISSION_WATCH_DIR} - echo "Setting permission for files (644) and directories (755)" + echo "Setting permission for files (644) and directories (755)" chmod -R go=rX,u=rwX \ ${TRANSMISSION_DOWNLOAD_DIR} \ ${TRANSMISSION_INCOMPLETE_DIR} \ - echo "Setting permission for watch directory (775) and its files (664)" + echo "Setting permission for watch directory (775) and its files (664)" chmod -R o=rX,ug=rwX \ ${TRANSMISSION_WATCH_DIR} fi From 8b708738bf5add43eda5aabb477894a6ff1fc8e6 Mon Sep 17 00:00:00 2001 From: wilmardo Date: Sun, 5 Apr 2020 20:58:10 +0200 Subject: [PATCH 2/2] fix: write to /dev/stdout and set permissions Signed-off-by: wilmardo --- transmission/start.sh | 2 +- transmission/userSetup.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/transmission/start.sh b/transmission/start.sh index 2da99df64..12d28c811 100755 --- a/transmission/start.sh +++ b/transmission/start.sh @@ -61,7 +61,7 @@ if [[ "true" = "$DROP_DEFAULT_ROUTE" ]]; then fi if [[ "true" = "$DOCKER_LOG" ]]; then - LOGFILE=/proc/1/fd/1 + LOGFILE=/dev/stdout else LOGFILE=${TRANSMISSION_HOME}/transmission.log fi diff --git a/transmission/userSetup.sh b/transmission/userSetup.sh index c1da9d0a8..b3c3557a8 100644 --- a/transmission/userSetup.sh +++ b/transmission/userSetup.sh @@ -13,6 +13,10 @@ if [ -n "$PUID" ] && [ ! "$(id -u root)" -eq "$PUID" ]; then groupmod -o -g "$PGID" ${RUN_AS}; fi + if [[ "true" = "$DOCKER_LOG" ]]; then + chown ${RUN_AS}:${RUN_AS} /dev/stdout + fi + # Make sure directories exist before chown and chmod mkdir -p /config \ ${TRANSMISSION_HOME} \