How to delay the startup of a system service or mount of remote file system until the network is fully available

Solution Verified - Updated -

Issue

  • A service configured to bind to a specific IP address fails with Cannot assign requested address or similar error message

  • A service configured to bind to a specific IPv6 address fails to start even if it is configured to start after network-online.target

  • A remote file system (e.g. NFS, CIFS) configured to connect to a specific IPv6 address fails to mount automatically at boot

    [...] systemd[1]: remote.mount: Mounting timed out. Terminating.
    [...] remote.mount: Mount process exited, code=killed status=15
    [...] remote.mount: Failed with result 'timeout'.
    [...] systemd[1]: Failed to mount /remote.
    
  • A remote file system (e.g. NFS, CIFS) configured to connect to a hostname fails to mount automatically at boot

  • The system serving as NFS server fails to export its directories to NFS clients

    [...] exportfs[XXX]: exportfs: Failed to resolve <some nfs client name>
    

Environment

  • Red Hat Enterprise Linux 7 and later
    • systemd
    • dovecot, httpd, sshd, ...
    • NFS, CIFS
    • IPv6 but also IPv4 when using name resolution

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content