Skip to content

Commit

Permalink
Fix cron workaround issue at CERN (#1543)
Browse files Browse the repository at this point in the history
  • Loading branch information
khurtado authored Aug 26, 2024
1 parent 11fcfc1 commit 9317a10
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docker/pypi/wmagent/wmagent-docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,11 @@ docker run $dockerOpts $registry/$repository:$WMA_TAG
docker exec -u root -it wmagent service cron start

# Workaround su authentication issue (cron uses setuid via su)
docker exec -u root -it wmagent sh -c "echo $wmaUser:$wmaUser | chpasswd"
# We inherit user accounts from the host (binding files in read-only mode)
# including the password mode (L=locked, P=password)
# If we are in password mode, reset it so we do not get authentication
# errors.
userStatus="$(docker exec -u root -it wmagent sh -c "passwd -S $wmaUser" | awk '{print $2}')"
if [ "${userStatus:0:1}" == "P" ]; then
docker exec -u root -it wmagent sh -c "echo $wmaUser:$wmaUser | chpasswd"
fi

0 comments on commit 9317a10

Please sign in to comment.