rebootd - A simple reboot daemon for Linux
rebootd is a simple reboot daemon for Linux. It is meant to be run as a systemd service and will reboot the system if the network is unreachable for too many consecutive checks (failed to GET a comma-separated list of URLs — default: https://www.google.com,https://www.cloudflare.com,https://www.amazon.com).
Recovery ladder
On each consecutive failed check, rebootd escalates its repair attempts before resorting to a reboot:
| Attempt |
Action |
| 1 |
Restart systemd-resolved + NetworkManager and wait for them to settle |
| 2 |
nmcli connection up on all ethernet profiles (active or not) |
| 3 |
Delete all ethernet profiles, recreate with fresh DHCP config (rebootd-<device>), and bring them up |
| ≥5 |
Reboot the system |
Attempt 3 uses nmcli connection add with connection.autoconnect yes, connection.autoconnect-priority 100, and connection.autoconnect-retries 0 to ensure the new profile reconnects reliably after a reboot.
It checks connectivity every 15 minutes; after a failure it retries every 5 minutes.
Use case
Remote servers that are not reachable and need to be rebooted. This is a simple solution to reboot the server if it's not reachable.
Installation
- Clone the repository
- Run
make install to install the service
- Enjoy
Options
✗ ./rebootd --help
Usage:
rebootd [OPTIONS]
Application Options:
--dbg show debug info [$DEBUG]
-v Show version and exit
-a= Number of failed attempts allowed before reboot (default: 5)
--address= Address list to check - comma separated (default: https://www.google.com,https://www.cloudflare.com,https://www.amazon.com)
-i, --interval= Interval between checks (default: 15m) [$INTERVAL]
-r, --retry-interval= Interval between checks after failed attempt (default: 5m) [$RETRY_INTERVAL]
Help Options:
-h, --help Show this help message
Logs
The service writes logs to /var/log/rebootd.log (as configured in rebootd.service):
tail -f /var/log/rebootd.log
Logs are also available via journald:
journalctl -u rebootd -f
Uninstall
Run make uninstall to remove the service.