<html><br />On Saturday, December 9, 2017 07:53 CET, Greg Oliver <oliver.greg@gmail.com> wrote:<br /> <blockquote type="cite" cite="CAF4tN+9T87HPg3mCEBgPeE57L8rEdDvVD-4rdXiusxa6Gj9eig@mail.gmail.com"><div dir="ltr">On Sat, Dec 9, 2017 at 12:28 AM, Mike Hodson <span dir="ltr"><<a target="_blank" href="mailto:mystica@gmail.com">mystica@gmail.com</a>></span> wrote:<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-">On Fri, Dec 8, 2017 at 7:13 PM, Bill Meek <span dir="ltr"><<a target="_blank" href="mailto:keemllib@gmail.com">keemllib@gmail.com</a>></span> wrote:</span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><span class="gmail-m_-4592818423654662712gmail-">On 12/08/2017 12:53 PM, Marius Schrecker wrote:</span></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-"><span class="gmail-m_-4592818423654662712gmail-">$sudo bash -c "echo `date '+%s' -d '+ 6 minutes'` > /sys/class/rtc/rtc0/wakealarm</span></span></blockquote></blockquote><div><span class="gmail-"> </span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">Use: echo `date '+%s' -d '+ 6 minutes'`| sudo tee /sys/class/rtc/rtc0/wakealarm"</span></blockquote><div> </div><div>Bill, normally sudo of echo redirecting will not work; the user-shell is still used for redirection.</div><div>However, in his case, not only is he running bash -c "full command with redirect", but he also later cats the result in /sys/class/rtc/rtc0/<wbr />wakealarm and comes up with the proper time/date.</div><div> </div><div>>></div><div><div><span class="gmail-">>> $date</span></div><div><span class="gmail-">>> fr. 08. des. 19:42:53 +0100 2017</span></div><div><span class="gmail-">>> $sudo bash -c "echo `date '+%s' -d '+ 6 minutes'` > /sys/class/rtc/rtc0/wakealarm"</span></div><div><span class="gmail-">>> $ cat /sys/class/rtc/rtc0/wakealarm</span></div><div><span class="gmail-">>> 1512758974</span></div><div><span class="gmail-">>> $ date -d @1512758974</span></div><div><span class="gmail-">>> fr. 08. des. 19:49:34 +0100 2017</span></div></div><div>>></div><div> </div><div>I've even performed an empirical test, and indeed as long as the redirect is within the double-quotes of bash -c "command here > file" it works for me in a different scenario:</div><div> </div><div><span style="font-family:monospace"><span style="font-weight:bold;color:rgb(84,255,84)">mike@bifrost</span><span style="font-weight:bold;color:rgb(84,84,255)"> /root $</span><span style="color:rgb(0,0,0)"> sudo bash -c "echo `date '+%s' -d '+ 6 minutes'` > derp" </span><br />Password: <br /><span style="font-weight:bold;color:rgb(84,255,84)">mike@bifrost</span><span style="font-weight:bold;color:rgb(84,84,255)"> /root $</span><span style="color:rgb(0,0,0)"> ls -al derp </span><br />-rw-r--r-- 1 root root 11 Dec 9 01:21 derp<br /><span style="font-weight:bold;color:rgb(84,255,84)">mike@bifrost</span><span style="font-weight:bold;color:rgb(84,84,255)"> /root $</span><span style="color:rgb(0,0,0)"> cat derp </span><br />1512800877</span><br /> </div><div><div><font face="arial, helvetica, sans-serif">Thus I have to believe that Marius's shell is indeed writing the exposed rtc device properly, unless there are some syntax quoting issues somewhere else.. </font></div></div><div> </div><div>I'm puzzled here, and am curious if A: it has ever worked at all properly, and if not, B: if the BIOS is buggy?</div><div> </div><div><span class="gmail-HOEnZb"><font color="#888888">Mike</font></span></div></div></div></div></blockquote></div></div><div class="gmail_extra"><span style="font-family:monospace"><span style="color:rgb(0,0,0)">echo $(date +%s -d "+6 minutes")</span></span></div></div></blockquote><br /><br />Hello Greg, Mike and Bill,<br /><br /> Thanks very much for your responses.<br /><br />I have never tried this before on this board as the machine was previously on 24/7. The current project is largely to do with splitting the high availability services out into a low-powered device to save power.<br /><br />The BIOS may be buggy, but I'm pretty sure I updated to what is still the latest version shortly after buying the board. Will check next time I turn it on with a screen attached (don't have time right now).<br /><br />A couple of things I forgot to mention yesterday:<br /><br />1. A thing that came up when googling was that back in 2014, quite a few people were complaining that RTC wakeup alarms (on other boards) were only working when HPET is disabled on the startup kernel parameters. I haven't tried that yet, but will.<br /><br />2. A new<br /><span id="messageContent">$cat /sys/class/rtc/rtc0/wakealarm<br />and<br />$cat /proc/driver/rtc<br />after reboot confirm that the alarm is set way into the future, confirming the BIOS screen.<br /><br />3. This is a completely fresh install of Ubuntu 17.10 (originally desktop, but with all the desktop stuff removed). Can anyone think of a service that might be running and resetting the rtc alarm to a diferent value when the machine is shut down?</span><br /><br />4. Can anyone explain the following results of catting /proc/driver/rtc?<br /><br /><span id="messageContent">alrm_pending : no<br />update IRQ enabled : no<br />periodic IRQ enabled : no</span><br /><br />Can they indicate that the values of /proc/driver/rtc are not being written by the os into the BIOS?<br /><br />BR.<br /><br />--Marius--</html>