Skip to main content
Solved

Help with a post-install custom trigger


Forum|alt.badge.img+5

I’m trying to get a post-install script to run from a custom trigger. This seems like it should be fairly straight forward so I assume I’m overlooking something quite basic? And yes, I am a noob in terms of scripting so please go easy on me. Or not! I just can't figure out what I'm doing wrong...

Following a suggested imaging Workflow on Macmule I’ve created postflight.sh like this:

#!/bin/bash

jamf policy -event postflightconfig

Which has then been set to run at reboot as part of this imaging config:

With the policy itself set to trigger at a custom event defined as postflightconfig, like this:

Except nothing happens?

If I make postflight.sh executable I can run it manually and the policy is successfully triggered so I know the trigger and policy are OK. I just can’t get it to run at reboot after imaging?

JSS is 9.81

Thanks in advance...

Best answer by loftus

Solved with help from @CasperSally's post here

View original
Did this topic help you find an answer to your question?

davidacland
Forum|alt.badge.img+18
  • Valued Contributor
  • March 14, 2016

It all looks correct to me.

The problem sounds like the Casper imaging process isn't triggering the script.

I would take a look at the casper imaging log for a device you've tested it on, and/or look in the /var/log/jamf.log file on the client to see if there are any clues.


Forum|alt.badge.img+15
  • Contributor
  • March 14, 2016

I'm not sure the environment variables in your setup. You might want to use the full path to the JAMF binary

/usr/local/jamf/bin/jamf policy -event postflightconfig

bpavlov
Forum|alt.badge.img+18
  • Esteemed Contributor
  • March 14, 2016

Any difference between /usr/local/jamf/bin/jamf
and
/usr/local/bin/jamf
?


Forum|alt.badge.img+15
  • Contributor
  • March 14, 2016

/usr/local/bin/jamf is a symlink (alias) that points to /usr/local/jamf/bin/jamf. The former is likely safer in long term scripts. The latter is the real binary.


Forum|alt.badge.img+5
  • New Contributor
  • March 15, 2016

Log shows the policy being triggered but it's unable to connect to the JSS? Looking at the sequence the custom event runs before any of the JAMF items. Do I need to alter the sequence so that it runs after default JAMF management stuff has been applied? If so how do I do that exactly?

2016-3-15 10:37:58 Formatted Macintosh HD
Tue Mar 15 10:37:59 NetBoot018 jamf[881]: Installing create_ladmin_1.1.pkg...
Tue Mar 15 10:38:00 NetBoot018 jamf[881]: Successfully installed create_ladmin_1.1.pkg.
Tue Mar 15 10:38:02 NetBoot018 jamf[946]: Creating .AppleSetupDone...
Tue Mar 15 10:39:32 MBA jamf[201]: Checking for policies triggered by "postflightconfig"...
Tue Mar 15 10:39:34 MBA jamf[201]: Could not connect to the JSS. Looking for cached policies...
Tue Mar 15 10:39:49 MBA jamf[300]: Creating user casper...
Tue Mar 15 10:40:19 MBA jamf[300]: Enforcing management framework...
Tue Mar 15 10:40:25 MBA jamf[300]: Enforcing scheduled tasks...
Tue Mar 15 10:40:25 MBA jamf[300]: Adding launchd task com.jamfsoftware.task.1...
Tue Mar 15 10:40:26 MBA jamf[300]: Creating launch daemon...
Tue Mar 15 10:40:26 MBA jamf[300]: Downloading the agent...
Tue Mar 15 10:40:26 MBA jamf[300]: Creating launch agent...
Tue Mar 15 10:40:27 MBA jamf[746]: Informing the JSS about login for user _mbsetupuser
Tue Mar 15 10:40:29 MBA jamf[756]: Checking for policies triggered by "enrollmentComplete"...
Tue Mar 15 10:40:32 MBA jamf[756]: Upgrading JAMF notification service...
Tue Mar 15 10:40:33 MBA jamf[756]: Upgrading Self Service.app...
Tue Mar 15 10:40:33 MBA jamf[746]: Informing the JSS about login for user ladmin
Tue Mar 15 10:40:41 MBA jamf[952]: Checking for policies triggered by "startup"...

Thanks again..


Forum|alt.badge.img+5
  • New Contributor
  • March 15, 2016

Solved with help from @CasperSally's post here


Forum|alt.badge.img+17
  • Honored Contributor
  • March 15, 2016

@loftus glad it helped someone!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings