slackhq/nebula

[macOS] service doesn't connect to lighthouse on boot with dns name in lighthouse static_host_map

Closed this issue · 5 comments

On Catalina, I get the following plist created (/Library/LaunchDaemons/Nebula.plist) when invoking sudo nebula -service install -config /etc/nebula/config.yml:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd" >
<plist version='1.0'>
<dict>
<key>Label</key><string>Nebula</string>
<key>ProgramArguments</key>
<array>
        <string>/usr/local/bin/nebula</string>

        <string>-service</string>

        <string>run</string>

        <string>-config</string>

        <string>/etc/nebula/config.yml</string>

</array>



<key>SessionCreate</key><false/>
<key>KeepAlive</key><true/>
<key>RunAtLoad</key><false/>
<key>Disabled</key><false/>
</dict>
</plist>

However when it starts on boot up it seems to ignore the config or it just doesn't start on boot properly. If, however I do sudo nebula -service stop; sudo nebula -service start; it starts properly and I can connect to lighthouse/nodes.

Am I doing something wrong? How can I achieve the automatic start of nebula on boot?

PS. Permissions:

$ ls -la /etc/nebula
total 32
drwxr-xr-x    6 root  wheel   192 10 Mar 16:55 .
drwxr-xr-x  127 root  wheel  4064 10 Mar 18:23 ..
-rw-rw-rw-    1 root  wheel   259 10 Mar 16:55 ca.crt
-rw-rw-rw-@   1 root  wheel  1535 10 Mar 16:55 config.yml
-rw-rw-rw-    1 root  wheel   341 10 Mar 16:55 my.crt
-rw-rw-rw-    1 root  wheel   127 10 Mar 16:55 my.key

PPS. Could it be that it launches too early, while there's no network connectivity and then gets stuck in unconnected state?

PPPS. It doesn't connect with dns name in your lighthouse static_host_map, it does connect if the IP address is used in static_host_map.

I have it running this way on my mac, but agree it may be related to connectivity. Do you happen to have a dns name in your lighthouse static_host_map configuration?

I have it running this way on my mac, but agree it may be related to connectivity. Do you happen to have a dns name in your lighthouse static_host_map configuration?

Yes, I do. Do you mean it automatically reconnects to lighthouse on reboot if I use an IP address instead of a dns name?

I haven't tested what the failure looks like when using DNS, but I'm using IP and don't have the same issue, so it is worth trying.

Confirmed working with the IP address. I'll change the description/title.

duplicate of #176