Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 7324b69

Browse files
authored
B #-: Avoid netplan race condition
2 parents 3de2c1f + 8073d32 commit 7324b69

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/etc/one-context.d/loc-10-network.d/netcfg-netplan

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ configure_network()
4141
# booting of current systems, so we execute netplan apply on the background
4242
case "${NETCFG_NETPLAN_RENDERER}" in
4343
''|networkd)
44-
nohup netplan apply &>/dev/null &
44+
flock /var/run/one-context/netplan.lock nohup netplan apply &>/dev/null &
4545
;;
4646
esac
4747
}
@@ -56,14 +56,14 @@ start_network()
5656
netplan generate
5757
nm_symlink_run_connections
5858
service networking start
59-
netplan apply
59+
flock /var/run/one-context/netplan.lock netplan apply
6060
}
6161

6262
reload_network()
6363
{
6464
netplan generate
6565
nm_symlink_run_connections
66-
netplan apply
66+
flock /var/run/one-context/netplan.lock netplan apply
6767
}
6868

6969
#

0 commit comments

Comments
 (0)