question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

echo unable to discover devices when daemon launched by rc.local

See original GitHub issue

I’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:closed
  • Created 7 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
bwssytemscommented, Aug 2, 2016

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.

0reactions
tylerstraubcommented, Aug 2, 2016

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:

[Unit]
Description=HA Bridge
Wants=network.target
After=network.target

[Service]
Type=simple
ExecStart=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/bin/java -jar -Dconfig.file=$

[Install]
WantedBy=multi-user.target

This was enabled by using:

sudo systemctl daemon-reload
sudo systemctl enable habridge.service

Cheers and many thanks @bwssytems

Read more comments on GitHub >

github_iconTop Results From Across the Web

Rc.local - Raspberry Pi Forums
Hi all, I am working on raspberry pi 3 model b arm version, running Debian (buster) I need to run a script on...
Read more >
What's wrong with my rc.local file (Ubuntu)? - Stack Overflow
What's wrong with my rc.local file (Ubuntu)? ... I have a python daemon process that gets started via rc.local. This same script, with...
Read more >
How to use /etc/rc.local at boot - Linux Hint
The rc.local script in some Linux distributions and Unix systems is a superuser startup script, usually located under the directory /etc/etc/rc.d.
Read more >
How to enable rc.local shell script on systemd on Linux at boot
How to see service configuration. Open the terminal app and then type: $ sudo systemctl cat rc-local.service. We see systemd configuration as ...
Read more >
How can I make /etc/rc.local run on startup? - Ask Ubuntu
It probably differs from the PATH you have logged in at the terminal. In the terminal, type: type -p xsetwacom then replace the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found