Skip to main content
Question

Policy Errors when running scripts


Forum|alt.badge.img+8

I think this will be something simple.

I frequently have policies that run scripts and It seems that I get a lot of policy errors even though the script exit code is 0. It seems that the jss does not expect any output from the script in the "Script Result", and if it gets it, it will report an error. I would want it to report an error if the script exits with a code other than 0.

Anyone care to explain what I'm doing wrong and what I should do?

Here's a partial example of a JSS policy error e-mail I get.

An error occurred executing the policy "Run Script netrenderzombie_c4dr13.sh" on the computer "2939-mp".

Event log from the policy:

    /usr/sbin/jamf is version 8.51
    Executing Policy Run Script netrenderzombie_c4dr13.sh...
    Mounting afp://jss.company.com/CasperShare to /Volumes/CasperShare...
    Running Script netrender_c4dr13.sh...
    Script Exit Code:0
    Script Result: Creating user netrender...
Sat Aug 18 19:43:59 2939-mp.company.com osascript[4866] <Warning>: 3891612: (connectAndCheck) Untrusted apps are not allowed to connect to or launch Window Server before login.
Sat Aug 18 19:43:59 2939-mp.company.com osascript[4866] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.

2 replies

Forum|alt.badge.img+12
  • Contributor
  • 417 replies
  • August 20, 2012

Applescript scripts will fail if there is not a a console user logged in. It has nothing to do with output from the script.


Forum|alt.badge.img+8
  • Author
  • Contributor
  • 38 replies
  • August 21, 2012

These are all shell scripts. Even something like curl'ing and unzipping a folder causes an error. I'm thinking I could just redirect all output to /dev/null, but I'd really like to know why a script run through jamf shows as an error even when it exits with a status of 0.


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