Re: systemd.mount - How to disable the auto-creation of the directory (directories)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Do, 20.10.22 09:18, kAja Ziegler (ziegleka@xxxxxxxxx) wrote:

> Hello,
>
> Is there any way to turn off the automatic directory (directories) creation
> during mount unit start/run? To make the [auto-generated] mount unit behave
> the same as the mount command - to end with an error?

Add a .mount drop-in for your unit that sets AssertPathExists= to your
path in the [Unit] section.

i.e. create /etc/systemd/system/mnt-x.mount.d/50-myassert.conf, and
add:

    [Unit]
    AsserPathExists=/mnt/x

into it.

Lennart

--
Lennart Poettering, Berlin



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux