Minecraft server has prompt issues with tmux on cygwin - cygwin

I am attempting to run a Bukkit server on tmux in Cygwin (using babun). Starting the server in tmux looks fine at first, but once it's finished starting there is no prompt on screen (>). I believe that this has something to do with Bukkit's use of JAnsi, as it says that it's not able to instantiate a WindowsAnsiOutputStream:
Loading libraries, please wait...
2016-01-17 19:42:51,385 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream
...
I would like to know a solution to this, because without the prompt, I am unable to type and send a command to the server while it is outputting text.
My start.zsh:
java -server -Xms4G -Xmx4G -jar craftbukkit-latest.jar nogui nojline
(I have no ~/.tmux.conf)
My tmux command for starting the server:
tmux new-session -n minecraft ./start.zsh

Related

Using Huey with Django: How to keep run_huey command running?

I'm using Django on Ubuntu 18.04.
I've got everything set up. And I type python manage.py run_huey in the server (through an SSH connection) to start huey, and it works.
However this is done through the command line through SSH and it will shut off when I close the SSH connection.
How do I keep run_huey running so that it will stay active at all times? Furthermore, after a system reboot, how do I get run_huey to automatically start?
You may explore supervisorctl utility for ubuntu, it keeps process running and can log into file and any other features. Google it.

How to use tmux inside release pipeline

I have an azure release pipeline to run my backend application on a DigitalOcean server.
I would like to use a tmux window so I can still see the terminal in case I need to debug the production backend.
tmux new-session -A -s tmuxWindowName
pkill java
mv backend/demo-0.0.1-SNAPSHOT.jar backend/backend.jar
java -Xmx800M -jar backend/backend.jar
tmux detach
but this doesn't work because the azure ssh connection is not attached to a terminal. I get the following error:
##[error]open terminal failed: not a terminal
I tried setting the term with "TERM=xterm" and googling this issue comes up with lots of people that are able to manipulate the SSH connection command but I can't since I use an SSH service connection.
What to do?
You can create a detached tmux session by adding -d to new-session which will not require a terminal (until you attach it which will be presumably from somewhere else).

Start nodejs app on linux server with ssh-if i close the ssh connection,app stopped why?)

Start nodejs app on linux server with ssh(if i close the ssh connection,app stopped why?)
1-create nodejs app -its oke
2-run on linux server -its oke(i stop the apache server)
But if i close the ssh connection(with my windows pc),app stopped.How can i solve this problem?
The most correct thing to do is to write a service file for it so whatever init system you have (likely systemd) will keep it running and manage the start/stop/restart stuff for you.
Failing that (and I don't blame you...) you can run it within the screen utility. Launch it with screen -d -m /path/to/start/script and then you can come back later and reconnect to it with screen -r or screen -r <pid of the screen session>.
Note that launching it that way won't restart it, etc. To do that, you could do something like
#!/bin/sh
while true
do
sleep 3s
/path/to/start/script
done
And call that with the screen command.
Use the nohup command to start the application. Like:
nohup THE_COMMAND_YOU_DONT_WANT_TO_STOP_WHEN_YOU_LOGOUT &
With nodemon it might be helpful to put the command to start the server in a file called myserver.sh containing:
nodemon server.js
Make sure the file is executable:
chmod +x myserver.js
And then run
nohup myserver.sh &

Start a server running with screen in a vagrant box

I'm trying to run a server automatically when my vagrant box boots.
Similar to start screen detached in a vagrant box with ssh, how?, except I'm trying to do it with a provisioning script set to run: "always".
I'm doing something like this: nohup screen -S server -mL -d bash -c 'start-my-server.sh'.
The server starts fine, and if I would have done this within the shell, I could switch to the server with screen -r server.
When I go in after with vagrant ssh, it doesn't find any screens...I'm assuming this is because its not the same shell session.
Is there anyway to get a hold of that screen session?
Edit
Forgot to mention that I had prefixed the screen command with nohup
The answer is that vagrant provision was running as a privileged user, and therefore I couldn't see the screen logging in as the vagrant user.

nodejs server - mac terminal crash every one hour

I got a live server running nodejs chat app. I connect to server using terminal on mac. I start the server by typing server.js.
the problem is, my terminal always hung after one hour running, and there are no error outputs. when it hangs, I press ctrl+c I got the message [process completed].
note: My terminal runs node apps locally without any problems.
And my current chat app run well when I initiate it with WinSCP in windows platform.
Try launching your node process on the remote server using a tool like nohup.
bash$ nohup /path/to/node server.js > out.txt 2> err.txt &
[1] 53032
# Now you can logout of the remote server without
# killing the "node" process and chat server.
[Edit]
Note that the number printed by "nohup" (e.g. 53032) is the id of detached process, so if you need to terminate it you can do something like "kill -9 53032". If you forgot to record that number then you'll have to find it by using a program such as "ps"; for example, you can run "ps auxwww | grep node" (the flags will vary depending on your system) and you'll see output similar to this:
maerics 81694 0.6 0.5 2543604 21216 s000 S+ 10:34AM 0:09.45 /Users/maerics/opt/node/node server.js
In this example, on my system, the number in the second column is the process id.

Resources