Nohup does not stop running commands, while nohup does not.

Source: Internet
Author: User
Tags exit in

Nohup does not stop running commands, while nohup does not.

During the test today, the nohup command encountered the following problems:

[Concert @ mhamanager ~] $ Nohup/usr/bin/masterha_manager -- conf =/etc/appl. cnf &
[1] 12501
[Concert @ mhamanager ~] $ Nohup: appending output to 'nohup. out'
Use this command to close the terminal on a single machine. After logging on again, check that the process is automatically disabled. View nohup. out to see that the service is automatically disabled when the terminal is closed.

To solve this problem, note the following:

When the shell prompts that nohup is successful, you need to press any key on the terminal keyboard to return to the shell input command window, and then enter exit in the shell to exit the terminal.

Nohup command

Purpose: run the command without hanging up.

Syntax: nohup Command [Arg...] [&]

Description: The nohup Command runs the Command specified by the Command parameter and any relevant Arg parameter, ignoring all SIGHUP signals. After logging out, run the nohup command to run the program in the background. To run the nohup command in the background, add the & (symbol indicating "and") to the end of the command.

Whether or not the output of the nohup command is redirected to the terminal, the output will be appended to the nohup. out file in the current directory. If the nohup. out file in the current directory cannot be written, the output will be redirected to the $ HOME/nohup. out file. If no file can be created or opened for append, the Command specified by the Command Parameter cannot be called. If a standard error is a terminal, write the specified command to all outputs of the standard error as the standard output and redirect it to the same file descriptor.

Exit status: This command returns the following export values:

126 you can find but cannot call the Command specified by the Command parameter.

127 The nohup Command has an error or cannot find the Command specified by the Command parameter.

Otherwise, the exit status of the nohup Command is the exit status of the Command specified by the Command parameter.

Nohup command and output file

Nohup command: If you are running a process and you think the process will not end when you exit the account, you can use the nohup command. This command can continue running the corresponding process after you exit the account/Close the terminal. Nohup means not to suspend (n ohang up ).

The command is generally in the form of nohup command &

Use the nohup command to submit a job

If you use the nohup command to submit a job, all the output of the job is redirected to a file named nohup. out by default, unless the output file is specified separately:

Nohup command> myout. file 2> & 1 &

In the preceding example, the output is redirected to the myout. file.

Use jobs to view tasks.

Disable using fg % n


In linux, The nohup command and does not mean that

Hanging up refers to a SIGHUP signal, which means that the white point is to save resources like a voice-controlled street lamp. After a long time, the power supply is cut off.

Some programs in linux do not have the corresponding daemon process, that is, add a process like D after the program name, to ensure that it will not be saved and killed, so the nohup do not disturb the way to run the program, & run in the background.

It is best to use screen to remotely connect to the server.
Install yum install screen without this

Run commands in linux

Search nohup

Nohup
Nohup command
Purpose: LINUX command usage. Run the command without hanging up.
Syntax: nohup Command [Arg...] [&]
Description: The nohup Command runs the Command specified by the Command parameter and any relevant Arg parameter, ignoring all SIGHUP signals. After logging out, run the nohup command to run the program in the background. To run the nohup command in the background, add the & (symbol indicating "and") to the end of the command.
If the output of the nohup command is not redirected, the output will be appended to the nohup. out file in the current directory. If the nohup. out file in the current directory cannot be written, the output will be redirected to the $ HOME/nohup. out file. If no file can be created or opened for append, the Command specified by the Command Parameter cannot be called. If a standard error is a terminal, write the specified command to all outputs of the standard error as the standard output and redirect it to the same file descriptor.
Exit status: This command returns the following export values:
126 you can find but cannot call the Command specified by the Command parameter.
127 The nohup Command has an error or cannot find the Command specified by the Command parameter.
Otherwise, the exit status of the nohup Command is the exit status of the Command specified by the Command parameter.
Nohup command and output file
Nohup command: If you are running a process and you think the process will not end when you exit the account, you can use the nohup command. This command can continue running the corresponding process after you exit the account/Close the terminal. Nohup means not to suspend (n ohang up ).
The command is generally in the form of nohup command &
Use the nohup command to submit a job
If you use the nohup command to submit a job, all the output of the job is redirected to a file named nohup. out by default, unless the output file is specified separately:
Nohup command> myout. file 2> & 1 &
In the preceding example, the output is redirected to the myout. file.
Use jobs to view tasks.
Disable using fg % n.
Two other ftp tools, ncftpget and ncftpput, can be used to upload and download files in the background through ftp, so that I can use these commands to upload and download files in the background.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.