commit 15f2eb70481c858fbda0fadf8b1304e98fdafd7e
parent 39de44160387816d0194a0faf1147a5d25ad1992
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date: Thu, 21 Sep 2006 01:32:37 -0700
[project @ 54af53319b1743da35833f4126a84d8d35b1420a]
[project @ 118]
add termination of existing procs in wmiirc
remove usage of /event for coordinating the above
Diffstat:
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/wmiirc b/wmiirc
@@ -23,6 +23,17 @@ require 'logger'
LOG = Logger.new(__FILE__ + '.log', 5)
+# terminate existing instances
+ pidList = `ps -C #{File.basename $0} -o pid`.split.map! {|s| s.to_i}
+ pidList.shift # discard header
+ pidList.reject! {|pid| pid == $$}
+
+ pidList.each do |pid|
+ LOG.info "stopping instance #{pid}"
+ Process.kill :SIGTERM, pid
+ end
+
+
LOG.info "starting"
begin
diff --git a/wmiirc-config.rb b/wmiirc-config.rb
@@ -23,11 +23,6 @@ require 'rc'
FS = Wmii.fs
-## WM startup
-
-FS.event = "Start #{__FILE__}\n"
-
-
## executable programs
PROGRAM_MENU = find_programs( ENV['PATH'].squeeze(':').split(':') )
@@ -440,12 +435,6 @@ begin
type, arg = event.split(' ', 2)
case type.to_sym
- when :Start
- if arg == __FILE__
- LOG.info "another instance is starting"
- exit
- end
-
when :BarClick
clickedView, clickedButton = arg.split