How to handle System Extension willCompleteAfterReboot

Hi, I want some advice on how to handle the OSSystemExtensionRequest.Result.willCompleteAfterReboot on my app.

I have noticed that on some users macs when they update and the new System Extension is loaded the old one is deactivated and the new one is activated but does not start. I will only start after a reboot.

Is there a way to avoid this so I don't have to force dozens of users in my organization to reboot after every update to my system extension?

When i execute the command to list the extensions this is what I see. The new one is activated but it does not boot.

--- com.apple.system_extension.network_extension
enabled	active	teamID	bundleID (version)	name	[state]
		1231231231	com.organization.app.MyApp (2.0/1)	MyApp	[terminated waiting to uninstall on reboot]
*	*	1231231231	com.organization.app.MyApp (2.1/1)	MyApp	[activated enabled]

Would manually deactivating my System Extension before installing the new version help? I was thinking about doing that in the preinstall script of my pkg installer by executing the container app with a uninstall parameter like this: /Applications/app/Contents/MacOS/app --unload-extension

Is there a way to avoid this so I don't have to force dozens of users in my organization to reboot after every update to my system extension?

If you install an update to your System Extension and use the replace action, does this still happen?

 @brief Called when the target extension bundle identifier is already activated.
 
 @discussion The delegate will receive this callback when an activation request
 encounters an existing extension with the same team and bundle identifiers but
 with different version identifiers. The delegate must make a decision on
 whether or not to replace the existing extension.

Also, referencing this thread, my suggestion is based on the fact that you are running a Container application with a GUI that controls your System Extension and is installed in the /Applications directory. If you are doing this as a command line tool then this is not recommended and you are on your own.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

Another question I had about the willCompleteAfterReboot is why is this called? I want to better understand this problem I am having about extensions needing a reboot to complete an upgrade. What is preventing the system from starting my extension without the need of a reboot?

I am using a Network Extension, if I were to add Endpoint Security to my extension would something in the activation process change? I can't see antivirus software that uses this framework requiring a reboot for every update to their extension.

How to handle System Extension willCompleteAfterReboot
 
 
Q