How to run as background process?
Last updated
Last updated
Exiting the IDE window does not terminate the container, but it does terminate the process running in the terminal. To avoid this, you should run it as a background process.
There are 2 options to set-up;
Run in the background setting (recommanded!)
Use nohup
command
Enter the execution command in the script, then tap the Run in the background checkbox to run the command.
command tap > Run > click right on wanted run command > setting > check Run in the backgound > Save and run
nohup
commandPrepare a file(ex. a.out) that you want to run in a background process.
Type the command
You can check for execution with the command below.
After finding the PID value with the ps
command, end the process with the kill
command.
※ Note: nohup
command automatically creates a file called nohup.out.
This file records the output of the commands you run with nohup.
If you don't want to create this file, you can have it output to /dev/null.
You can simply run it as a background process using the forever
command in the npm package.
Install forever
Run the app with the command below
You can verify whether it's running or not with the command below.
For detailed usage, please refer to forever usage.