4 replaced http://stackoverflow.com/ with https://stackoverflow.com/
source | link

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-diehttps://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This question does an OK job of talking about this.)

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This question does an OK job of talking about this.)

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See https://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This question does an OK job of talking about this.)

3 replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
source | link

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer@f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This question does an OK job of talking about this.)

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This question does an OK job of talking about this.)

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This question does an OK job of talking about this.)

2 replaced http://serverfault.com/ with https://serverfault.com/
source | link

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This questionThis question does an OK job of talking about this.)

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This question does an OK job of talking about this.)

Your question was a little lacking in details, so I'm assuming that you mean that you typed the command to start your server on the console of your Pi, and it executed in the foreground.

If this is the case, you have five options, ordered by complexity to implement:

  1. Use @f-tussel's answer. Since you're new to GNU/Linux, the & symbol tells the shell that it should execute the process in the background and return you to the prompt immediately, instead of what it normally does (which is wait for the command to finish before returning you to the prompt). This is technically called forking the command to the background.

  2. Do what you did before, but do it in a screen process. Basically this entails installing screen (sudo apt-get install screen on your Debian system), and then sometime before you type the command to start your server, you execute screen. This opens a new shell that you can then reconnect to later, even if your PuTTY connection dies. So it will act as if you've never disconnected.

    If you're unfamiliar with screen, you may want to do some reading on Wikipedia and in the manpages. You can also accomplish this same thing with tmux.

  3. Use the forever node.js module. See http://stackoverflow.com/questions/4797050/how-to-run-process-as-background-and-never-die for where I got this.

  4. Put your server in a screen process in the background. This means that you'll create a new screen session in the background but never attach to it. And, instead of running a shell, the screen process will be running your server. Here's what you'll type:

    screen -d -m exec_your_server --put-args-here
    

    If you like, you can make this run at boot. Basically you need to put the screen command in the file /etc/rc.local or /etc/rc.d/rc.local, I forget which. If you run into trouble doing this, ask a new question.

    Again, you can do this with tmux too.

  5. Write a service script. Since you're on Debian and are new, you're presumably using the default init that Debian provides, which is System V Init. I've never looked at service files for System V Init, only systemd and a little Upstart, so I can't help you here. Ask a new question if you want to pursue this.

    This is the least "hacky" way, IMHO, and this is what you should consider doing if you're running your server long-term, as you can then manage it like other services on the system through commands like sudo service your_server stop, etc. Doing it this way will start your server at boot automatically, and you don't need screen because it also automatically happens in the background.

    It also automatically executes as root, which is dangerous - you should put logic in your server to drop the privileges that you have by becoming an unprivileged user that you have created specifically for the server. (This is in case the server gets compromised - imagine if someone could run things as root, through your server! Eugh. This question does an OK job of talking about this.)

1
source | link