Skip to content

Commit

Permalink
wpa_supplicant: add ExecReload to the service unit
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
daniloegea committed Oct 9, 2024
1 parent ff65879 commit 8820231
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/networkd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,8 @@ write_wpa_unit(const NetplanNetDefinition* def, const char* rootdir)
g_string_append(s, " -Dnl80211,wext\n");
}

g_string_append_printf(s, "ExecReload=/sbin/wpa_cli -i %s reconfigure\n", stdouth);

g_autofree char* new_s = _netplan_scrub_systemd_unit_contents(s->str);
g_string_free(s, TRUE);
s = g_string_new(new_s);
Expand Down
1 change: 1 addition & 0 deletions tests/generator/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
[Service]
Type=simple
ExecStart=/sbin/wpa_supplicant -c /run/netplan/wpa-%(iface)s.conf -i%(iface)s -D%(drivers)s
ExecReload=/sbin/wpa_cli -i %(iface)s reconfigure
'''
NM_MANAGED = 'SUBSYSTEM=="net", ACTION=="add|change|move", ENV{ID_NET_NAME}=="%s", ENV{NM_UNMANAGED}="0"\n'
NM_UNMANAGED = 'SUBSYSTEM=="net", ACTION=="add|change|move", ENV{ID_NET_NAME}=="%s", ENV{NM_UNMANAGED}="1"\n'
Expand Down

0 comments on commit 8820231

Please sign in to comment.