On Feb 3, 2016, at 10:57 AM, m.roth@5-cent.us wrote:
The issue: NFS fails to start in CentOS 7 if it cannot resolve any of a list of hosts.
Well, my manager had to google to find the *truly* obscure solution that uses a deeply oddball syntax.
In /usr/lib/systemd/system/nfs-server.service, you edit the following line so that it looks like this: ExecStartPre=-/usr/sbin/exportfs -r
Notice the *deeply* weird syntax of "=-<cmd>". This apparently tells it that "a nonzero exit code" should be ignored and considered "success”.
Deeply weird or not, this is standard make (or at least gnu make) syntax. I wouldn’t be surprised if the developers thought it was completely normal.
And, I read in the manpage for systemd.service that if you precede it with an @, it will pass arguments. Why it does not use the used-everywhere-else of *post*fixing those parms, I have no data.
My reading of the man page is that arguments are always passed, and @ just means that the first “argument” (i.e. 1st token after the executable name) is passed as argv[0] (which would normally the path of the executable itself). But that’s entirely based on the man page, no actual experience.
Noam