[systemd-devel] Specifier support for Alias

Colin Guthrie gmane at colin.guthr.ie
Sun Mar 10 15:08:43 PDT 2013


'Twas brillig, and Markus Rathgeb at 09/03/13 08:20 did gyre and gimble:
> Hi!
> 
> I am using a NAS and want to create .mount and .automount service files
> for the shared.
> The service files differs only by the name of the share and mount target.
> 
> So I thought I use a "@" template for that.
> I created a file "mnt-NAS at .automount" (same for .mount with different
> content, but the same Alias logic):
> ===
> [Unit]
> Description=Automatically mount the NAS share %I
> 
> [Install]
> Alias=mnt-NAS-%I.automount
> 
> [Automount]
> Where=/mnt/NAS/%I
> ===
> 
> If I use "systemctl enable" the symlink is not greated as expected:
> ln -s '/etc/systemd/system/mnt-NAS at .automount'
> '/etc/systemd/system/mnt-NAS-%I.automount'
> 
> What have I to change?
> Or is this not supported? Why?


Currently I believe all mount units have to be named after their
mountpoint, so using template units for mounts just isn't possible.

Regarding specifier support in Alias, this is somewhat relevant the
discussion in the thread "[PATCH] units: Make getty at .service install
rule generic."... not identical by any means but related.

Col




-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/


More information about the systemd-devel mailing list