summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaio Begotti <caio1982@mandriva.org>2009-12-09 18:09:43 +0000
committerCaio Begotti <caio1982@mandriva.org>2009-12-09 18:09:43 +0000
commit573ffd03a9c33bae394d64289d56459154e5e277 (patch)
tree5892834b059cdb9f82e02beb5cc6427e80a9d160
parent2bc0e8797f13a2028853310fc5b2a8615c14d000 (diff)
downloaddrakx-net-573ffd03a9c33bae394d64289d56459154e5e277.tar
drakx-net-573ffd03a9c33bae394d64289d56459154e5e277.tar.gz
drakx-net-573ffd03a9c33bae394d64289d56459154e5e277.tar.bz2
drakx-net-573ffd03a9c33bae394d64289d56459154e5e277.tar.xz
drakx-net-573ffd03a9c33bae394d64289d56459154e5e277.zip
fix multiple instances of draknetcenter (caught on instanton)
-rw-r--r--NEWS2
-rwxr-xr-xbin/draknetcenter5
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 7e2364e..3319762 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@
- allow multiple IPs which resolve to the same host in /etc/hosts (#30168)
- cellular and 3g modem backend:
o support udev-supplied 3g modem parameters
+- avoid multiple instances of draknetcenter for the
+ same user (if it's already running)
0.86.1:
- ignore non-fatal wpa_supplicant messages (#54002)
diff --git a/bin/draknetcenter b/bin/draknetcenter
index b2f8d14..7396631 100755
--- a/bin/draknetcenter
+++ b/bin/draknetcenter
@@ -2,19 +2,22 @@
# Olivier Blin, 2007 <oblin@mandriva.com>
# Licensed under the GPL
-
use strict;
use lib qw(/usr/lib/libDrakX);
# i18n: IMPORTANT: to get correct namespace (drakx-net instead of libDrakX)
BEGIN { unshift @::textdomains, 'drakx-net' }
+use common;
use standalone;
use network::network;
use network::monitor;
use network::netcenter;
use dbus_object;
+#- Allow multiple instances, but only one per user:
+is_running('draknetcenter') and die "draknetcenter already running\n";
+
my $in = 'interactive'->vnew('su');
my $net = {};
network::network::read_net_conf($net);