Wakealarm only wakes once

    • OMV 4.x
    • Wakealarm only wakes once

      I'm running the latest OMV Arrakis together with the autoshutdown and wakealarm plugins. I configured autoshutdown in a way that it shuts the NAS down after some time of inactivity and wakealarm should wake the NAS up some hours later.

      This sequence works exactly one time, that means:
      - manually start the NAS
      - autoshutdown shuts it down
      - wakealarm wakes it up
      - autoshutdown shuts it down
      - NAS never wakes up again

      Every time I execute date -d @$(cat /sys/class/rtc/rtc0/wakealarm) it shows me the correct time on the correct day, athough I never had a look immediately before shutting the NAS down. So waking up by RTC is generally working, but anything happens after the first wakeup of the second shutdown.

      How can I debug this? Does anyone else have this problem?
    • I think I solved it now. I made the following changes in /usr/sbin/wakealarm:

      Source Code

      1. import subprocess

      Source Code

      1. def set_alarm(self):
      2. """Set upcoming wakealarm."""
      3. if self.next_alarm and self.next_alarm != self.current_alarm:
      4. timestamp = '{0:.0f}\n'.format(time.mktime(self.next_alarm.timetuple()))
      5. # with open(WAKEALARM, 'w') as f:
      6. # f.write('0\n')
      7. # with open(WAKEALARM, 'w') as f:
      8. # f.write(timestamp)
      9. subprocess.call(["sudo", "rtcwake", "-m", "no", "-u", "-t", timestamp[:-1]])
      10. log.info('Wakealarm set to: %s', self.next_alarm)
      11. else:
      12. log.warning('No alarm to be set.')
      Display All
    • You can also run a command like this one as scheduled job

      rtcwake -m off -t $(date -d "next sat 07:00" +%s)

      It will shut down the server and wake it up on next saturday at 7 AM.
      Odroid HC2 - armbian - Seagate ST4000DM004 - OMV4.x | Asrock Q1900DC-ITX - 16GB - 2x Seagate ST3000VN000 - Intenso SSD 120GB - OMV4.x
      :!: Backup - Solutions to common problems in OMV - OMV setup videos - OMV4 Documentation :!:
    • Yes, I know. The advantage of the wakealarm plugin is that it is very comfortable to have more than only a few wakeup times and you can adjust the times easily. Using the scheduled jobs does not offer that comfort.

      Edit:
      And it doesn't explain why the stock version or my version above don't work.

      The post was edited 1 time, last by myscha ().

    • myscha wrote:

      Yes, I know. The advantage of the wakealarm plugin is that it is very comfortable to have more than only a few wakeup times and you can adjust the times easily. Using the scheduled jobs does not offer that comfort.

      Edit:
      And it doesn't explain why the stock version or my version above don't work.
      I am in your same situation.

      Wakealarm only works the first time after the shut down. The rtcwake workaround works every time, but it is more comfortable to scheduled it from the plugin as in my case it depends from weekdays/weekends and between months so I have to change it quite frequently-
      || omv 4.0.14 | kernel 4.9.0 | omvextrasorg 4.1.0 ||
    • I had a similar problem with the wakealarm plug-in.
      Although the test of the rtcwake command by a root-terminal was positive, the scheduled wake-alarms didn’t work. Obviously it was no fault of the wakealarm plug-in, because controlling the rtc setting with cat /proc/driver/rtc showed, the alarm time and date was set according to the specified wake-alarms.

      Scheduled Jobs didn’t work either.
      The command rtcwake -m no -t $(date -d "tomorrow 03:25" +%s) via root-terminal worked fine, but not as a scheduled job.

      My solution was changing the shutdown command in the AutoShutdown Plug-in from "suspend" / "Unterbrechen" / S3 to "hibernate" / "Ruhezustand" / S4. After that 3 of 4 specified wake-alarms (for daily, weekly and monthly backups) worked properly. As yet I had no chance to test the yearly wake-alarm.

      Software Versions:
      OpenMediaVault 4.1.8.2-1
      autoshutdown plug-in 4.0.4
      wakealarm plug-in 4.0
      omv 4.1.8.2-1 | 64 bit | omvextrasorg 4.1.7 | kernel 4.16.0.0
      used plugins: apttool 3.5 | autoshutdown 4.0.4 | wakealarm 4.0 | backup 3.11 |rsnapshot 4.1.3 | minidlna 3.3.11 | nginx 4.0.2