summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitry Kim <dmitry point kim at gmail point com>2007-04-21 17:58:25 +0000
committerDmitry Kim <dmitry point kim at gmail point com>2007-04-21 17:58:25 +0000
commita7b1061f7546d9e3be894aa52a90c9a2f0fbae3c (patch)
tree9cca0ea47a546d5d55c232a7caab117e2b9c305c /lib
parent3d662886107ebcebd1608ee710b8130adbdbea35 (diff)
+ pidfile support + command line option for pid file name
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/ircbot.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb
index b1ffb51f..f4c1f5bc 100644
--- a/lib/rbot/ircbot.rb
+++ b/lib/rbot/ircbot.rb
@@ -429,6 +429,10 @@ class Bot
log_session_start
+ File.open($opts['pidfile'] || "#{@botclass}/rbot.pid", 'w') do |pf|
+ pf << "#{$$}\n"
+ end
+
@registry = BotRegistry.new self
@timer = Timer::Timer.new(1.0) # only need per-second granularity