tkellem 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/tkellem.rb +1 -1
- data/lib/tkellem/bouncer.rb +1 -1
- data/lib/tkellem/daemon.rb +15 -8
- data/lib/tkellem/version.rb +1 -1
- metadata +2 -2
data/lib/tkellem.rb
CHANGED
data/lib/tkellem/bouncer.rb
CHANGED
data/lib/tkellem/daemon.rb
CHANGED
@@ -46,10 +46,6 @@ class Tkellem::Daemon
|
|
46
46
|
exit(status ? 0 : 1)
|
47
47
|
when 'restart'
|
48
48
|
stop if status(false)
|
49
|
-
while status(false)
|
50
|
-
print "."
|
51
|
-
sleep(0.5)
|
52
|
-
end
|
53
49
|
daemonize
|
54
50
|
start
|
55
51
|
when 'admin'
|
@@ -104,18 +100,25 @@ class Tkellem::Daemon
|
|
104
100
|
@daemon = true
|
105
101
|
File.open(pid_file, 'wb') { |f| f.write(Process.pid.to_s) }
|
106
102
|
|
107
|
-
# TODO:
|
103
|
+
# TODO: support syslog
|
104
|
+
require 'logger'
|
105
|
+
logger = Logger.new(log_file)
|
108
106
|
STDIN.reopen("/dev/null")
|
109
|
-
STDOUT.reopen(
|
107
|
+
STDOUT.reopen(log_file, 'a')
|
110
108
|
STDERR.reopen(STDOUT)
|
111
|
-
|
109
|
+
STDOUT.sync = STDERR.sync = true
|
112
110
|
end
|
113
111
|
|
114
112
|
def stop
|
115
113
|
pid = File.read(pid_file) if File.file?(pid_file)
|
116
114
|
if pid.to_i > 0
|
117
|
-
puts "Stopping tkellem #{pid}
|
115
|
+
puts "Stopping tkellem #{pid}"
|
118
116
|
Process.kill('INT', pid.to_i)
|
117
|
+
while status(false)
|
118
|
+
print "."
|
119
|
+
sleep(0.5)
|
120
|
+
end
|
121
|
+
puts
|
119
122
|
else
|
120
123
|
status
|
121
124
|
end
|
@@ -152,4 +155,8 @@ class Tkellem::Daemon
|
|
152
155
|
File.join(path, 'tkellem.socket')
|
153
156
|
end
|
154
157
|
|
158
|
+
def log_file
|
159
|
+
File.join(path, 'tkellem.log')
|
160
|
+
end
|
161
|
+
|
155
162
|
end
|
data/lib/tkellem/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tkellem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.8.
|
5
|
+
version: 0.8.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brian Palmer
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-06-
|
13
|
+
date: 2011-06-14 00:00:00 -06:00
|
14
14
|
default_executable: tkellem
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|