Stop Meteor on windows? With cygwin? - windows

I am using Meteor on windows with cygwin, and after executing "meteor help" I was surprised to see that no command to stop the server was available. Hitting ctrl+c did not stop it. I can't find any process called node or meteor. What can I do?

read more about Ctr + C and Ctr + Z in here
and the reason for cygwin in here

Related

[KDB+/Q]: Reattach Windows console to a background running q process

Assuming there is q process running in the background after launching it with system command:
$ q
q) system "q -p 5000"
q) \\
$
How can I attach my Windows console (cmd or PowerShell) or terminal multiplexer (such as ConEmu) back to that process, so that I get:
q)
q)\p
5000i
I found a similar question here: Windows equivalent for Linux "screen" or another alternative?
The asker is looking for a windows version of the Linux screen command, which I think would be what you are looking for. Unfortunately there doesn't seem to be a native solution but you should read through it and see if it sheds any light on the topic for you.
A workaround using IPC, connect to the process from a new q session using:
q)h:hopen `::5000;
Then pass the command through to get the information you need.
q)h"sum 10 20"
30
Here's a link to the kx IPC cookbook for more info on IPC:
http://code.kx.com/q/cookbook/ipc/
Hopefully some of this is useful to you.

Auto Restart SH script on crash?

Hi there guys i have a server running a game I've created and it has three SH scripts that are required to run in separate terminals so what i wanna know is 2 things.
1:is there a way i can get a single script that i double click on and launch all three scripts to where i can see the shell (for Debugging)
2: Is there any way to have said scripts auto restart when they exit or crash? (for full automated access when the server is unattended by a dev)
Server Specs:
6gb ram 60gb SSD 6 core CPU
Ubuntu 14.04
with vnc for desktop control
Here's a SH script for you.
running=1
finish()
{
running=0
}
trap finish SIGINT
while (( running )); do
// Execute the command here that starts your server.
echo "Restarting server on crash.."
sleep 5
done
You can run this script for each server in it's own screen. That way you can see the console output of each one. For example:
screen -S YOURUNIQUENAME -m THESCRIPTABOVE.sh
In order to detach from the screen, hit CTRL + A then CTRL + D. You can get back to the screen by using screen -x YOURUNIQUENAME
For a nice guide on using the screen command, see this article: http://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/ . It even has a video to show how it's used.

Halt grunt server from terminal

I've installed and am exploring Yeoman but one thing that I can't seem to find an answer to is, how do I halt the grunt server from running?
Is this something that can be done from the terminal? It just sits and waits.
You can stop it with ctrl + c in terminal
If it's a task that is running in background you can find his process
id (pid) with ps aux | grep grunt and then kill it with kill {pid}

How to close a Terminal window while executing a file with node.js without stopping the process?

When I execute a file with node.js (by typing "node example.js", maybe a http server), then, when I close the Terminal window (Mac OS X Lion), the process is stopped and doesn't answers on requests anymore. The same happens if I type "ctrl c" or "ctrl z". How can I close the Terminal without stopping the process, so my server continues answering on requests.
Use a combination of the nohup prefix command (to keep the process from being killed when the terminal closes) and the & suffix (to run the process in the background so it doesn't tie up the terminal):
nohup node example.js &
You should also look into forever or similar tools that will also automatically restart the server if it crashes, and nodemon which will automatically restart it when you change the code.

Running command in background using cygwin from Windows cmd

I use cygwin from my Windows command line, I've always done everything quite happily except being able to run something in the background (i.e. putting & at the end of a command).
Just to give you more context, I want to be able to start a Mercurial web server and still be able to keep using the command line window and even closing it without killing the server. For example:
>hg serve &
listening at http://localhost:8000/ (bound to *:8000)
>echo "Still able to do this"
Any workarounds to this?
I had a similar problem running Apache, finally I used cygstart, it's like CMD start:
cygstart --hide /c/apache/bin/httpd.exe
In this case, it will run Apache as an background proccess thanks to the --hide option
Found the solution:
start <command> /B
start is a windows command, do a help start for more info
Alternatively and for my case
hg serve --daemon
or
hg serve -d
will do the trick

Resources