You want a process to keep running on a Linux server. But when the user who starts it logs off, the process ends. How do you allow the user to log off but obviate the logging off from terminating (through signaling termination) of that process you want to remain running?
Have the user use the nohup command to execute the important process. As an example imagine that the process that is important is running "script.sh." Here is how to use nohup:
nohup bash script.sh
You may get a message like this in response: "nohup: ignoring input and appending output to 'nohup.out'"
This is normal. However, the process may appear to hang. So it is often advisable to send the command to the background with an "&" symbol (because commands that involve a user logging off tend to have a long duration):
nohup bash script.sh &
If the user session, the one that ran the "nohup" command (like either of the above), ends (e.g., the user logs off or a system administrator kills the session), the process for script.sh will continue. If script.sh is a long-running and important process, the nohup command can be of great help.