how to run Play2.5.x in sbt as daemon? - sbt

I attempt to deploy my Play project in a test environment by sbt run.
It could be easy test and update source code inner a team.
But the sbt(v0.13.15) process and Play process be closed when I leave the ssh session.
I have attempt with:
setsid sbt "run -Dhttp.port=9001 -Dhttp.address=192.168.1.230" &
nohup sbt "run -Dhttp.port=9001 -Dhttp.address=192.168.1.230" &
sbt -Djline.terminal=jline.UnsupportedTerminal "run -Dhttp.port=9004 -Dhttp.address=192.168.1.230" &
setsid nohup sbt "run -Dhttp.port=9001 -Dhttp.address=192.168.1.230" &
Hope some help.Thanks

Related

why can't my robot properly execute a bash script?

Robot Code:
*** Tasks ***
Build and Deploy
Import Library Process
Run Process /Users/jcastro2/code/flutter/arkiteki/build_deploy.sh shell=yes
/Users/jcastro2/code/flutter/arkiteki/build_deploy.sh:
#!/bin/bash
flutter build web --web-renderer html
scp -r ~/code/flutter/arkiteki/build/web/* user#000.000.000.000:/var/www/arkiteki.co/html/
log.html:
The bash script works when I run it manually, but not when a robot runs it. Any ideas?
I'm willing to make a bet that the issue is with working directory.
Try changing:
Run Process /Users/jcastro2/code/flutter/arkiteki/build_deploy.sh shell=yes
to:
Run Process /Users/jcastro2/code/flutter/arkiteki/build_deploy.sh shell=yes cwd=/Users/jcastro2/code/flutter/arkiteki/
or
Run Process /Users/jcastro2/code/flutter/arkiteki/build_deploy.sh shell=yes cwd=/Users/jcastro2/code/flutter/arkiteki/web

How to run qt-creator project with 'sudo nice x' prefixes?

So i have a C program that i made a while back that im going to remake in qt with additional features.
Typically how i ran the program is I open the terminal, navigate to the project folder, and use the command
$ sudo nice --10 ./myprogram
That is not the case anymore, since i am using qt-creator i now just simply click the 'run' button and the program starts. My program works best when it has elevated scheduler priority hence the nice --10.
How do i modify my qt-creator project to run my program with the sudo nice --10 command?
To do that go to
Tools-> Options-> Environment -> System Tab under the terminal option write "/usr/bin/xterm sudo nice --10"
Also if you have not done it already go to Projects -> Build & Run -> Run and check the box Run in terminal.
I never tried, but in the config of your project you can add a user defined executable to be executed.
Maybe creator allows for a shellscript, than you can simply put your sudo nice --10 in a shellscript, or you write a little program which gets a program path as parameter and starts it with the elevated scheduler priority (guess there is a user api in linux for that...)

Qt app build from cmd-line as a .bat file

Am trying to automate a build process of an Qt app from a .bat file.
Am able to build a Qt app from cmd-line by entering each cmd one-by-one. Like qtenv2.bat, then vcvars64.bat, and then qmake.
But when I put those cmd in a .bat file and try to execute the bat in cmd, strange is happening, ie, after qtenv2.bat runs, it doesn't proceed to the next cmd for vcvar64.bat, it quits the execution.
The autoBuild.bat file is as below.
So when I run this in cmd, it's as below stops after qtenv2.bat
I want it to continue with the next cmds in the same console(it's a necessity for the build process) as below, where I run each cmds step-by-step. And the same is required from the .bat file.
I tried the following .... start "qtenv2" /min cmd /k call qtenv2.bat......but it started the process in a separate console, which I don't want.
Any suggestion, how to write the .bat file, so that qtenv2.bat runs and then vcvars.bat also runs in the same console with stopping the execution.
Regards,
Sayan
Changing between drives blocks your bat file to continue. Just add /D in cd command should help :
#echo "setting up Qt env..."
cd /D C:/a/b/c
qtenv.bat
#echo "going to working dir ..."
cd /D D:/works_dir/
$VC_FULL_PATH/vcvars64.bat
#echo "building now ...."
qmake && make clean
make

Nodes are not opening up properly after executing the runnodes script

I was exploring thIS cordapp example
https://github.com/corda/corda-training-template.git
There is a total of 4 nodes (Notary, A, B, and C) in this example. I am trying to open all the nodes in a single run using runnodes script from the terminal.
But all the nodes are not opening at a time. It's like alternatively they are opening, onetime only Notary and C nodes are opening and another time A and B nodes are opening.
Any specific reason?
And also I am getting this message in the webserver terminal. Please explain.
"The Corda specific webserver is deprecated and will be removed in future".
The runnodes script is not a very reliable way of starting up the nodes. Its mostly used for development purposes to make development faster.
It might sometimes not work as expected. The script works by opening up a terminal window and running the command to start the node in that particular terminal. Depending on the speed of the system, the command sometimes gets executed before the new terminal is opened up.
The reliable way to start a Corda node, however, is to use the java -jar corda.jar command. So just go into each individual nodes folder and run the command to start the node.
Here's the script :
#!/usr/bin/env bash
set -eo pipefail
# Allow the script to be run from outside the nodes directory.
basedir=$( dirname "$0" )
cd "$basedir"
if [ -z "$JAVA_HOME" ] && which osascript >/dev/null; then
# use default version of java installed on mac
/usr/libexec/java_home --exec java -jar runnodes.jar "$#"
else
"${JAVA_HOME:+$JAVA_HOME/bin/}java" -jar runnodes.jar "$#"
fi
Its the same one that you use to start the node, found in build/nodes folder

xsbt-web-plugin how to stop container without killing sbt console

I am using xsbt-web-plugin v4.0.1. After starting the sbt console, the tomcat:start command works fine. However I don't know how to run tomcat:stop. When I press Ctrl-C, I exit out of console, but I think tomcat continues to run in background. When I press Ctrl-D, I see the message waiting for server to shutdown and then sbt exists. Either case, I am forced to start sbt console again.
I have added following 2 lines in build.sbt
fork in run := true
connectInput in run := true
and this line in my global.sbt
cancelable in Global := true
How can I start and stop container without exiting sbt?
After running tomcat:start, you can run tomcat:stop (or any other sbt command) at any time.
The tomcat:start command does not block further interaction with the sbt prompt. It can be misleading to see the output of the container mixed in with that of the sbt prompt.
The fork in run, connectInput in run, and cancelable in Global settings are not needed to be able to use tomcat:start and tomcat:stop.

Resources