summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rwxr-xr-xbin/net_applet5
-rw-r--r--lib/network/connection_manager.pm1
3 files changed, 7 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 9b6a83c..cc91514 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,5 @@
- net_applet: fix error dialog title after selecting a wireless network
+- install net_monitor package on demand (mga#157)
1.24:
- connection manager: extract gtk2 specific code in separate module
diff --git a/bin/net_applet b/bin/net_applet
index b4d5ec1..a722c28 100755
--- a/bin/net_applet
+++ b/bin/net_applet
@@ -15,6 +15,7 @@ use network::connection;
use network::connection::ethernet;
use network::vpn;
use run_program;
+use do_pkgs;
use mygtk2 qw(gtknew gtkset);
use dbus_object;
use network::monitor;
@@ -315,6 +316,10 @@ sub shouldStart() {
return getAutoStart();
}
sub run_net_monitor() {
+ my $in = 'do_pkgs';
+ # stop reaping child processes or else gurpmi segfaults
+ local $SIG{CHLD} = "DEFAULT";
+ $in->do_pkgs->install('net_monitor');
run_program::raw({ detach => 1 }, '/usr/bin/net_monitor', '--defaultintf', $current_interface) unless is_running('net_monitor');
}
sub run_netcenter() {
diff --git a/lib/network/connection_manager.pm b/lib/network/connection_manager.pm
index 9e76868..6096c13 100644
--- a/lib/network/connection_manager.pm
+++ b/lib/network/connection_manager.pm
@@ -222,6 +222,7 @@ sub stop_connection {
sub monitor_connection {
my ($cmanager) = @_;
my $interface = $cmanager->{connection} && $cmanager->{connection}->get_interface or return;
+ $cmanager->{in}->do_pkgs->install('net_monitor');
run_program::raw({ detach => 1 }, '/usr/bin/net_monitor', '--defaultintf', $interface);
}