work/root/etc/service/cron/run
2020-04-11 10:53:41 -07:00

27 lines
800 B
Bash

#!/bin/bash
# mostly cribbed from
# https://github.com/phusion/baseimage-docker/tree/master/image/services/cron
chmod 600 /etc/crontab
# https://github.com/phusion/baseimage-docker/issues/345
#sed -i 's/^\s*session\s\+required\s\+pam_loginuid.so/# &/' /etc/pam.d/cron
## Remove useless cron entries.
# Checks for lost+found and scans for mtab.
rm -f /etc/cron.daily/standard
rm -f /etc/cron.daily/upstart
rm -f /etc/cron.daily/dpkg
rm -f /etc/cron.daily/password
rm -f /etc/cron.weekly/fstrim
# Touch cron files to fix 'NUMBER OF HARD LINKS > 1' issue. See
# https://github.com/phusion/baseimage-docker/issues/198
touch -c /var/spool/cron/crontabs/*
touch -c /etc/crontab
touch -c /etc/cron.d/* /etc/cron.daily/* /etc/cron.hourly/*
/etc/cron.monthly/* /etc/cron.weekly/*
exec /usr/sbin/cron -f