Forcing Munki to install updates at logout

412 views
Skip to first unread message

MiqViq

unread,
Oct 17, 2015, 11:04:37 AM10/17/15
to munk...@googlegroups.com
Hi,

in another thread there was an suggestion to use a munki postflight to check if there are any pensing updates and if so then crete trigger file for munki to start installing updates after logout.

Greg N wrote:
>
> Or, you _could_, if you wished, in a Munki postflight script, check to see if there are any pending updates (`defaults read /Library/Preferences/ManagedInstalls PendingUpdateCount`). If there are any, the script could then touch /private/tmp/com.googlecode.munki.installatlogout, which would cause Munki to attempt to install any pending updates at the next logout. There would be no delay — the behavior would be exactly the same as if the user had been notified by MSC and then clicked “Update” and agreed to a required logout. I have not actually tried/tested this, but I believe it would work.

I was thinking if this feature could be built into munki itself, as optional behaviour?
Manageable with a key in plist?

On initial thought this should not require huge changes with the code?

#

Optionally there could be a prompt from munki to GUI user something like "There are pending updates for this computer.
Please do not shut down the computer after you logout."
And this prompt should be customisable too.


- MiqViq




Gregory Neagle

unread,
Oct 17, 2015, 12:34:55 PM10/17/15
to munk...@googlegroups.com

> On Oct 17, 2015, at 8:01 AM, MiqViq <miq...@gmail.com> wrote:
>
> Hi,
>
> in another thread there was an suggestion to use a munki postflight to check if there are any pensing updates and if so then crete trigger file for munki to start installing updates after logout.
>
> Greg N wrote:
>>
>> Or, you _could_, if you wished, in a Munki postflight script, check to see if there are any pending updates (`defaults read /Library/Preferences/ManagedInstalls PendingUpdateCount`). If there are any, the script could then touch /private/tmp/com.googlecode.munki.installatlogout, which would cause Munki to attempt to install any pending updates at the next logout. There would be no delay — the behavior would be exactly the same as if the user had been notified by MSC and then clicked “Update” and agreed to a required logout. I have not actually tried/tested this, but I believe it would work.
>
> I was thinking if this feature could be built into munki itself, as optional behaviour?
> Manageable with a key in plist?
>
> On initial thought this should not require huge changes with the code?

I dislike this. A user logs out, perhaps expecting to log back in immediately, or to shut down, and unexpectedly the Munki Status window appears and now the user has no idea when they’ll be let back in.

If you want to implement this for yourself, go ahead. It would be a simple postflight script. If there are multiple Munki admins who want to do this, you can all collaborate and make the “best” script.

>
> #
>
> Optionally there could be a prompt from munki to GUI user something like "There are pending updates for this computer.

You are describing Managed Software Center. It launches and tells the user there are pending updates. They can even choose to install them.

> Please do not shut down the computer after you logout."
> And this prompt should be customisable too.
>
>
> - MiqViq
>
>
>
>
> --
> Find related discussion groups here:
> https://github.com/munki/munki/wiki/Discussion-Group
> ---
> 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.
> To post to this group, send email to munk...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

MiqViq

unread,
Oct 17, 2015, 4:06:38 PM10/17/15
to munk...@googlegroups.com
But cannot user cancel the install run pressing Stop/Cancel button on MunkiStatus window?

- MiqViq

Kostas Backas-Gmail

unread,
Oct 19, 2015, 7:13:03 AM10/19/15
to munk...@googlegroups.com

As the other thread was mine, I got an answer by Greg, and thats the way Munki is designed to work.

However, I would like this feature to exist myself. I have 2 production Munki installation and both the clients IT persons asked for this (the ability to force updates immediately on logout).

I will check the postflight script solution and maybe I will use Yoann's Hello IT to allow users to trigger this file (yes there are users that cannot use the MSC effectively).

Best regards

Kostas

MiqViq

unread,
Oct 19, 2015, 8:46:07 AM10/19/15
to munk...@googlegroups.com
Planning to test postflight solution too, when I have time.

What is Yoann's Hello IT?


- MiqViq

MiqViq

unread,
Oct 19, 2015, 8:48:31 AM10/19/15
to munk...@googlegroups.com
Ahha,

found IT:

https://github.com/ygini/Hello-IT

Does anyone know other similar solutions?


- MiqViq

karamoja

unread,
Oct 21, 2015, 3:55:05 AM10/21/15
to munki-dev
Just want to add my thoughts on this.  I would really like to see this feature incorporated.   I manage upwards of 80 staff macs (nearly all academics) and I find they all hate installing updates during their working day.  There is only one thing they hate more, and that is being forced to do them by a certain time.  This feature would bring Munki updating in line with the windows method.  Sadly, I don't have the programming skills to write this myself.

Miq Viq

unread,
Oct 21, 2015, 6:26:57 AM10/21/15
to munk...@googlegroups.com
Programming always starts by defining the actual need.
And a specific, detailed definition of your need is a good start for solving your problem with code.
It does not have to be python...
For me bash is still the quick and dirty way to solve most of my scripting problems.
Bash is like Lego "Duplos" for me, so easy to understand (unless there are some really fancy bash methods used).
But if you go with a higher language with more tools (like Python) you need to really study that.
Note to self...

But as this wish has been written here something might happen...
And if you do not want to wait too long then better start solving the problem yourself.
For now the best way to make it happen seems to be a custom posflight script for munki.

-MiqViq

Gregory Neagle

unread,
Oct 21, 2015, 9:07:21 AM10/21/15
to munk...@googlegroups.com
So all they need to do is log out at the end of the day. Munki will install available updates within 2 hours of their logout.

-Greg

as...@siprep.org

unread,
Oct 21, 2015, 11:10:44 AM10/21/15
to munki-dev
Are these laptops or desktops? If they're laptops, do they still log out at the end of the day?

If they're desktops, I would just schedule Munki to run once at the beginning of the day (that's what I do for my iMacs) before anyone arrives at school.
Reply all
Reply to author
Forward
0 new messages