How to run as background process?

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;

  1. Run in the background setting (recommanded!)

  2. Use nohup command

1. Run in the background setting

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

2. Use nohup command

1. How to run

  • Prepare 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.

2. How to end

  • 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.

If you are using node app

You can simply run it as a background process using the forever command in the npm package.

1. How to run

  • 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.

마지막 업데이트

도움이 되었나요?