this post was submitted on 13 Feb 2024
62 points (98.4% liked)

Selfhosted

40219 readers
1294 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

I've got a QNAP NAS and two Linux servers. Whenever the power goes down, the UPS kicks in and shut downs the NAS and the Linux servers, all good. The servers + NAS are automatically started when the power comes back on line using WOL. All good.

The problem is that I have apps running using Docker which heavily rely on connections to the NAS. As the Linux servers boot quicker than the NAS, the mount points are not mounted, and thus everything falls apart. Even when I manually re-mount, it's not propagated to the Docker instances. All mount points use NFS.

Currently, I just reboot the Linux servers manually, and then all works well.

Probably easiest would be to run a cron job to check the mounts every x minutes, and if they are not mounted, then just reboot. The only issue is that this may cause an infinite loop of reboots if e.g. the NAS has been turned off.

I could also install a monitoring solution, but I've seen so many options that I'm not sure which one to do. If it's easier with a monitoring solution, I'd like the simplest one.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 29 points 9 months ago (11 children)

Just specaluting.. is it possible to mount NFS through systemd and make docker service dependent from that mount?

[–] [email protected] 3 points 9 months ago (2 children)

Sorry, I'm absolutely not a Linux expert :) I use /etc/fstab for the mounts, and to manually re-mount I run "mount -a".

[–] [email protected] 8 points 9 months ago* (last edited 9 months ago) (1 children)

This is a great opportunity to learn a bit of systemd then. Look at my other comment. I've had a nearly identical problem which prompted me to learn in order to solve it years ago.

Especially if you find a corner case autofs doesn't cover. ☺️

[–] [email protected] 3 points 9 months ago

Awesome, yes, definitely will do. After years of using Linux, the whole systemd thing is still a bit of a black box to me. I know how to create /start/stop services etc but that's about it. Thanks for the prompt replies!

load more comments (8 replies)