On 03/08/2016 10:15 AM, Dave Howorth wrote:
In this case, you want that some other services that depend on this mount do not try to start, or that they fail, and say clearly why, but the booting should continue so that you can diagnose and work on the problem.
You can write a script that runs soon after startup and that tries to access a subdirectory or file that is only present in the mounted directory. If it can't access the file, it raises an alarm.
That's easy to do with systemd, a unit that has a dependency. It can be a timer or it can be a "after" some other event. There may be a way to define a unit for the FS which has a "OnFail"
From RTFM ..
OnFailure= A space-separated list of one or more units that are activated when this unit enters the "failed" state. 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. OnFailureJobMode= Takes a value of "fail", "replace", "replace-irreversibly", "isolate", "flush", "ignore-dependencies" or "ignore-requirements". Defaults to "replace". Specifies how the units listed in OnFailure= will be enqueued. See systemctl(1)'s --job-mode= option for details on the possible values. If this is set to "isolate", only a single unit may be listed in OnFailure=.. As far as I can make out, if a unit file exists for a mount that is used, otherwise the result from the running the generator on /etc/fstab is used. So take the line out of the fstab and create the mount unit with appropriate dependencies and the additional lines about what to do if and when it fails. You can use the currently existing generated mount file for that device as a template. -- A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting frowned upon? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org