Skip to content

Commit 8820231

Browse files
committed
wpa_supplicant: add ExecReload to the service unit
Add an ExecReload command to call "wpa_cli reconfigure" on the interface. With that we can use "systemctl reload" to reconfigure a wireless device without having to call stop/start.
1 parent ff65879 commit 8820231

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/networkd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,6 +1341,8 @@ write_wpa_unit(const NetplanNetDefinition* def, const char* rootdir)
13411341
g_string_append(s, " -Dnl80211,wext\n");
13421342
}
13431343

1344+
g_string_append_printf(s, "ExecReload=/sbin/wpa_cli -i %s reconfigure\n", stdouth);
1345+
13441346
g_autofree char* new_s = _netplan_scrub_systemd_unit_contents(s->str);
13451347
g_string_free(s, TRUE);
13461348
s = g_string_new(new_s);

tests/generator/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
[Service]
100100
Type=simple
101101
ExecStart=/sbin/wpa_supplicant -c /run/netplan/wpa-%(iface)s.conf -i%(iface)s -D%(drivers)s
102+
ExecReload=/sbin/wpa_cli -i %(iface)s reconfigure
102103
'''
103104
NM_MANAGED = 'SUBSYSTEM=="net", ACTION=="add|change|move", ENV{ID_NET_NAME}=="%s", ENV{NM_UNMANAGED}="0"\n'
104105
NM_UNMANAGED = 'SUBSYSTEM=="net", ACTION=="add|change|move", ENV{ID_NET_NAME}=="%s", ENV{NM_UNMANAGED}="1"\n'

0 commit comments

Comments
 (0)