You are not logged in.

#1 2013-11-21 17:23:25

AMaudio
Member
From: Ireland
Registered: 2013-11-07
Posts: 14

[SOLVED]Making sure /etc/fstab mounts complete before a service starts

Hi there. This is probably a very basic question, but haven't found a clear categorical answer yet. Basically, I would like to know how I can make sure that a systemd service starts ONLY after all filesystems in /etc/fstab have been mounted.

I know that in a systemd service you can specify an After=XXXX rule to make sure the service is only started after XXXX starts. Well, I want to do that, except that my XXXX is a particular mount in /etc/fstab.

Also, is there a way of preventing the service from starting if for example a filesystem failed to mount?

Thanks a lot in advance!

Last edited by AMaudio (2013-11-21 18:11:38)

Offline

#2 2013-11-21 17:44:28

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [SOLVED]Making sure /etc/fstab mounts complete before a service starts

You can't always expect to find clear, categorical answers. I suggest you run systemctl list-units . I'm sure you'll find something useful there. wink


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2013-11-21 18:01:14

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: [SOLVED]Making sure /etc/fstab mounts complete before a service starts

From man systemd.mount :

Mount units may be configured via unit files...

That means units can be dependent on mount units the same way as on other units.

Offline

#4 2013-11-21 18:10:50

AMaudio
Member
From: Ireland
Registered: 2013-11-07
Posts: 14

Re: [SOLVED]Making sure /etc/fstab mounts complete before a service starts

Thanks. This answers my questions. I didn't realise that for every mount on /etc/fstab a .mount unit gets created. (Still learing the ways of archlinux). Thanks guys!!

Offline

#5 2013-11-21 18:46:28

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED]Making sure /etc/fstab mounts complete before a service starts

Fyi, you're talking about the ways of systemd here, not the ways of Arch. :-)

Offline

Board footer

Powered by FluxBB