outset icon indicating copy to clipboard operation
outset copied to clipboard

Network not up

Open marmalodak opened this issue 3 years ago • 5 comments

Is there something wrong with my plist? What should I do to get outset to run?

# ls -l /usr/local/outset/share/com.chilcote.outset.plist 
-rw-r--r--  1 root  wheel  355 Apr 12 17:26 /usr/local/outset/share/com.chilcote.outset.plist
# plutil -p /usr/local/outset/share/com.chilcote.outset.plist 
{
  "ignored_users" => [
  ]
  "network_timeout" => 180
  "override_login_once" => {
  }
  "wait_for_network" => 1
}

My plist settings seem to be ignored. I get the same output from outset every time:

+ . /etc/rc.common
++ set -u
++ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/System/Library/CoreServices
++ export PATH
++ alias ConsoleMessage=echo
+ CheckForNetwork
+ local test
+ '[' -z '' ']'
++ ifconfig -a inet
++ sed -n -e /127.0.0.1/d -e /0.0.0.0/d -e /inet/p
++ wc -l
+ test='       0'
+ '[' '       0' -gt 0 ']'
+ NETWORKUP=-NO-
+ '[' -NO- '!=' -YES- ']'
+ echo 'network not up, exiting.'
+ exit

I don't know if this help, but:

# plutil -convert xml1 /usr/local/outset/share/com.chilcote.outset.plist
# cat /usr/local/outset/share/com.chilcote.outset.plist 
<?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>override_login_once</key>
        <dict/>
        <key>wait_for_network</key>
        <true/>
</dict>
</plist>
# ls -l /usr/local/outset/share/com.chilcote.outset.plist
-rw-r--r--  1 root  wheel  355 Apr 15 14:42 /usr/local/outset/share/com.chilcote.outset.plist

Big Sur 11.2.1

marmalodak avatar Apr 15 '21 21:04 marmalodak

If you don't want it to wait for network you can set the wait_for_network value to false. https://github.com/chilcote/outset/wiki/NetworkTimeout#removing-the-network-timeout-requirement

Also if you are on an ipv6 network that check may not be valid anymore 😕

chilcote avatar Apr 16 '21 06:04 chilcote

I'm sorry, I was obviously unclear.

I want outset to wait until the network is ready. The problem I'm having is that outset aborts because the network is not up yet.

marmalodak avatar Apr 16 '21 06:04 marmalodak

Ah I see. Sorry. The plist you are referencing is the default setting, I think. Is this a ipv6 only network? For whatever reason it doesn't think you're getting an IP.

You may want to turn this to false and then add your own logic for this as a boot-every script and name it such that it runs first alphanumerically (AAA_towing.sh or something) which does its own network wait that is more relevant to the network you're on.

chilcote avatar Apr 16 '21 12:04 chilcote

I reviewed that code (and its predecessor, the place we all crib notes when writing python in the macadmin world, munki) and I was surprised that the check doesn't ignore link-local when considering if the network is up (because if an interface that can't route/doesn't have DHCP I don't consider that 'up', in 2021 at least), but we should look at the timeout and confirm the sleep(10) behavior is still firing properly.

arubdesu avatar Apr 17 '21 16:04 arubdesu

I think I figured it out - this only kicks in (as documented on the wiki) for boot-once, not items in boot-every. I'm not sure why this was decided on in particular with the original design? We can get it changed, I agree it's unintuitive why you'd only want boot-timed actions to have network connectivity when you're running one-and-done actions.

arubdesu avatar May 03 '21 08:05 arubdesu

I'm going to close this since outset seems to be doing the right thing for my case and I haven't encountered any more problems like this.

marmalodak avatar Nov 17 '22 22:11 marmalodak