My Synology NAS manages to stay online for months / years at a time, occasionally rebooting itself for updates. However my Raspberry Pi (responsible for backing up my NAS to the cloud) seems to go offline every few weeks. I have to manually unplug it and plug it back in.
@pcrock The obvious thing would be to check for evidence.
The "last" command might give clues to forced shutdowns/reboots.
Examining logs, or the journal on systemd-based systems, might give clues to errant processes.
Casual observation of memory consumption with "top" on a regular basis will give clues to memory exhaustion. Excessive swap usage would show here too.
Looking for process failures with "ps" on a regular basis too might give more clues.
Check temperature too. Is it overheating?
@pcrock take a look at the journal and dmesg around when it stops working (journalctl for the systemd journal)
journalctl during boot says my file system has a dirty bit set. That sounds like a power issue, so I'll try a new power supply. A small UPS also sounds like a good idea regardless what I do.
@pcrock the main trouble I had with mine was a cheap power supply. Once I change that it was OK.
@pcrock Do you have the serial console enabled? When you power cycle it, since it sounds like it's just another linux box, what do the logs say happened?
@pcrock (Besides the actually useful tips: as a last resort or temporary workaround, you could try scheduling, using cron, a reboot once a week or so, rather than wait for it to hang.)
@pcrock That seems curious, I've had my rpi up for months now, the only reason it was off was because I wanted to move the outlet it was plugged in to. I've never had to restart it before. Look in its logs.
@pcrock It's possible something's shutdown -h ing it, or /tmp/ is filling up, or something like that. If all else fails, think of what restarting usually does, chop that into halves, and binary search until you've figured out which symptom is causing the outages.
Fosstodon is a Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.