Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

work on daemon - do not use (Still no work properly)

  • Loading branch information...
commit 907893fffd5d62c7006f646753a6bf314dcd530c 1 parent b0ff16d
miaoufkirsh miaoufkirsh authored
5 README.md
View
@@ -1,4 +1,5 @@
-# OpenplacOS: Home automation for your system #
+# OpenplacOS: Home automation for your system # [![Build Status](https://secure.travis-ci.org/openplacos/openplacos.png?branch=unstable)](http://travis-ci.org/openplacos/openplacos)
+
## Presentation ##
@@ -142,4 +143,4 @@ Type:
* `status` to have a top level report of your system
* `list` to have all objects and corresponding interfaces
* `get <object> <iface>` to make a read access on specified object and interface
-* `set <object> <iface> <value>` to set an interface of an object to a specified value.
+* `set <object> <iface> <value>` to set an interface of an object to a specified value.
4 server/WebServer.rb
View
@@ -196,8 +196,8 @@ class WebServer < Sinatra::Base
class ThinServer < Thin::Server
def initialize(bind,port)
- @pid_file = "#{File.dirname(__FILE__)}/opos-deamon.pid"
- @log_file = "#{File.dirname(__FILE__)}/opos-deamon.log"
+ @pid_file = "#{File.dirname(__FILE__)}/opos-daemon.pid"
+ @log_file = "#{File.dirname(__FILE__)}/opos-daemon.log"
super(bind,port, :signals => false) do
use Rack::CommonLogger
use Rack::ShowExceptions
4 server/main.rb
View
@@ -227,15 +227,15 @@ def quit(top_, internalmain_)
# start the WebServer
if options[:deamon]
- server.daemonize()
+ server.daemonize
end
server.start!
-
top.components.each { |c|
if !c.thread.nil?
c.thread.join
end
}
+
4 test/config_rspec.rb
View
@@ -9,8 +9,8 @@ def run_one_test(config_)
end
def kill_server
- if File.exist?("#{File.dirname(__FILE__)}/../server/opos-deamon.pid")
- Process.kill("INT",File.read("#{File.dirname(__FILE__)}/../server/opos-deamon.pid").to_i)
+ if File.exist?("#{File.dirname(__FILE__)}/../server/opos-daemon.pid")
+ Process.kill("INT",File.read("#{File.dirname(__FILE__)}/../server/opos-daemon.pid").to_i)
end
sleep 0.5 # wait the server is down
end
5 test/server.rb
View
@@ -2,6 +2,7 @@
require 'json'
class Server
+ DAEMON_FILE = "#{File.dirname(__FILE__)}/../server/opos-daemon.pid"
def initialize(str_)
@arg = str_
@status = false
@@ -16,8 +17,8 @@ def launch
# Kill the server
def kill
- if File.exist?("#{File.dirname(__FILE__)}/../server/opos-deamon.pid")
- Process.kill("INT",File.read("#{File.dirname(__FILE__)}/../server/opos-deamon.pid").to_i)
+ if File.exist?(DAEMON_FILE)
+ Process.kill("INT",File.read(DAEMON_FILE).to_i)
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.