[systemd-devel] [Solved] How to mount NFS prior to start postgresql from this volume

Lennart Poettering lennart at poettering.net
Wed Jul 6 04:08:43 UTC 2016


On Mon, 04.07.16 09:40, wolfgang.wagner at riwa-gis.de (wolfgang.wagner at riwa-gis.de) wrote:

> >-----Ursprüngliche Nachricht-----
> >Von: Lennart Poettering [mailto:lennart at poettering.net]
> >Betreff: Re: [systemd-devel] How to mount NFS prior to start postgresql from this volume
> >
> >Normally, if you want a service to run only after all NFS mounts are in place, add an ordering dependency towards remote-fs.target to it. Specifically: add a drop-in file
> >/etc/systemd/system/postgresql at .service.d/50-nfs.conf and write into it:
> >
> > <snip>
> > [Unit]
> > After=remote-fs.target
> > </snip>
> 
> 
> Thank You Lennart,
> 
> your tip was the solution for my problem.
> Now all works as expected.
> Only one question remains: I do not understand, why the "@" in the
> directory-name is necessary or what it does.

The "@" in the name indicates a templated unit. Templated units allow
you to write a single unit file that can be instantiated multiple
times. Not sure how precisely your postgresql packages make use of
this though.

A common example for this is getty at .service (the linux login prompt
thingy) which is the template that gets instantiated multiple times
for each tty the prompt is shown, and thus becomes getty at tty1.service,
getty at tty2.service and so on. See systemd.unit(5) for more information
about templates and instances of them.

By using drop-ins you may either extend the config of all instances of
a template, or just of one specific instance, by using the drop-in dir
/etc/systemd/system/foo at .service.d/ or
/etc/systemd/system/foo at bar.service.d/. The former applies to all
instances (as the instance part is left empty), and the latter only to
the instance "bar" of it.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list