This tutorial shows you how to solve "There are stopped jobs" custom made "logout” in terminal (SSH). What does this message mean in Linux and what you need to do to be able to disconnect from the terminal, see step by step in the tutorial below.
Before you see how you can disconnect from a terminal at the command "logout", it is good to know what this message means.
Message "There are stopped jobs” appears when you try to disconnect from a terminal in which there are processes running or waiting to be interrupted (Ctrl+C) or the sequel (fg
) their.
It is about the processes between the terminal and your client connecting to that system. Connection SSH by Putty or Terminal (macOS).
So, this is not an error message, but just a message that informs the user that he has “jobs” in progress, which have not been saved or closed. Most of the time, this message appears when you edit text files with "vim", which you did not save, but left the editing screen.
Content
How do you solve "There are stopped jobs" custom made "logout” in SSH (Terminal)
To be able to log out with the command "logout
"normally, you need to terminate or terminate those processes.
1. Run the command "jobs
” in the terminal. This command will display the list of pending or running processes.
2. Next, after you have identified the open process, you have several options:
Restoring the process in execution
Use the command "fg
” to resume the stopped process (job) and then finish it with the key combination Ctrl+C.
Move the process to the background to avoid "There are stopped jobs"
Run the command "bg
” to move the process to the background. Now you will be able to close the connection to the terminal with the command "logout
” without stopping the open process.
End the task association with the current shell
You can also use the command "disown
". This command removes a job
associated with the current shell, so that you can close the terminal connection session. If you execute a command in the terminal and want to keep it active even after you close the terminal, you can safely use the command "disown
".
Forced closing of the workload
This method is not recommended, but if you want, you can force close the task.
Identify the PID of the process with the command:
ps aux | grep process_name
Force terminate the process:
kill -9 PID_number
After any of the steps in the tutorial above, you will no longer be greeted by the message "There are stopped jobs" when you execute the command "logout
” to close the session in a terminal.