Posted on 11-27-2015 10:01 AM
So I've been noticing an odd thing in the last couple months. When we push software updates either via casper or through command line, it doesn't always work the first time. Looking the logs it shows it's downloading the components, but doesn't always install them. This seems consistent on most machines. Usually takes about 2-3 times running it for the updates the updates for it to download and install the updates. Was just wondering if this is something only occuring on our network.
I did write a script to resolve the issue...but still very odd.
#!/bin/bash
####################################################################################################
#
# DESCRIPTION
# Keep running software update until no more updates are available
#
# AUTHOR
# Roie Gat
####################################################################################################
echo "Testing for software Updates"
##Checks to see if there are any updates avilable. If there are less then five worlds returned then there is
##and update avialble
if [ `softwareupdate -l | wc -l` -le 5 ]
then
##No updates found
echo "No Updates"
else
##There are updates available
echo "Updates Available"
while [ `softwareupdate -l | wc -l` -gt 4 ]
#While there are updates available....keep running softwareupdate
do
echo "Running SoftwareUpdate"
sudo softwareupdate -ia
done
fi
exit 0
Posted on 11-29-2015 09:46 PM
An interesting script and situation. I've noticed some of our machines won't install updates from either SelfService, local terminal or ARD command. I'm going to take a look this week in hopes for a solution.
On another note I think you can take the "sudo" out of line 26 since the script is ran, assuming, by Casper and it runs everything as root (as does Self Service).
Posted on 11-30-2015 05:38 AM
@Snickasaurus I usually test my scripts locally on a test machine first, so the sudo was needed. Guess since it's in Casper now I can take it out.
It's really that some machines can pull software updates and install them on the first shot, and other need 2-3 times to work right.
At least I have a work around now to ensure they get all of them.
Posted on 11-30-2015 06:36 AM
@roiegat Are the machines pointed to an internal server? If so how are clients pointed to the SUS?
Posted on 11-30-2015 06:38 AM
@Snickasaurus They are currently pointing to a SUS on a NetSuS. But even before when they were pointing directly to Apple, I would notice in the log files that it would download the package, but not actually install them. So if Info Sec required some security patch be installed I would have to run it multiple times to ensure it got it installed.
Posted on 11-30-2015 06:43 AM
Hmm, that's no good at all. What is your NetSUS running on? Physical server, virtual appliance (which OS for the appliance?).
I have a CentOS and Ubuntu SUS at work and the same setup at home. At work I have issues with machines running updates on the Ubuntu appliance where some clients have to have the update command ran more than once.
Posted on 11-30-2015 07:50 AM
Currently they are running on a virtual appliance with NetSUS ova. Before we had a OS X server on Xserves that had the same issue. Before that we used Apple servers.