Anacron won't fully run with Autoshutdown installed

    • OMV 3.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Anacron won't fully run with Autoshutdown instaled

      Hello everyone. I've been struggling with this issue for a while now and I seem to be stuck. Anyway, about the 7 months ago, my cron jobs stopped executing for no apparent reason (and I'm guessing the Update Management is part of this because I now have to manually execute to check for updates). I have Autoshutdown installed and running. Every morning, a PC on my network will wake up the NAS to do about 10 minutes of work and then Autoshutdown will put the NAS to sleep about 20 minutes later. Looking at the syslog, it appears that Anacron starts at the last second right when Autoshutdown is issuing the suspend command. Anacron updates the timestamps but never actually executes. Is there a way to get Anacron to start shortly after OMV wakes up? I tried messing with the delay, but that doesn't seem to help.

      The following is a snippet of the syslog:
      Aug 12 06:00:16 nas logger: autoshutdown[19985]: INFO: ' No active hosts or processes within network range, 0 cycles until shutdown...'
      Aug 12 06:00:16 nas - : autoshutdown [19985]: INFO: Shutdown issued: 'pm-suspend'
      Aug 12 06:00:16 nas autoshutdown.sh[19985]: - : autoshutdown [19985]: INFO: Shutdown issued: 'pm-suspend'
      Aug 12 06:00:16 nas logger: autoshutdown[19985]: INFO: ' Shutdown issued: 'pm-suspend''
      Aug 12 06:00:16 nas logger: autoshutdown[19985]: INFO: ' '
      Aug 12 06:00:16 nas logger: autoshutdown[19985]: INFO: ' '
      Aug 12 06:00:17 nas systemd[1]: Starting Run anacron jobs...
      Aug 12 06:00:17 nas systemd[1]: Started Run anacron jobs.
      Aug 12 06:00:17 nas anacron[26800]: Anacron 2.3 started on 2017-08-12
      Aug 12 06:00:17 nas anacron[26800]: Will run job `cron.daily' in 0 min.
      Aug 12 06:00:17 nas anacron[26800]: Will run job `cron.weekly' in 2 min.
      Aug 12 06:00:17 nas anacron[26800]: Jobs will be executed sequentially
      Aug 12 06:00:17 nas anacron[26800]: Job `cron.daily' started
      Aug 12 06:00:17 nas anacron[26807]: Updated timestamp for job `cron.daily' to 2017-08-12
      Aug 12 06:00:17 nas systemd[1]: Stopping Run anacron jobs...
      Aug 12 06:00:17 nas systemd[1]: Stopped Run anacron jobs.
      Aug 12 06:00:18 nas autoshutdown [26972]: hibernate/suspend: autoshutdown-script stop from /etc/pm/sleep.d/autoshutdown-restart

      If I disable Autoshutdown and let the NAS stay on 24/7, then the jobs run as expected.

      Any guidance on how to resolve this would greatly be appreciated.

      Thanks.
      OMV 3.0.xx (Erasmus)
      Supermicro MBD-X9SPV-M4-3UE-O MB
      8GB Supermicro ECC RAM
      1 - Patriot 32GB SSD
      2 - Seagate 4TB (RAID 0)
    • I am still having issues with this. I re-installed OMV and hasn't improved anything. Here is a partial log:

      Sep 26 04:45:05 nas CRON[6391]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)
      Sep 26 04:45:05 nas CRON[6392]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
      Sep 26 04:55:01 nas CRON[6712]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
      Sep 26 05:00:01 nas CRON[6855]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)
      Sep 26 05:05:01 nas CRON[7190]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
      Sep 26 05:09:01 nas CRON[7292]: (root) CMD ( [ -x /usr/lib/php5/sessionclean ] && /usr/lib/php5/sessionclean)
      Sep 26 05:15:01 nas CRON[7886]: (root) CMD (/usr/sbin/omv-mkgraph >/dev/null 2>&1)
      Sep 26 05:15:01 nas CRON[7887]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
      Sep 26 05:17:01 nas CRON[7954]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
      Sep 26 05:20:08 nas - : autoshutdown [4189]: INFO: Shutdown issued: 'pm-suspend'
      Sep 26 05:20:08 nas autoshutdown.sh[4189]: - : autoshutdown [4189]: INFO: Shutdown issued: 'pm-suspend'
      Sep 26 05:20:08 nas systemd[1]: Starting Run anacron jobs...
      Sep 26 05:20:08 nas systemd[1]: Started Run anacron jobs.
      Sep 26 05:20:08 nas anacron[8351]: Anacron 2.3 started on 2017-09-26
      Sep 26 05:20:08 nas anacron[8351]: Will run job `cron.daily' in 5 min.
      Sep 26 05:20:08 nas anacron[8351]: Will run job `cron.weekly' in 10 min.
      Sep 26 05:20:08 nas anacron[8351]: Jobs will be executed sequentially
      Sep 26 05:20:08 nas systemd[1]: Stopping Run anacron jobs...
      Sep 26 05:20:08 nas systemd[1]: Stopped Run anacron jobs.
      Sep 26 05:20:09 nas autoshutdown [8502]: hibernate/suspend: autoshutdown-script stop from /etc/pm/sleep.d/autoshutdown-restart


      Any thoughts on what I can try?

      Thanks.
      OMV 3.0.xx (Erasmus)
      Supermicro MBD-X9SPV-M4-3UE-O MB
      8GB Supermicro ECC RAM
      1 - Patriot 32GB SSD
      2 - Seagate 4TB (RAID 0)
    • Thanks for replying with a possible fix. Not sure why I didn't see Tobi90's post, but that sounds like the same issue that I am having. I tried your fix but it did not help in my case. The autoshutdown.service file was only in my multi-user.target.wants directory so I copied it to the others, but that still didn't do anything.
      OMV 3.0.xx (Erasmus)
      Supermicro MBD-X9SPV-M4-3UE-O MB
      8GB Supermicro ECC RAM
      1 - Patriot 32GB SSD
      2 - Seagate 4TB (RAID 0)