diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-05-09 12:50:24 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-05-09 14:43:39 +0200 |
commit | 8d196aad96fdcb310b7314a06c3dc66abe0441c7 (patch) | |
tree | 89635ec8b0a92a59cd04b6c4feaff739771790c1 | |
parent | d1447cbc48fe2128ab46a9999727aeb62983504a (diff) | |
download | NetworkManager-8d196aad96fdcb310b7314a06c3dc66abe0441c7.tar.gz |
vpn: set STOPPED state when service disappearsbg/vpn-persistent-rh1706375
When the VPN service daemon fails it sends a state-change signal to NM
and quits; however it is difficult to guarantee that the signal is
delivered to NM before the process termination and so in some cases
the signal is lost. Work around that by manually setting the STOPPED
state when the service disappears from the bus.
-rw-r--r-- | src/vpn/nm-vpn-connection.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vpn/nm-vpn-connection.c b/src/vpn/nm-vpn-connection.c index 23e0d6f041..7e689d61d5 100644 --- a/src/vpn/nm-vpn-connection.c +++ b/src/vpn/nm-vpn-connection.c @@ -2152,6 +2152,10 @@ _name_owner_changed (GObject *object, */ get_secrets (self, SECRETS_REQ_SYSTEM, NULL); } else if (!owner && priv->service_running) { + if ( priv->service_state >= NM_VPN_SERVICE_STATE_STARTING + && priv->service_state < NM_VPN_SERVICE_STATE_STOPPED) + plugin_state_changed (self, NM_VPN_SERVICE_STATE_STOPPED); + /* service went away */ priv->service_running = FALSE; _LOGI ("VPN service disappeared"); |