So I followed this youtube video on setting up RTL-433 service on a Ubuntu server. Problem is, it seems to keep failing after a while. Sometimes doing a systemctl start service doesn’t work and I will have to reboot the system and then it will work. It will work for a while and later in the day it will suddenly stop. Sometimes I can do a systemctl start, but sometimes not.

Anyone know how I can have this service constantly up and running, and restart if it fails?

  • z2k_@beehaw.org
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 year ago

    To have it automatically restart on failure, you can add the following to your systemd unit:

    [Service]
    Restart=on-failure
    RestartSec=5s
    

    See this blog post for more information.

    But to find the root cause of why it’s failing, you can run systemctl status <service> when it fails to get the most recent logs and hopefully an error as to why it failed.

    • falchy@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      1 year ago

      Still relatively beginner, but wouldn’t ‘journalctl -u <service name>.service’ also give you in depth logs over a longer period of time?