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.

For you admins and experts out there: Where would be a good place to start troubleshooting this?

@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)

@Matter @pcrock you'll probably have to enable log persistence as well, otherwise logs are wiped on reboot. No persistence default is very common on SBCs so they don't write wear SD cards.

@adasauce @Matter @neildarlow @_mark @trini @janboddez @cavaliertusky @wizzwizz4 @rudolf Thanks for all your input. I learned a bit more about Linux today.

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 (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.

Sign in to participate in the conversation

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.