Thorntail not exiting gracefully - maven

I'm running a Thorntail 2.2.1.Final microservice with Maven using either of these commands
mvn thorntail:start
mvn thorntail:run
It runs fine, but when I hit Ctrl-C it doesn't exit the application i.e. the console returns, but the app runs in the background. I've tried to stop it
mvn thorntail:stop
But that doesn't work. I have to go and kill the process. I'm using Windows 10.

The thorntail:start and thorntail:stop goals are meant to be used together as part of a Maven lifecycle, typically for integration testing. That is, thorntail:start intentionally leaves the process running in the background, and thorntail:stop should stop it.
For interactive use, mvn thorntail:run should be used. That keeps waiting in the foreground, and Ctrl+C should stop the application behind it.
If none of that works, it's a bug. I'd recommend filing a bug in https://issues.jboss.org/browse/THORN and preferrably also include a jstack output for the process.

Related

mvm quarkus:dev now has commandline interactive interface how can I turn it off?

I run quarkus using the command
mvn quarkus:dev
In the past this was fine but now the output is interspersed with an interactive curses based menu like below :
Tests paused
Press [r] to resume testing, [o] Toggle test output, [h] for more options>
I am spawning several quarkus processes at one time and redirecting the output into a UI I created to aggregate the output so I'm not flipping back and forth between 7 terminal windows. The recent introduction of this "feature" apparently causes the normal output to either be redirected directly to the tty because the redirection of stderr/stdout is no logger being picked up by my application. How can I remove this feature from quarkus:dev ?
Use mvn quarkus:dev -Dquarkus.console.enabled='false'

How to debug a Quarkus.io application that doesn't stay running

I'm trying to run a Quarkus application that was running just fine in dev mode. I had a basic hello-world app. I added a few other resources just to see how that worked. At some point, my app would no longer stay running. It does build successfully (no errors/failures) but won't stay running. (It should be listening on port 3000). I tried running it with
mvn compile quarkus:dev -X
And while that does produce quite a bit more output, there are no errors. The app just exits. I'm not sure how to go about troubleshooting this.

AWS ECS trouble - Running shell script to boot program

I am trying to run a Docker image on amazon ECS. I am using a command that starts a shell script to boot up the program:
CMD ["sh","-c", "app/bin/app start; bash"]
in order to start it because for some reason when I run the app (elixir/phoenix app) in the background it was crashing immediately but if I run it in the foreground it is fine. If I run it this way locally, everything works fine but when I try to run it in my cluster, it shuts down. Please help!!
Docker was supposed to keep track of your running foreground process, if the process stop, the container stop. The reason your container work when you use command with "bash" because bash wasn't stop.
I guess you use she'll script to start an application that serve in background like nginx or a daemon. So try to find an option that make the app running foreground will keep your container alive. I.e nginx has an option while starting "daemon off"
for some reason when I run the app (elixir/phoenix app) in the background it was crashing immediately
So you have a corrupted application and you are looking for a kludge to make it looking like it somewhat works. This is not a reliable approach at all.
Instead you should:
make it working in background
use systemctl or upstart to manage restarts of Erlang VM on crashes
Please note that it matters where you have your application compiled. It must be the exactly same architecture/container as the production one, with same Erlang, Elixir, OS versions, otherwise nobody guarantees it will be robust or even working.

How to start a foreground process even if its parent is a Windows service or daemon process?

I have a parent process which stared as a service. This service needs to start RobotFramework.
If Robotframework did not start foreground, Selenium test library will complain when starting the browser (Chrome) and fail.
for example, i have a testcase like:
test.txt
***setting***
Library SeleniumLibrary
***test case***
open_browser
Open Browser www.stackflow.com chrome
i run test.txt from a windows service process, by invoke command like
pybot test.txt
since pybot`s parent is a service ,so, pybot also become a backgroud process, and this result selenum complain open brower failed
What should I do to make RobotFramework start on the foreground? Or is there another way to make Selenium work properly?

Running Erlang project on Amazon EC2

We have a project with different processes, and run it by calling erl -pa ebin, mymodule_supervisor:start_link().
We have set up an ubuntu instance on Amazon EC2. Being new to this, how can we run the project remotely, so we can close the connection and the project will continue to run?
We can run the Erlang shell in the background, but we can't our project on it. It would be perfect to see an example.
Method 1: You could build a release package from your code. If done right, this will embed a complete Erlang system (along with your application and its dependencies) in an easily distributable tar file. Using an automatically generated script the node can then be started as a daemon, running in the background even after you close your shell.
A good way to get started is to use Rebar, which already supports release handling out of the box.
Method 2: Use tmux or screen (both easily installed on Ubuntu) to start your node and detach the session. If you choose tmux, the following should work:
Start tmux simply by running tmux from a shell.
From within tmux, start your node with the erl command as before.
Detach your session using Ctrl-b followed by d. Exit your shell. The node should still be running.
The "proper" way to start the supervisor is to call its start_link function from within the start function of your Erlang application.

Resources