Wrong timestamps in ManagedInstalls.plist and ManagedInstallReport.plist?

139 views
Skip to first unread message

MiqViq

unread,
Apr 15, 2013, 4:51:12 AM4/15/13
to munk...@googlegroups.com
Hi,

it seems that munki does not report correct timestamp information, at least when reading these files from the clients:

defaults read "/Library/Preferences/ManagedInstalls" LastCheckDate
2013-04-15 08:03:14 +0000

defaults read "/Library/Managed Installs/ManagedInstallReport"
{
    Conditions =     {
        date = "2013-04-15 11:03:09 +0000";
        "munki_version" = "0.9.0.1773";
    };
    EndTime = "2013-04-15 08:03:14 +0000";
    StartTime = "2013-04-15 08:03:09 +0000";
}

My timezone differs +3 hours so the date in Conditions is reported correctly but other timestamps in "/Library/Managed Installs/ManagedInstallReport.plist" (StartTime, EndTime) and "/Library/Preferences/ManagedInstalls" (LastCheckDate) are not in local timezone.

This is happening on OS X versions 10.8.3 and 10.7.5.

OS X 10.6 seems to have timestamps messed up too;
LastCheckDate, EndTime, StartTime: 2013-04-14 02:21:50 +0300, these are correct.

Conditionals: date = "2013-04-14 05:21:50 +0300", this is +3 hours off.


Can this be corrected?

Or is there something funny with my system or locale settings?


-MiqViq

nbalonso

unread,
Apr 15, 2013, 7:40:25 AM4/15/13
to munk...@googlegroups.com
In my case I get the following:

hostname:~ username$ defaults read "/Library/Managed Installs/ManagedInstallReport" | grep  Time
    EndTime = "2013-04-15 10:51:00 +0000";
    StartTime = "2013-04-15 10:50:45 +0000";
hostname:~ username $ defaults read "/Library/Preferences/ManagedInstalls" LastCheckDate
2013-04-15 10:51:02 +0000


I see that there is a +3hs in your example but I don't know from where you got that. Conditional install? Forced install by date?

Noel

Rob Middleton

unread,
Apr 15, 2013, 7:47:44 AM4/15/13
to munk...@googlegroups.com
Try:
defaults read /Library/Preferences/.GlobalPreferences com.apple.preferences.timezone.selected_city

First thing is to make sure that is what you expected it to be.

Rob.



-MiqViq

--
You received this message because you are subscribed to the Google Groups "munki-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to munki-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Miq Viq

unread,
Apr 15, 2013, 8:12:10 AM4/15/13
to munk...@googlegroups.com
defaults read /Library/Preferences/.GlobalPreferences com.apple.preferences.timezone.selected_city
{
    CountryCode = FI;
    GeonameID = 658225;
    Latitude = "60.17555618286133";
    LocalizedNames =     {
        da = Helsinki;
        de = Helsinki;
        en = Helsinki;
        es = Helsinki;
        fi = Helsinki;
        fr = Helsinki;
        it = Helsinki;
        ko = "\\Ud5ec\\Uc2f1\\Ud0a4";
        nl = Helsinki;
        pl = Helsinki;
        pt = Helsinque;
        "pt-PT" = "Hels\\U00ednquia";
        sv = Helsingfors;
        "zh-Hans" = "\\U8d6b\\U5c14\\U8f9b\\U57fa";
        "zh-Hant" = "\\U8d6b\\U723e\\U8f9b\\U57fa";
    };
    Longitude = "24.93416595458984";
    Name = Helsinki;
    Population = 558457;
    TimeZoneName = "Europe/Helsinki";
    Version = 1;
}

Seems ok to me as I am located in Helsinki, Finland?

Are there any other localization settings file I should check?


-MiqViq

Erik

unread,
Apr 15, 2013, 9:04:23 AM4/15/13
to munk...@googlegroups.com
I noticed a discrepancy between my times as well on reports/overview using MWA last week but I hadn't looked into it yet.

One has the correct time, while the other doesn't.

Rob Middleton

unread,
Apr 15, 2013, 9:33:16 AM4/15/13
to munk...@googlegroups.com
Reading this again .. what is the issue you are reporting?

StartTime, EndTime, LastCheckDate are correct aren't they? The timestamp is at the time these occurred.

In the case of the conditional date -- this is behaving as described here:
(see Notes --
"The date string must be written in UTC format, but is interpreted as a local date/time."

This matches the behaviour of forced_install_after_date. The intention is that for international companies you can choose to force an install at noon localtime -- ie: when IT support people are around to help out.

Rob.

On 15/04/2013, at 6:51 PM, MiqViq wrote:

Gregory Neagle

unread,
Apr 15, 2013, 3:07:30 PM4/15/13
to munk...@googlegroups.com
99% sure this is all working as expected.

Date/Time objects in ManagedInstalls.plist and ManagedInstallReport.plist are NSDate objects and subject to whatever text formatting Apple decides to use. In 10.6 and earlier, this reflected the local timezone; more recently they appear in UTC.

Dates in conditions are interpreted as local time.

So: display of these values when read from defaults might be confusing to humans.

But: are you seeing actual behavior contrary to your expectations?

-Greg

Erik

unread,
Apr 15, 2013, 5:04:35 PM4/15/13
to munk...@googlegroups.com
MiqViq,

The times may not be incorrect. What I think is happening is the Reports have already been generated at an earlier time and the "LastCheckDate" is a few hours later.

Here is an example of a machine which has not had a report in three days, yet the LastCheck is today.

Report: 2013-04-12 15:18

Start:     2013-04-15 19:06:49

Miq Viq

unread,
Apr 17, 2013, 5:37:34 AM4/17/13
to munk...@googlegroups.com
There is indeed a difference how munki reports its StartTime and EndTime timestamp values as a string rather than date (as it does with Conditionals).

However, on my region those timestamps are off different ways, depending which OS X version I have.

I can verify it in MWA, overview shows correct timestamp, computer specific report has those "wrong" values.

I would prefer that munki used regionally correct timestamp for StartTime and EndTime.

If you think that this weirdness should not be happening please give me more troubleshooting guides for checking locale settings etc.


-MiqViq

Gregory Neagle

unread,
Apr 17, 2013, 8:40:51 AM4/17/13
to munk...@googlegroups.com
On Apr 17, 2013, at 2:37 AM, Miq Viq <miq...@gmail.com> wrote:

There is indeed a difference how munki reports its StartTime and EndTime timestamp values as a string rather than date (as it does with Conditionals).

However, on my region those timestamps are off different ways, depending which OS X version I have.

I can verify it in MWA, overview shows correct timestamp, computer specific report has those "wrong" values.

I would prefer that munki used regionally correct timestamp for StartTime and EndTime.

Unfortunately your preferences aren't Apple's. 

Again, Munki is just using the way Apple stores dates in plists. 

See dates in com.apple.SoftwareUpdate.plist in comparison. 
Reply all
Reply to author
Forward
0 new messages