summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgebele <gebele@in-silico.ch>2016-05-12 15:35:03 +0000
committergebele <gebele@in-silico.ch>2016-05-12 15:35:03 +0000
commit80cdde4c5cd03829518772e71b0bee4133afe622 (patch)
tree2ea8bc5ba4f17b249f575ae93eac3aee02bd4e1d
parent171d6e675a0e1c209340d2988e3a39d06999d18c (diff)
bumped version
-rw-r--r--VERSION2
-rwxr-xr-xbin/lazar-start.sh23
-rwxr-xr-xbin/lazar-stop.sh55
-rw-r--r--lazar-gui.gemspec6
-rw-r--r--unicorn.rb5
5 files changed, 50 insertions, 41 deletions
diff --git a/VERSION b/VERSION
index b0bb878..85b7c69 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.9.5
+0.9.6
diff --git a/bin/lazar-start.sh b/bin/lazar-start.sh
index b1ea61c..72facbb 100755
--- a/bin/lazar-start.sh
+++ b/bin/lazar-start.sh
@@ -1,20 +1,7 @@
#!/bin/bash
-#R CMD Rserve
-#sudo mongod
-#unicorn -p 8088 -E production
+lazar-stop
+sudo mongod &
+R CMD Rserve
+unicorn -c unicorn.rb -E production -D
-RETVAL=0
-
-start() {
- grep_mongo=`ps aux | grep -v grep | grep mongod`
- if [ ${#grep_mongo} -gt 0 ]
- then
- echo "MongoDB is already running."
- else
- echo "Start MongoDB."
- `sudo mongod`
- RETVAL=$?
- fi
-}
-
-exit $RETVAL
+exit 0
diff --git a/bin/lazar-stop.sh b/bin/lazar-stop.sh
index 26de413..f5ba963 100755
--- a/bin/lazar-stop.sh
+++ b/bin/lazar-stop.sh
@@ -1,24 +1,39 @@
#!/bin/bash
-#R CMD Rserve
-#sudo mongod
-#unicorn -p 8088 -E production
+grep_mongo=`ps aux | grep -v grep | grep mongod`
+grep_rserve=`ps aux | grep -v grep | grep Rserve`
+grep_unicorn=`ps aux | grep -v grep | grep unicorn`
-RETVAL=0
+# mongod
+if [ ${#grep_mongo} -gt 0 ]
+then
+ PID=`ps ax | grep -v grep | grep mongod | awk '{ print $1 }'`
+ for i in "${PID}"
+ do
+ `sudo kill $i`
+ done
+else
+ echo "MongoDB is not running."
+fi
-stop() {
- grep_mongo=`ps aux | grep -v grep | grep mongod`
- if [ ${#grep_mongo} -gt 0 ]
- then
- echo "Stop MongoDB."
- PID=`ps ax | grep -v grep | grep mongod | awk '{ print $1 }'`
- for i in "${PID}"
- do
- `sudo kill -2 $i`
- done
- RETVAL=$?
- else
- echo "MongoDB is not running."
- fi
-}
+# rserve
+if [ ${#grep_rserve} -gt 0 ]
+then
+ PID=`ps ax | grep -v grep | grep Rserve | awk '{ print $1 }'`
+ for i in "${PID}"
+ do
+ `kill $i`
+ done
+else
+ echo "Rserve is not running."
+fi
-exit $RETVAL
+# unicorn
+if [ ${#grep_unicorn} -gt 0 ]
+then
+ PID=`ps ax | grep -v grep | grep unicorn | awk '{ print $1 }'`
+ `kill ${PID[0]}`
+else
+ echo "Unicorn is not running."
+fi
+
+exit 0
diff --git a/lazar-gui.gemspec b/lazar-gui.gemspec
index 9eec5f4..6c83511 100644
--- a/lazar-gui.gemspec
+++ b/lazar-gui.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.summary = %q{lazar-gui}
s.description = %q{Graphical User Interface for Lazar Toxicology Predictions}
s.license = 'GPL-3.0'
- s.executables = "lazar"
+ s.executables = ["lazar-start", "lazar-stop"]
s.rubyforge_project = "lazar-gui"
s.files = `git ls-files`.split("\n")
@@ -21,6 +21,8 @@ Gem::Specification.new do |s|
s.add_runtime_dependency "unicorn", "~> 5.1.0"
s.post_install_message = %q{
- To run the service execute `lazar &`.
+ Service cmds:
+ lazar-start &
+ lazar-stop
}
end
diff --git a/unicorn.rb b/unicorn.rb
index 7f8d4a2..010ebbb 100644
--- a/unicorn.rb
+++ b/unicorn.rb
@@ -1,2 +1,7 @@
#worker_processes 4
timeout 6000
+listen 8088
+log_dir = "#{ENV['HOME']}"
+log_file = File.join log_dir, "lazar.log"
+stderr_path log_file
+stdout_path log_file