echo unable to discover devices when daemon launched by rc.local
See original GitHub issueI’ve been struggling with diagnosing this problem on my own for two days, so I thought I would run this question by the repo.
Currently running v3.0.0 from the JAR on a Raspberry Pi - I am unable to get any devices to be discovered by the Echo if the JAR is launched automatically though rc.local:
nohup java -jar /home/pi/echobridge/ha-bridge-3.0.0.jar 2>&1 &
Everything works as expected if I run the service on my default pi user manually like so:
java -jar /home/pi/echobridge/ha-bridge-3.0.0.jar
Following another question posted on the ha-bridge Issues related the rc.local file, I have tried some other things such as attempting to run the command as a different user (non-root) to no avail.
Does anyone out there have any recommendations or logging tips that would help me get closer to finding a root cause?
Thank you!
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (7 by maintainers)
Top GitHub Comments
Alright, now my memory has been jogged on this issue with the pi.
So, this has come up before as people were using the rc.local and calling a script and it would not work. This is due to the way network subsystem is brought up on the pi as it uses the new systemctl to start services. The old style runlevel setup, which rc.local is part of does not get the benefit if knowing the network is fully realized. Use the instructions in the readme file to do this using the unit files as it has the dependency check for network. Otherwise, put a sleep for 40 seconds or see (YMMV) in your rc.local before you call your shell script.
I just confirmed that abandoning rc.local and moving to registering a custom systemctl service in /etc/systemd/system worked!
Here was the final result of my habridge.service file:
This was enabled by using:
Cheers and many thanks @bwssytems