I got an runescape private server and I wanted to host my server on it. I ran it with screen like this: screen java -Xmx815m -cp bin:data/libs/netty-3.5.2.Final.jar:data/libs/FileStore.jar:data/libs/mysql-connector-java-5.1.23-bin.jar:data/libs/RuneTopListV2.1.jar:data/libs/GTLVote.jar com.rs.Launcher
It works fine but after some few seconds or minutes the process just gets killed. Why does that happen? Its weird... Its very important for me to fix it so I can start hosting the server.
try adding nohup to your run.sh file instead of using screen. If you do want to use screen, try to search for the parameters it needs to run correctly.
(there's a tutorial out there on rune-server, have seen it multiple times when I was searching how to get my RSPS online on centos a few days ago!)
See the man page for nohup.
Related
I encounter some very strange behavior and I don't know how to handle it.
I suspect that the behavior started to reproduce after last Windows upgrade. But I am not sure if it has anything related to it. (I discovered it when I tried to run maven, which uses java)
The behavior is the following: when run java (e.g. java.exe -version) from command line, it does nothing (like below). The process looks like it is hanged.
enter image description here
I did the following tests:
make a clone of java.exe (e.g. jv.exe) and run it. It works.enter image description here
rename another application to java.exe (e.g. processmonitor.exe to java.exe). When run application, it doesn't open.enter image description here
renamed java.exe to java.exe.bkp and make a link 'java.exe' to 'jv.exe' (which works), and the process is hanged.
make another link java1.exe to jv.exe and it works.enter image description here
did all the operations with&without network, and no difference (java.exe doesn't work, the others work)
restart windows in 'save mode' (+/- network) and java.exe works
I disabled the firewall from windows, and/or I added rules for java.exe. It doesn't work.
Initially I had many JVMs installed. I uninstalled all of them and installed only the one in images. All above tests are made after new installation.
Also, I observed that every time I run java.exe (but not when I run jv.exe or java1.exe) there is a new file java.exe.XXX.dat created in c:\Users\user.name\AppVerifierLogs.enter image description here Searching on google, it seems that is some kind of log file, which can be viewed with this application (https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/application-verifier) but I don't find the standalone application. Maybe it is already installed in the system, but I don't know where or how to enable it.
It seems that for some reason, the Windows is blocking all processes named 'java', no matter if it is actually the java program or any other application. But I'm out of ideas regarding what could be the cause, or how to continue to investigate.
If anyone can help me, I will be grateful to him.
Thank you.
I've inherited and am maintaining a scala/play app that was built several years ago (2014). Every night there's a cron job executing a shell script to restart the app. Running this script from the command line at any time works just fine as well. The app stops, cleans up, rebuilds then restarts.
I've been asked to build a php page which will allow this same shell script to be run via php. I thought it would be very straightforward, but when I exec() the same shell script, I get the output message, ""No java installations was detected."
But of course it is there, where the variables say it should be.
I've tried cd'ing into the directory first before executing the script, and I've tried executing the script as the owner/user of the cpanel account (which is generally how the script is run from the command line). Always the same message. I temporarily tried adding the user to the wheel group (terrible idea long-term I know), but even that didn't work.
I thought it must be some sort of cpanel or server issue, and reached out to the host of the VPS but they didn't think so. The developer of the app is no longer reachable. My guess is it's something he could fix in 5 minutes, I just have no familiarity with this framework.
I've reviewed everything I can online several times and just don't see anything relevant...
Any leads would be greatly appreciated!
I am running a java app that manages other java apps through starting them in different screen sessions. My problem is if one of these managed apps is not responding i'd like to kill its java process through my managing app.
The managing app starts other apps using screen -dmS appname java -jar path
The first thing i tried was to make my managing app run screen -S name -X quit but most of the time this only eliminates the screen session and i get stuck with a running java app that i have no access to.
The second thing i tried to research is to kill the java process itself which will in return terminate the screen but my problem is how can i get the PID of the java application?
ps -A is not helpful because it does not give any clue of the specific java application i want to kill among all others.
I need the PID to be available to my managing application or any other way that gives me the ability to terminate the java process running inside a screen.
However the best thing to solve my problem would be to be able to name the java app process.
I appreciate any help.
I solved the problem by passing an argument when i start any managed app like so:
screen -dmS helperApp java -jar path helperApp
This allowed me to identify the PID of the process among all others by doing
jps -m | grep helperApp
And since i now have the PID identified and acquired i was able to kill the process.
Thanks to everyone who helped.
I want to be able to stop my application from inside every 3 days. I just want to schedule a method that would automatically stop the application without any intervention from outside (like sitting on my desktop etc).
So far, I have these in mind:
Runtime.getRuntime().exec("rhc stop-app --app ApplicationName"); //This doesn't work. I have tried it
Or
System.exit(0) // I am told to not run this command on openshift server
Or
Runtime.getRuntime().exit(0) //I am afraid to run this command
Or
Runtime.getRuntime().halt(0) //I am afraid to run this command as well
Some of those commands I am afraid to use because I am told to not run them on openshift server as they may actually stop the whole vm. And that will stop all the applications that are hosted on that vm. And that will get me banned. I will get banned.
edit: This question is not how to stop an application generally. This question is regarding how to stop a Spring MVC wep application which is hosted on OpenShift server. And no those answers donot work in that link.
Well, I just used Runtime.getRuntime().exit(0) and it successfully stopped my application. I didn't get ban or anything. And I restarted my application to see if there are any issues. No Issues. So that command will do. Thanks
edit: This works but openshift restarts the application automatically. So this is not the answer. I will put the answer here if I find one. Thanks
I want to develop a program for ubuntu platform, That listens to DialUp modem and get Calls and send them to my php program that's running on my localhost.
for example when somebody calls my phone line, my listener program give the number and run this query:
http://127.0.0.1:80/listen.php?caller=ThePhoneNumber
How can I do that? is there any classes in java for that?
I think you'd need native tools for that. You can make pppd answer the call and run a custom script or program. But I have not fiddled with that for a long time. See linux modem howto. There should be plenty of information.