On 12/23/2016 08:23 PM, Wols Lists wrote:
Looking on the web, I discovered that apparently putting the correct options in fstab is the proper way of mounting partitions (I couldn't find any documentation specifically about creating disk service files).
So I did that, and now I gather systemd creates temporary service files for me. Great, except that when I shut down the system my user is logged out, the network dies, and the unmounts seem to hang forever. I can't remember if they have ever successfully timed out and let the laptop shut down - certainly displaying the shutdown the umount command has been running for over 15 minutes.
This is an incomplete answer. First: forget about fstab altogether. You may want to delete it. Under systemd there is a backward compatable function called a 'generator' that scan /etc/fstab and build the unit files that systemd actually uses. This is why altering fstab on a running system makes no difference. However if you remove the pertinent entries from fstab or delete fstab altogether and set up your own corresponding unit files under /et/systemd/ then you CAN have control over the order. What do these look like? well you can get tempaltes by seeing what the generator produces by looking in /run/systemd/generator/ and look at the *.mount files. You will see in those units that there are "Before:" and "After:" lines. Right now the "After:" just deals with doing the fsck first :-) But if I want to mount "/home/anton/MyDocuments/Letters/Family" ... And I have file systems for HOME, MYDOCUMENTS, LETTERS I need to make sure they are mounted in the right order, and that's where I can make use of the "After:" clauses. Now systemd has some smarts when it comes to mounting file systems, but those smarts may not suit your use case, so the customized Dot-Mount files can force it to follow the order that applies for your use case. I realise this is an incomplete answer. It doesn't answer tour needs for the interaction with the user login. I haven't drilled down to understand the logind function yes. I am aware that PAM can be used to mount a file system when a user logs in, unmount when the user logs out -- see "man pam_mount". That is old hat; dates back to the SUN thin workstations with NFS. Please see the PAM documentation for that. You solution might lie there. I see also that 'loginctl' lets you attach specific devices to logged in users. -- 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