I am having a nasty time running a non-root crontab file on Alpine Linux.I've been through two other cron related posts and I don't have an answer:https://askubuntu.com/questions/23009/why-crontab-scripts-are-not-workinghttps://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-itHere is the setup.My crontab looks like this:PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/binSHELL=/bin/bash* * * * * /opt/monitor/monitor.sh >> /var/log/monitor.log 2>&10 3 * * * /opt/monitor/monitor-log-clean.sh >> /var/log/monitor.log 2>&1My Dockerfile is a little messy now, but only because I have been desperately trying to resolve this. It looks something like this. In short, I add SUID for crontab -e to work as other users, I create my user, I import my crontab file, and then I provide permissions to everything I can think of.FROM alpine:3.5# DEPENDENCY TO ALLOW USERS TO RUN crontab -eRUN apk add --update busybox-suid# I LIKE BASHRUN apk --no-cache add bash bash-docRUN apk --no-cache add util-linux pciutils usbutils coreutils binutils findutils grep#... lots of custom stuff ...    # CREATE USERRUN adduser -S robuser && \    mkdir -p /home/robuser# ADD ENTRY POINTADD src/entrypoint.sh /home/robuser/entrypoint.sh# GIVE MY USER ACCESSRUN mkdir /etc/cron.dRUN echo robuser > /etc/cron.allowRUN echo  >> /etc/cron.allowRUN chmod -R 644 /etc/cron.d# ADD MY CRONTABRUN mkdir -p /var/spool/cron/crontabsADD ./src/crontab.conf /tmp/cloudwatch/crontab.confRUN crontab -u robuser /tmp/cloudwatch/crontab.conf# DEBUG... GIVE MY USER ACCESS TO EVERYTHINGRUN chown -R robuser /etc/cron.dRUN chmod -R 755 /etc/cron.dRUN chown -R robuser /var/spool/cronRUN chmod -R 744 /var/spool/cronRUN chown robuser /var/spool/cron/crontabsRUN chmod 744 /var/spool/cron/crontabsRUN chown -R robuser /etc/crontabsRUN chmod -R 744 /etc/crontabsRUN chown robuser /etc/crontabs/robuserRUN chmod -R 744 /etc/crontabs/robuserRUN chmod 600 /var/spool/cron/crontabs/robuser# ADD MY MONITORING PROGRAMRUN mkdir -p /opt/monitorADD src/monitor /opt/monitorRUN mkdir -p /opt/monitor/.tmp && \    chown -R robuser /opt/monitor && \    chmod -R 700 /opt/monitorRUN touch /var/log/entrypoint.log && \    touch /var/log/monitor.log && \    touch /var/log/cron.log && \    touch /var/log/awslogs.log && \    chown -R robuser /var/logUSER robuserENTRYPOINT /home/robuser/entrypoint.shmeanwhile, my entrypoint.sh has this somewhere in it. I start the cron daemon as a background service and log to cron.log verbosely. I've also tried specifying -d 0 to get even more debug, but the didn't really add anything to the output.#!/bin/bashcrond -b -l 0 -L /var/log/cron.log#... lots of other startup stuff ...An important point: If I don't switch to robuser, everything works okay as root. If I check the cron.log, its pretty empty:crond: crond (busybox 1.25.1) started, log level 0crond: wakeup dt=45crond: wakeup dt=60crond: wakeup dt=60Meanwhile, /var/log/monitor.log is completely empty (see crontab at the beginning of the post).So crond is not printing any errors.I've tried everything i can think of to debug this. There's no error message. It simply runs and never prints. A good suggestion was to simplify my crontab, but this also did not work:PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/binSHELL=/bin/bash* * * * * touch /tmp/test.txtI've tried searching for other alpine containers who use non-root cron, but most people don't go through the trouble of getting their Alpine containers to run non-root.Does anyone have any further suggestions to help debug this?
Why is crond failing to run a non-root crontab on alpine linux?
linux;cron;docker;alpine