Script erroring due to username?

bentoms
Release Candidate Programs Tester

Hi guys,

I've a weird issue that I hope one of you scripting guru's can sort..

We run 2 scripts across all Macs.. 1 sets screen saver for all users triggered by every15 the other submits data from the users dscl to the JSS.

Across 270 ish macs this runs fine.. but on one mac it errors.. the guys user name is faileu00 error message below.. I can submit scripts if needed. But not sure in the username could be causing an error in bash?

An error occurred executing the policy "WEU: Set Screen Saver" on the computer "MAC5249".

Event log from the policy:

/usr/sbin/jamf is version 8.0

Executing Policy WEU: Set Screen Saver...

Mounting afp://OSX-LON-G2-02/CasperShare-GCGUK to /Volumes/CasperShare-GCGUK...

Running Script 010 Set Screen Saver.sh...

Script Exit Code:0

Script Result: Set Screen Saver for user: faileu00. With home folder located: /Users/faileu00.

Fixing ByHost files...

Unmounting file server...

Ben Toms
IT Support Analyst GREY Group
The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
T: +44 (0) 20-3037-3819 |
Main: +44 (0) 20 3037 3000 | IT Helpdesk: +44 (0) 20 3037 3883

4 REPLIES 4

henkelb
New Contributor III

Could it be something as simple as the script is working properly but Casper is seeing the word "fail" so it thinks it failed even if it didn't.

Bill Henkel
Computer Technician
Telephone Support Specialist
henkelb at westerntc.edu<mailto:henkelb at westerntc.edu>
608-789-6254
fax: 608-785-9287

bentoms
Release Candidate Programs Tester

Good point.. I've a webex set with jamf support tonight so will ask.. unless someone in the mean time can shed any more light on this issue

Regards,
Ben Toms
IT Support Analyst GREY Group
The Johnson Building, 77 Hatton Garden, London, EC1N 8JS
T: +44 (0) 20-3037-3819 |
Main: +44 (0) 20 3037 3000 | IT Helpdesk: +44 (0) 20 3037 3883

tlarkin
Honored Contributor

That is a good question. Does the Casper framework simply look for the
word "fail" when it runs a script from any of the output, well let me
test this. So I wrote a script that just echos the words Fail, fail,
Failure, and failure and sure enough this is what I get when running the
script:

admins-imac:~ tlarkin$ sudo jamf policy -trigger test Checking for policies triggered by "test"... Gathering Policy Information from
https://xs001-casper.kckps.org:8443//... Executing Policy Untitled Policy... Mounting afp://xs106-casper.kckps.org/CasperShare to
/Volumes/CasperShare 1... Running Script fail.sh... Script Exit Code:0 Script Result: FAIL fail Failure failure

Unmounting file server... Submitting log to https://xs001-casper.kckps.org:8443//... admins-imac:~ tlarkin$

and now in the JSS logs...

/usr/sbin/jamf is version 8.0

Executing Policy Untitled Policy...

Mounting afp://xs106-casper.kckps.org/CasperShare to
/Volumes/CasperShare 1...

Running Script fail.sh...

Script Exit Code:0

Script Result: FAIL
fail
Failure
failure

Unmounting file server...

Now you can see it says script result looks like it ran, but it flags
my machine in red like it failed in the JSS logs. This is something
you may want to address to the developers, that maybe it should check
exit status instead of the word fail? However, the script actually ran
fine

-Tom

bentoms
Release Candidate Programs Tester

Thanks all.

I changed the echo statement to only say: "screen saver set for network user..." & voila!

Will log as a bug.

Thanks!

Regards,

Ben Toms