System NetworkExtension and daemons

Hi everybody, I have some questions regarding daemons and system network extensions. I’ve read here (https://developer.apple.com/forums/thread/721674): “System extensions are effectively launchd daemons”. So I have a question, can we launch system extension somehow directly via providing com.example.plist file into Library/LaunchDaemons and loading it? Or, for example, by loading it via SMAppService.daemon().

We need our network extension to run before user session.

If above is not possible, and we’ll have a separate daemon, which only purpose is to start network extension, how can we listen to the lifecycle of the network extension? For example (I’ve already made some experiments): we start daemon, it starts NE, we unregister daemon (via SMAppService), but NE still lives. Is it possible to get callback/signal in the daemon, that it was unregistered and shutdown gracefully?

So I have a question, can we launch system extension somehow directly … ?

No. A sysex must be installed using the System Extensions framework.

We need our network extension to run before user session.

If you package as a sysex, that’ll happen. This is one of the key benefits of sysex packaging when it comes to NE providers. With appex packaging, your provider is tied to the user’s session.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

System NetworkExtension and daemons
 
 
Q