3 ms·
> I like for my web server to come up after the NFS share it reads from is mounted. Why does this matter? Your load balancer or service discovery layer should
by justinsaccount 10y ago
> I like for my web server to come up after the NFS share it reads from is mounted.
Why does this matter? Your load balancer or service discovery layer should detect that the web server is not functioning properly and take it out of rotation. What do you do when your NFS server has an outage?
Even if you DID care about that sort of thing, systemd has a RequiresMountsFor option:
RequiresMountsFor=
Takes a space-separated list of absolute paths. Automatically adds dependencies of type Requires= and After= for all mount units required to access the specified path.
Or with something like runit you would just do
#!/bin/sh
# web/run
if [ -d /web/root ] ; then
exit 2
fi
.. normal start commands here
That way if the box comes up before the NFS server the web server process will still properly start on its own as soon as NFS comes back up.
I'm sure your hacked up scripts handle this scenario or anything else that can go wrong. Or maybe you get paged at 3am every few days when something breaks. YMMV.
- bandrami 10y agoHm. You seem to have a lot invested in convincing me that the systems I've been using for over a decade don't actually work. shrug. Yes, I agree there are complicated ways that systemd and other rc systems can, largely, emulate the flexibility I get from writing a bash script to start the services I want started. I just don't really want them.
- justinsaccount 10y ago> You seem to have a lot invested in convincing me that the systems I've been using for over a decade don't actually work. Yes, I used to work with people like you. "What's wrong with this method? we've been using these scripts for 10 years!" And every time the database restarts the app server crashes and the site goes down. And for 10 years this has been seen as perfectly normal. After all, it's so simple! At 3am all someone has to do is login and run some site specific bash scripts that someone hacked together 10 years ago.
- bandrami 10y ago> And every time the database restarts the app server crashes and the site goes down. Nope. I've also never had these phantom poorly behaved forking daemons leaving orphan processes all over the process space that people claim drove them to systemd. Like I said, YMMV. What I've built works really, really well, and can be picked up tomorrow by anybody who knows sh.
- digi_owl 10y agohttp://memory-alpha.wikia.com/wiki/Galaxy's_Child_%28episode%29 http://memory-alpha.wikia.com/wiki/Galaxy's_Child_%28episode...