Instead of ending a process, you can stop it and continue it later, with the same kill.
STOP stops the process: it freezes in state T, as after Ctrl+Z. CONT continues it from the same spot. Like KILL, STOP cannot be caught by the program.
jobs shows the job as Stopped first and Running again after. A stopped process is alive: it keeps its PID, memory, and open files. If it was in the middle of writing a file, the file stays unfinished until the process is continued.
An export is writing its report. You sent it STOP. What happens to the report?
-
A program cannot catch STOP: the process freezes where it was.
psshows it as T, and the report does not change. -
A stopped process does nothing until CONT arrives.
jobsshows it as Stopped. -
STOP does not end the process, let alone delete files: the stopped process shows T in
ps, and the report stays where it is.
STOP pauses the process: its memory, open files, and PID stay, but the work stands still. The report gets finished once CONT continues the process.
Key points
- STOP pauses a process (T), and CONT continues it from the same spot.
- A pause is not an exit: the process keeps its memory, files, and PID.