[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Service start contingencies?



On Fri, Oct 23, 2015 at 11:10:13AM -0400, John L. Cunningham wrote:

Hi All,

I have one debian box (Box A) that's connected to a bunch of video cameras. I have another debian box (Box B) with a RAID that is exported via NBD and mounted on Box A to save camera output. Box A is a lot newer and faster than Box B, so after a power event it is the first to boot. Since Box A can't find the NBD export, it starts to save to the local drive. I then have to manually power both servers down and start them in sequence for my setup to work correctly. Box A uses SysVinit. Let's say the cameras are controlled via a service on Box A called "camerasrvr". Is there a way for me to tell Box A to postpone starting camerasrvr until it finds and mounts the NBD export?

A couple of thoughts:

* Don't save your data to /mountpoint, but to /mountpoint/subdirectory. The logic here is that an application can't tell (or rather, won't bother checking) whether /mountpoint is mounted or not. It exists and is writeable, so it's valid. If you write to /mountpoint/subdirectory, though, then if the device isn't mounted, then the directory doesn't exist and the application throws an error.

* As you're using SysVinit, everything is script, so update the nbd initscript to do something like "fping BoxB" in a loop. It's not pretty, but it will do the job.

* Consider NFS which seems to be much more resilient to the server not being there. I have a computer with an NFS root and it happily ticks along even if I reboot the server (albeit I/O blocks while the server's down).


Thanks!

--John


-- For more information, please reread.

Attachment: signature.asc
Description: PGP signature


Reply to: