I have to set up a license server on a RHEL7 machine with systemd. The license server should start upon boot and load a license file from a shared disk on the network. So I need to wait for the network to start and for autofs to finish mounting NFS disks. I have this service file:

Description=Flexnet license server
Wants=network.target network-online.target autofs.service
After=network.target network-online.target autofs.service

ExecStart=/soft/flexera/glnxa64/lmgrd -c /soft/licenses/license.dat -L /home/licenseuser/license.log

# Give a reasonable amount of time for the server to start up/shut down


The service starts after autofs has started but before autofs has mounted all of the disks so the license server cannot be started.

1 Answer 1


You should add in the following

RequiresMountsFor=<path required>

This will ensure the path is accessible before starting the service and also will mount it if it's not already (unless it has noauto specified). Check with your manpages (man systemd.unit) if the option is supported in your system as mine is quite bleeding edge.

  • 1
    sorry for necro, but what if this is an NFS mount and nfs hasn't yet started? Edit: answering my own question, just checked the manpage RequiresMountsFor, so it appears to work with nfs mounts too as long as they are well defined in /etc/fstab without 'noauto'
    – Normadize
    Mar 28, 2019 at 17:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .