Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

NetworkTimeout

Allister Banks edited this page May 3, 2021 · 7 revisions

Network Timeout

By default, during boot-once runs, Outset will wait for an active network connection before continuing. If that directory is populated, it would check every ten seconds for a valid network connection, timing out after a total of 180 seconds (three minutes) and skipping those items if no connection is successfully detected.

An "active network connection" in this context is actually what may be referred to as a 'minimum requirement' for network connectivity, as it could just be a link-local/169.254-prefixed IP address, meaning we've gotten past the confirmation of 'physical' and 'layer 2' network stack connectivity and the interface thinks it is nominally successfully connected to a switching device. Any IP address that's NOT 127.0.0.1 or 0.0.0.0 on any interface (when 'shelling out' to ifconfig) is enough to consider the network 'up'. Like the Munki project, Outset does not have special handling for whatever VLAN or DHCP-assigned address or network condition you may consider useful for your scripts/installations, so please take that into account as you consider the content of the rest of this page.

It will also attempt to disable the loginwindow (if its launchd jobs/python process is able to load in time) while boot-once packages, profiles (on pre-Big Sur OS versions), and scripts are being processed. This is to discourage users from logging in and potentially interrupting any boot-once jobs that are designated to be processed.

Now, this is great for small boot-once items, like installing a config file or running a series of defaults commands. However, if you are installing a large software package (i.e. Adobe CCP installers), or running a script that will take a long time to finish, the default user experience may not be what you want, and your users may complain that their Macs are "taking a long time to boot" or they may get impatient and shut down the Mac. (The MacAdmin community would recommend other ways to provide feedback to end users e.g. during DEP bootstrap with a tool like DEPNotify or letting Munki show progress during installs.)

Additionally, you may be working in a restrictive or specialized (lab) environment where the Macs are not supposed to detect an active network connection through the boot process.

Changing the Network Timeout

You can change the length of the timeout (from 3 minutes of 10-second loops checking for the "network up?" state) by either delivering a file to the disk with the applicable preference keys, or write the applicable keys with utilities like PlistBuddy or defaults. To do the former, you can use the example plist with the values you wish to set, and package this plist to be installed in /usr/local/outset/share/.

If any of the "ignored_users" array, wait_for_network boolean True, or "override_login_once" dictionaries are populated, the plist will be updated with network_timeout reflecting the default 180 second integer value the first time Outset runs. It is not necessary to set the boolean value <true/> for the wait_for_network key if any of the others are present.

If you want to change these values on systems that are already deployed you can do so interactively (with sudo/root privileges) or via a boot-once or login-privileged-<frequency> script that runs defaults with the desired values. Due to the nature of defaults, you would want to also ensure the permissions of the plist is not set to rw------ by following up with a chmod.

For example, if you want to increase this value to five minutes, use:

/usr/bin/defaults write /usr/local/outset/share/com.chilcote.outset.plist network_timeout 300
/bin/chmod 644 /usr/local/outset/share/com.chilcote.outset.plist

If you want to decrease this value to 20 seconds, use:

/usr/bin/defaults write /usr/local/outset/share/com.chilcote.outset.plist network_timeout 20
/bin/chmod 644 /usr/local/outset/share/com.chilcote.outset.plist

This will result in a preference file that will look similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ignored_users</key>
    <array/>
    <key>network_timeout</key>
    <integer>20</integer>
    <key>wait_for_network</key>
    <true/>
</dict>
</plist>

Removing the Network Timeout Requirement

If you don't want Outset to wait for a valid network connection at all (and you don't want it to suppress the loginwindow process while running scripts) you can deliver a readable preference file with the wait_for_network value set to boolean false, or use the commands as follow:

/usr/bin/defaults write /usr/local/outset/share/com.chilcote.outset.plist wait_for_network -bool false
/bin/chmod 644 /usr/local/outset/share/com.chilcote.outset.plist

This will result in a preference file that will look similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ignored_users</key>
    <array/>
    <key>network_timeout</key>
    <integer>180</integer>
    <key>wait_for_network</key>
    <false/>
</dict>
</plist>