Delay after copy/before reboot

hbatelaan
New Contributor II

Hi,
I've build a new Netboot image to deploy a new Casper image and I'm running into a couple of problems with both images. I'm rather new at Casper Suite software so please bear with me.

First the Netboot image. It doesn't seem to matter if I build the image with System Image Utility and/or the Netboot Automator Action. Problems stay the same.

Problem 1. I Netboot with my new image and rollout one of my default configurations. This one is called 'General 10.7'. It installs my 10.7 image and copies Adobe and Office 2011 software. After the Office 2011 copy, the machine needs to be restarted. However, it sticks for a while on the 'Copying Installer...' window (from Office 2011). It has finished it as far as I can tell and the progress bar is at 100%, but then the reboot command already kicks in. After about a minute I get the default Finder error that a logout/reboot wasn't possible due to Casper Imaging still being active. After again a couple of seconds it reboots anyway.

So the question: can I build in a delay anywhere (and how?) to prevent this error from happening?

Additional question: can you prevent in any way that the Netboot image is being indexed (pulsating Spotlight icon), which consumes recources as well I can imagine?

7 REPLIES 7

nextyoyoma
Contributor

You can completely turn off spotlight indexing until the next reboot with the following command:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

If you want to disable it permanently, you can also remove the file indicated there (or rename it to be safe.) If your net boot image is read-only, then you will either have to convert it to read-write and back or make a new image with the file removed. Either way, you cannot make the change while booted to the image, since it will revert back when you reboot.

talkingmoose
Moderator
Moderator
So the question: can I build in a delay anywhere (and how?) to prevent this error from happening?

I see this occur too and my thoughts have been that this is something for JAMF to fix. In my environment it's only distracting because the machines reboot anyway.

Casper Imaging itself reboots the machine if you tell it to do so and you probably are doing so. Check packages such as your base OS package and verify if some of those are also calling a reboot. You might have better luck if only the Casper Imaging application itself issues the reboot command.

Additional question: can you prevent in any way that the Netboot image is being indexed (pulsating Spotlight icon), which consumes recources as well I can imagine?

This page may help you with disabling your Spotlight indexing. I haven't tried it myself.

http://osxdaily.com/2011/12/10/disable-or-enable-spotlight-in-mac-os-x-lion/

acdesigntech
Contributor II

I second only having Casper signal a reboot. You may be getting conflicting processes, especially if you have an 'after' script telling the machine to reboot and also have Imaging repair permissions or something, since the repair happens after 'after' scripts have run. Generally this should lead to Imaging not finishing though and just rebooting, but it depends on how the command is written I think. For instance, a shutdown -r now does not wait for anything, but i think reboot tries to gracefully restart.

Also, having policies that reboot the Mac at the end will never show a completed status if they run a script that also specifies a reboot, since the reboot command in the script will execute before the policy ever completes.

hbatelaan
New Contributor II

Hi guys.
Only Casper signals for a reboot, not any of the packages or scripts.

I thought to have solved it by disabling Spotlight (thanks for the tips) but it still happens when testing. It happens less it seems, but it still happens.

Any info on building in an extra delay maybe?

acdesigntech
Contributor II

You can build in an artificial timer by creating a script to run 'after' and just having it "sleep 60" or whatever, 60 being the number of seconds to pause. Name the script something like zzdelay, to make sure it runs last.

However, you shouldn't *need* to do this. Can you post the list and order of scripts/packages that you install with Casper imaging?

hbatelaan
New Contributor II

Attached the screenshot. The Netinstall script had been left out already for a test. Didn't make any difference.
external image link
Thanks again.

hbatelaan
New Contributor II

In the last couple of days I did a lot of testing with the different configurations, system install, Netboot, scripts, packages, etc. It solved a lot of the problems I had with the Netboot/Install workflow. What still remains though is the problem as described in the OP:

It has finished it (the image rollout and software copying) as far as I can tell and the progress bar is at 100%, but then the reboot command already kicks in. After about a minute I get the default Finder error that a logout/reboot wasn't possible due to Casper Imaging still being active. After again a couple of seconds it reboots anyway.

How to avoid this Finder error?