Closed johngo7470 closed 5 years ago
Yes, likely trying to start before your network is ready.
The specifics of your startup file will depend a lot on your specific machine and configuration, and there are lots of ways to skin this cat.
I recommend reading through https://www.freedesktop.org/software/systemd/man/systemd.service.html and paying special attention to settings like
Wants=network-online.service After=network-online.service
Or there is another service that is something like network-wait-online.service; it may work better but requires a separate service to be enabled, and that service has been failing lately on my arch Linux box, so I can't say whether or not it's a more or less robust way to go than the other options.
These should help systemd wait until the network is up to start fauxmo.
Alternatively, there is a setting that is something like BootSec= that will just wait a configurable amount of time after booting, which works fairly well.
Finally, there are settings like Restart and RestartSec that will automatically try to restart the service if it fails (possibly after waiting a configurable amount of time).
Lots of options here. I'm mobile and this is from memory; let me know if this helps you sort through things.
Good to know details on systemd... I ended up adding Restart=on-failure, and it works - thank you!
fauxmo --version
): 0.4.9My Issue
When I try to start fauxmo from a systemd service file, I see the following information in the log file:
Is this because my network interface isn't quite ready yet?
I can still start it manually with: nohup /opt/pyenv/versions/3.7.3/bin/fauxmo -c /home/pi/fauxmo_config.json &, but I would prefer to just have it start automatically.
I removed Restart=on-failure from my service startup, because early on, I had a typo in my config.json, and it seemed to be putting my RPi in a state where I couldn't telnet into it (ended up breaking out the monitor/mouse/keybd), presumably because it was rolling restarts my fauxmo service.
Is there a reason Restart=on-failure was added to the .service startup file? Should I re-add it, now that my config.json appears to be configured properly?
WHYT
Please make sure you've taken these steps before submitting a new issue:
-vvv
) and include relevant outputconfig.json