Bug 87688

Summary: Cannot create mount unit files for hidden (dotted) directories
Product: systemd Reporter: emergency.shower
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description emergency.shower 2014-12-24 23:04:34 UTC
It seems that currently there's no obvious way to create mount files for hidden directories. The escape rules described in the documentation are a little bit obscure either. E.g.

# systemctl start .mntpts-doc.mount
Failed to start .mntpts-doc.mount: Unit .mntpts-doc.mount failed to load: Invalid argument. See system logs and 'systemctl status .mntpts-doc.mount' for details.


# systemctl status .mntpts-doc.mount
● .mntpts-doc.mount - Documents Directory
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)
    Where: /.mntpts/doc
     What: //svc.host.dom/doc

Dec 24 23:55:54 systemd[1]: .mntpts-doc.mount's Where= setting doesn't match unit name. Refusing.
Comment 1 Chris Atkinson 2015-01-01 12:38:29 UTC
I was able to get it to work by escaping the leading ".". In your case you would name your mountfile "\x2emntpts-doc.mount". You then also need to escape the mountfile name when starting/stopping it, so "systemctl start \\x2emntpts-doc.mount".

The discussion of escaping on the man page doesn't seem to cover this case, but only "-" and unprintable characters. 

Note that if you have a .dotfile further down the path (so "/home/emergencyshower/.mntpts/doc") it seems to work fine, so this seems only to come into play where you have a dotfile in /.

HTH
Comment 2 Zbigniew Jedrzejewski-Szmek 2015-01-01 16:22:35 UTC
I think requiring the leading dot to be escaped is fine, it is quite a special case. An example in the docs would be good though.
Comment 3 Zbigniew Jedrzejewski-Szmek 2015-01-06 03:51:51 UTC
Description clarified in http://cgit.freedesktop.org/systemd/systemd/commit/?id=995084c.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.