Skip to main content

Hi guys,

I'm trying to recreate the behaviour of Munki/Windows Updater using Casper & jamfHelper.

The jamfHelper commad has a delay option.

Is there anyway to write the delay to a file, then after the delay passes manually trigger a policy?

Regards,

Ben.

manual trigger policy, scripted with the sleep command is my first thought.

#!/bin/bash

#delay the trigger for 60 seconds

sleep 60

jamf policy -trigger mycustomtrigger

exit 0

-Tom


Thanks.

This will be also need to delay for hours possibly.

Is the below ok to run for that time?

Regards,

Ben.


I'm not sure how sleeping a machine would effect it. I wonder if you could instead insert a launchd job that gets removed when it's all done?

j
---
Jared F. Nichols
Desktop Engineer, Client Services
Information Services Department
MIT Lincoln Laboratory
244 Wood Street
Lexington, Massachusetts 02420
781.981.5436


Jared, I think the sleep command in a bash script delays the execution of the command until AFTER the time passed to the sleep command has expired.

Regards,

Ben.


Correct, but the sleep command in Apple Script literally puts the machine to sleep. Let's just say I learned that the hard way. :-) haha

My next question is, is this policy dynamically triggered? Meaning will it be triggered at random times, because I think a scheduled task may be able to fit your needs.

-T


using /bin/sleep here is fragile and leaves the process hanging around for the designated time. there's no facility for resurrecting it if it dies. if you're running this on a laptop and close the lid, or shutdown, then what?

i've looked at ways to use casper's tools to behave like munki and usually just use munki unless the client can't.

for your purposes, jared's launchd suggestion is the way. munki uses a similar mechanism.


Can you clarify exactly what you are trying to accomplish, or exactly what
On Thu, Sep 15, 2011 at 8:24 AM, Ben Toms <bentoms at btopenworld.com> wrote:
behavior you are trying to mimic? Since you mention Windows Updater, I am
assuming you want to allow the user to delay updates. Yes?

Perhaps knowing what your end goal is, we might be able to give you some
other ideas. Although I think a launchd item is going to be your best bet.

Steve Wood
Director of IT
swood at integer.com

The Integer Group | 1999 Bryan St. | Ste. 1700 | Dallas, TX 75201
T 214.758.6813 | F 214.758.6901 | C 940.312.2475


pmset -a lidwake 0 hahahaahaha so when the lid is shut laptop is still on!

Just kidding. Scheduled tasks with launchd would be the way to go.


Hi Steve,

Yes! that's what we're looking at.

I'll be caching application & OS updates to the macs, then via a smart group a policy will run once per day running the below:

/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper -windowType utility  -title "Updates Pending" -description "Software Updates are available for your computer. When you next logout, shutdown or restart these updates will be installed. Your mac may restart if required to by the installed updates" -icon /System/Library/CoreServices/Software Update.app/Contents/Resources/Software Update.icns -button1 "OK" -button2 "Restart" -showDelayOptions "900, 1800, 3600, 14400"

Once run, the script will either:

-logout the user, display a full screen message whilst installing all cached updates, repairing perimissions, cache clear etc. then restart

-delay the execution by the time specified.

So i launchd eh?


Hey all,

Just an idea…

You could…

- Have a policy that runs a script that…
-- Pops up a dialog box with two options: "run now" and "postpone".
-- If the user clicks "run now", the script calls the custom trigger attached to the update policy.
-- If the user clicks "postpone", the script increments a number stored in a local file.

At the beginning of the script you can check the local file, and if it has reached your increment threshold, you might display a different dialog stating something to the effect of "the updates have been put off for too long and are now mandatory, and you may be prompted to reboot your computer after all updates have been installed," and then issue the custom trigger regardless of user input.

I hope this is helpful.

--

Miles Leacy

Technical Training Manager

Mobile +1 347 277 7321

miles at jamfsoftware.com<mailto:miles at jamfsoftware.com>

....................................................................

JAMF Software

1011 Washington Ave. S

Suite 350

Minneapolis, MN 55415

....................................................................

Office: (612) 605-6625

Facsimile: (612) 332-9054

....................................................................

US Support: (612) 216-1296

UK Support +44.(0)20.3002.3907

AU Support +61.(0)2.8014.7469

....................................................................

http://www.jamfsoftware.com<http://www.jamfsoftware.com/>


With out knowing the end game on this, it sounds like caching could
also be an option. For example I have packages that need to go out, and
require reboot but aren't mission critical enough to force a reboot or
force the user to run them. So I have an ongoing policy set to all
machines that installs all cached policies, then I set these packages to
cache, because like previously mentioned laptop users shut their lids. Then every time the user reboots any completely cached package gets
installed.

-Tom


my previous e-mail should clarify..

but like many others, our users are often at a loathe to restart.. & as this is is accepted standard for those pc users here.. i wanted to bring in the same for my macs