summaryrefslogtreecommitdiff
path: root/util/wrapper.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2015-06-26 15:21:47 +0200
committerPatrick Simianer <p@simianer.de>2015-06-26 15:21:47 +0200
commit3dafab3491e7b0edf4901f33a5f165c9aa2eb9a5 (patch)
treeab1ac9b03a8a4e89e30bcc7214cefd0f5ce3bbd1 /util/wrapper.rb
parenta04fad578a2067c0818d1f6a630f9fe120a9db6e (diff)
util
Diffstat (limited to 'util/wrapper.rb')
-rwxr-xr-xutil/wrapper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/wrapper.rb b/util/wrapper.rb
index 8445f0f..d18dd39 100755
--- a/util/wrapper.rb
+++ b/util/wrapper.rb
@@ -36,12 +36,14 @@ else
end
pin, pout, perr = Open3.popen3(cmd)
while true
- inp = sock.recv.strip+"\n"
+ inp = sock.recv.strip
break if !inp||inp=="shutdown"
- pin.write inp
+ pin.write inp+"\n"
sock.send pout.gets.strip
end
+STDERR.write "[wrapper] shutting down\n"
pin.close; pout.close; perr.close
sock.send "off"
+exit 0