Posted on 07-17-2014 06:13 AM
I have a policy that simply runs a Execute Command of "softwareupdate --install --all". This command works fine locally and applies any pending software updates. However when I run it from JAMF i get this:
Executing Policy Run Software Updates...
Running command softwareupdate --install --all...
Result of command: Software Update Tool Copyright 2002-2012 Apple Inc. Finding available software
...and then nothing. It's like it ends the process right then and doesn't let it continue. Has anyone else experienced this?
Solved! Go to Solution.
Posted on 07-17-2014 06:53 AM
I just created a policy and ran that same sw update command via 'Execute Command' and it worked just fine. Below is the output in the JSS log file for that machine.
Executing Policy ignoreMe... [STEP 1 of 1] Running command softwareupdate --install --all... Result of command: Software Update Tool Copyright 2002-2012 Apple Inc. Finding available software Downloaded OS X Update Downloaded iTunes Installing OS X Update, iTunes Done with OS X Update Done with iTunes Done. You have installed one or more updates that requires that you restart your computer. Please restart immediately.
Posted on 07-17-2014 06:57 AM
I've had issues before when executing a command that took a while to do via that option. Try adding in a wait timer after your command so that JSS will hang tight. I.E.
I'm pretty sure this is the correct syntax: softwareupdate --install --all; sleep 10
This way it will sleep for 10 seconds following your command so it gives it time to work. Just a thought, see if that helps.
Posted on 07-17-2014 06:19 AM
No, but I have a possible solution for you.
This one will only install updates that do not require updates.
#!/bin/bash
############### Variables ################################################################
updatelist=/tmp/SWULIST
newlist=/tmp/newlist
############## Check for software Update #################################################
function updatecheck () {
/usr/sbin/softwareupdate -l > $updatelist
############## Reads file created by update list, then flushes out files that require update.
cat /tmp/SWULIST | sed -n '/restart/{x;d;};1h;1!{x;p;};${x;p;}' | awk -F"*" '{print $2}' | sed '/^$/d' > $newlist
############## Installs each update that doesn't require restart
while read p; do
/usr/sbin/softwareupdate -i $p
# osascript -e "tell application "Finder""
# osascript -e "display dialog "Installing: $p""
done < $newlist
}
############## Functions
updatecheck
Posted on 07-17-2014 06:34 AM
Where are you running that command? files & processes -> Execute command? Or via shell script? Any chance there is a & character in there somewhere?
Posted on 07-17-2014 06:43 AM
@thoule I'm running it under Policies > File and Processes > Execute Command just as you were thinking. There aren't any special characters in the command. just "softwareupdate --install --all". Here is the outcome of the command if i run it directly from terminal:
Software Update Tool
Copyright 2002-2012 Apple Inc.
Finding available software
Software Update found the following new or updated software:
*iBooksDelta-1.0.1
iBooks Update (1.0.1), 14334K [recommended]
*iTunes (11.3), 232183K [recommended]
@GaToRAiD, I know there are several scripts in the forums for handling software updates, but at this time I'm just trying to use the built in command to apply everything without creating something more advanced. I'll try your script as it looks pretty straight forward if there are no other solutions, but I'd like to figure out why this isn't working first.
Posted on 07-17-2014 06:49 AM
@Jason Have you just tried running it via the terminal first, to see if it might be something related to JSS?
Posted on 07-17-2014 06:51 AM
@GaToRAiD, yep, the output from my previous post shows the first part of that. I've let it run all the way through before and it works without issue from Terminal. I didn't let it go all the way through this time just because I want some pending updates left on my test system to see if a fix works properly.
Posted on 07-17-2014 06:53 AM
I just created a policy and ran that same sw update command via 'Execute Command' and it worked just fine. Below is the output in the JSS log file for that machine.
Executing Policy ignoreMe... [STEP 1 of 1] Running command softwareupdate --install --all... Result of command: Software Update Tool Copyright 2002-2012 Apple Inc. Finding available software Downloaded OS X Update Downloaded iTunes Installing OS X Update, iTunes Done with OS X Update Done with iTunes Done. You have installed one or more updates that requires that you restart your computer. Please restart immediately.
Posted on 07-17-2014 06:57 AM
I've had issues before when executing a command that took a while to do via that option. Try adding in a wait timer after your command so that JSS will hang tight. I.E.
I'm pretty sure this is the correct syntax: softwareupdate --install --all; sleep 10
This way it will sleep for 10 seconds following your command so it gives it time to work. Just a thought, see if that helps.
Posted on 07-17-2014 07:06 AM
check that root does not have a local com.apple.Softwareupdate.plist in preferences that is pointing to a server that does not exist.
Do you need a proxy to get out on the internet?
Why don't you just use the software updates item in the policies configuration tool and just install all available updates there?
Posted on 07-17-2014 07:30 AM
are you setting the SUS via the built-in Casper method of defining a SUS in the JSS and assigning clients to it in the Network Segments pane?
Posted on 07-17-2014 07:32 AM
@nessts, There is a plist at /Library/Preferences/com.apple.SoftwareUpdate.plist, but it doesn't point to any specific server (unsure if that's the file you were referring to). The PLISTs under "/Library/Preferences/Managed Preferences" and "/Library/Preferences/Managed Preferences/<USERID>" both do have a CatalogURL pointing to the internal server. We do need a proxy, but that shouldn't (i don't think) matter since we have an internal SUS. The Software Updates policy just tells the system which location to install software updates from doesn't it? i.e. it doesn't actually run them?
@GaToRAiD, I took it one step further and added a 30 second sleep just to be sure, now all i get is this:
Executing Policy Run Software Updates...
Running command softwareupdate --install --all; sleep 30...
Result of command:
Posted on 07-17-2014 07:39 AM
Found my mistake. My test system was recently reimaged and wasn't in a right group. so "softwareupdate --install --all" works all along. just wasn't talking to the right SUS. Thanks everyone