How zz-beego running in the background and transferred back to the foreground nohup bg fg command using Linux system

If you want to start the background bee run yum install coreutils install

Es3000 into the directory
/ root / ksyun / EBS / Console / Go / src / es3000
nohup Bee & RUN es3000


In fact, this is mainly transferred to Linux how the process running in the background, in fact, there are many online articles, but today my colleagues suddenly let beego to run in the background, to prevent the shutdown process termination caused problems cmd, and then actually did not find baidu should be search the way it does, I'll use this title for once recorded

Here we used it four command

nohup
BG
fg
Jobs
the program transferred to run in the background and keep for a long time continuous operation, the following two methods listed here.

The first, most direct nohup command, in fact, is to open an executable file or process by running in the background, the process will be automatically saved to the background, this time may have been turned off cmd continues to run up.

 

The second, a little more complex, but also very simple, first run the program, as we think of beego run the program. Then the key combination Ctrl + z to suspend the program, kept in the background, this time the process is suspended state.

 

Jobs by entering commands to cmd, view the current process, then you will see your progress status is shown as Stopped. At that point the bg command to continue running the program transferred to the background.

jobs // display the current process
bg 1 // id will be saved as a background process to continue to run 1


This is the program has been left running in the background, you can view the jobs command, your process status is displayed as Running on OK

 

If you want to process transferred back to the front desk, it is necessary to use the fg command

fg 1 // by process id number transferred back to the foreground process


This successful program will be transferred back to the front desk beego

 

==================== ==================== update 2019-07-23

Possible here, suddenly shut down Windows DOS or Mac Terminal, the program will still be closed, and will not continue to run on the server, then the solution is the following:

Upon exiting the server, not directly close the DOS window, or Terminal, exit the server through the exit command, so you can ensure that the program may be running on the server.
----------------
Disclaimer: This article is CSDN blogger "stone stone stone brother" of the original article, follow the CC 4.0 by-sa copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/superwebmaster/article/details/80661162


 

Guess you like

Origin www.cnblogs.com/xiaodoujiaohome/p/11403931.html