As Alexander already pointed out you did not provide the actual command how 
you set the SEL time.



You can try the following command instead which will not execute the code path 
described below.



ipmitool sel set time now



Based on your information this would be my guess of what happens:



'date --utc' returns GMT/UTC time and is your input to the 'set sel time' 
command.



This is parsed with strptime() which returns a struct tm based on the provided 
string, so this will also match the original GMT/UTC time and not local time.



Then tm.tm_isdst is set to -1 and the struct tm passed to mktime() which will 
try to determine if DST is in effect based on the local timezone information 
of your host. My guess is that this not only sets the DST flag but also 
adjusts the time offset based on your local timezone information (hence the 3 
hour difference result)



Original discussion see (they used a simpler time sting as input without 
timezone information and discussed about tm.tm_isdst being set to 'random' 
values)

 <https://sourceforge.net/p/ipmitool/bugs/109/> 
https://sourceforge.net/p/ipmitool/bugs/109/



Some notes:

The IPMI SEL time is supposed to be in local time for historical reasons (see 
timestamp format definition in the IPMI spec). Setting it to UTC might not be 
what you want to do in the first place. Also there is no real timezone 
information in IPMI, you just can set an UTC offset with optional IPMI 
commands but have to take care of switching to/from DST manually. Also this 
might depend on the BMC RTC, some systems share this with the main system RTC 
others have a separate chip for the BMC. The main system's RTC depends on the 
running O/S, Windows typically sets the RTC to local time while Linux sets it 
to UTC on x86 based hardware (I know you are running on mips64). So if the RTC 
is shared between your BMC and the host this has also side effects.



Holger





From: Anusha K <anusha.kond...@gmail.com>
Sent: Wednesday, June 6, 2018 9:07 AM
To: ipmitool-devel@lists.sourceforge.net
Subject: [Ipmitool-devel] ipmitool get sel time out of sync



Hi,



We are trying booting a mips64 architecture board(octeon) and upgraded 
ipmitool from 1.8.9 to 1.8.18 version. We find that after NPT sync, date and 
ipmitool get sel time are not inline.



Before upgrade:



# ipmitool -V

ipmitool version 1.8.9

#ipmitool sel time get

06/04/2018 07:35:47

# date --utc

Mon Jun  4 07:35:50 UTC 2018



After upgrade:



# ipmitool -V
ipmitool version 1.8.18



#date --utc
Mon Jun  4 07:35:50 UTC 2018



# ipmitool sel time get
06/04/2018 04:36:19

There is a 3 hours difference.



When the board boots, we use ipmitool sel time get command to configure the 
time before NTP synchronization, which is failing with this new version. Is 
there any bug/fix specific to this.



Please let me know if you need more information.



Regards,

Anusha



Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to