From 6a9dcb688628a1a3900f25f72effce4f62f6900e Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Tue, 25 Dec 2018 19:59:38 -0600 Subject: [PATCH] Ensure mounts are able to be network aware The mount unit can take requires and after statements which help ensure mounts are "mounted" at the appropriate times. This change ensures that mounts that do not begin with a "/" have network aware statements in them automatically which ensures things like NFS, CIFS, or iSCSI mounts are correctly handled at the time of system start. Change-Id: I0afa240ea4792710b9d6e84831ccac01e0cb3972 Signed-off-by: Kevin Carter --- templates/systemd-mount.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/systemd-mount.j2 b/templates/systemd-mount.j2 index d9b7bd1..e001e17 100644 --- a/templates/systemd-mount.j2 +++ b/templates/systemd-mount.j2 @@ -2,6 +2,10 @@ [Unit] Description=Auto mount for {{ systemd_mount_item }} +{% if not (item.what is search("^/.*")) or not (item.what is search("^//.*")) %} +Requires=network-online.target +After=network-online.target +{% endif %} [{{ systemd_mount_suffix | capitalize }}] What={{ item.what }}