systemd network-online.target question

Kaleb S. KEITHLEY kkeithle at redhat.com
Wed Jul 17 11:47:29 UTC 2013


On 07/16/2013 11:24 AM, Lennart Poettering wrote:
> On Tue, 16.07.13 11:12, Kaleb KEITHLEY (kkeithle at redhat.com) wrote:
>
>>
>> I need glusterd to start before any _netdev mounts (NFS or
>> glusterfs) take place.
>>
>> reading the system.special man page it talks about ...pulling in
>> network-online.target and order themselves after it.
>>
>> Would adding a Before=network-online.target to the glusterd.service
>> be the right thing to do or is there a better solution?  (It already
>> has After=network.target rpcbind.service)
>
> All network mounts configured in fstab will pull in
> network-online.target, and are ordered after it.

Yes (and that's what the man page says, so I knew that.)

>
> If you want your service to start on *all* boots, regardless whether
> there is any remote fs configured in fstab or not -- but if there's a
> remote fs configured then before that, then only use
> Before=network-online.target in your [Unit] section. (And use
> WantedBy=multi-user.target in [Install] as you would for any other
> normal service).

That's what I want. Start on all boots regardless, and before any 
"remote" fs in fstab. I.e. before attempting to mount any "local" nfs 
mount in fstab.

But a user who tried that says the "local" nfs mount(s) in his 
/etc/fstab still failed. I tried it as well with an f19 guest vm and got 
the same results, namely that the nfs mount(s) failed to mount at boot.

=============== /usr/lib/systemd/system/glusterd.service =======
[Unit]
Description=GlusterFS an clustered file-system server
Wants=glusterfsd.service
After=network.target rpcbind.service
Before=network-online.target

[Service]
Type=forking
PIDFile=/run/glusterd.pid
LimitNOFILE=65536
ExecStart=/usr/sbin/glusterd -p /run/glusterd.pid

[Install]
WantedBy=multi-user.target
=============== /usr/lib/systemd/system/glusterd.service =======


======================== /etc/fstab =======================
#
# /etc/fstab
# Created by anaconda on Mon Jul  8 12:45:13 2013
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/fedora-root /                       ext4    defaults        1 1
UUID=16a22380-99d1-4c17-81d2-6e1f9b03343d /boot                   ext4 
   defaults        1 2
/dev/mapper/fedora-swap swap                    swap    defaults        0 0

localhost:volX /mnt				nfs	_netdev	0 0
======================== /etc/fstab =======================


More information about the devel mailing list