Prechádzať zdrojové kódy

Do not run system cron tasks

Also disable email output from being sent

Oct 06 16:47:14 postdrop: warning: mail_queue_enter: create file maildrop/428130.366: Read-only file system

What a glorious mess (http://vlinux-freak.blogspot.com/2010/12/working-with-crontab-scheduler.html):

/usr/sbin/crond - The cron service which runs continuously
/etc/crontab - The system cron table, which specifies def jobs defined by RHEL
/usr/bin/crontab - Users create and manage cron table entries
/var/spool/cron/* - The directory that holds cron files created by users
/etc/cron.d/* - The directory that holds cron files created by package installation scripts
/etc/cron.allow - Access Allow File
/etc/cron.deny  - Access Deny File
/etc/cron.hourly/ - If you put any script in this folder they will be executed automatically in every hour.
/etc/cron.daily/   - If you put any script in this folder they will be executed automatically every day basis.
/etc/cron.weekly/ - If you put any script in this folder they will be executed automatically in every week.
/etc/cron.monthly/ - If you put any script in this folder they will be executed automatically in every month.
Girish Ramakrishnan 7 rokov pred
rodič
commit
4cd510face
2 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 2 0
      Dockerfile
  2. 2 1
      start.sh

+ 2 - 0
Dockerfile

@@ -76,6 +76,8 @@ RUN rm -rf /var/log/proftpd && ln -s /run/proftpd /var/log/proftpd
 
 # configure cron
 RUN rm -rf /var/spool/cron && ln -s /run/cron /var/spool/cron
+# clear out the crontab
+RUN rm -f /etc/cron.d/* /etc/cron.daily/* /etc/cron.hourly/* /etc/cron.monthly/* /etc/cron.weekly/* && truncate -s0 /etc/crontab
 
 # configure supervisor
 ADD supervisor/ /etc/supervisor/conf.d/

+ 2 - 1
start.sh

@@ -75,7 +75,8 @@ fi
 
 ## configure in-container Crontab
 if [ -f "/app/data/crontab" ]; then
-    if ! crontab -u www-data /app/data/crontab; then
+    # http://www.gsp.com/cgi-bin/man.cgi?section=5&topic=crontab
+    if ! (cat /app/data/crontab; echo -e '\nMAILTO=""') | crontab -u www-data -; then
         echo "Error importing crontab. Continuing anyway"
     else
         echo "Imported crontab"