A process started in the background using a shell command will stop when the shell session ends. This happens even if the process has not finished its work. The process will show an exit code of 0, which means it looks like a success.
By Pawan Nayar · from the LLOS AI Learning record
A process started in the background using a shell command will stop when the shell session ends.
This happens even if the process has not finished its work. The process will show an exit code of 0, which means it looks like a success.
When a developer runs a Python script in the background using a shell command, the script is linked to that shell. If the shell session closes or times out, the operating system stops the script. The script does not show an error. It simply stops wherever it was. The exit code 0 makes it look like the script finished correctly.
A developer runs a Python script to clean 1,000 customer records. The developer uses a shell command to run the script in the background. The script cleans 134 records. Then the developer closes the shell window. The script stops. The log file shows an exit code of 0. The developer thinks the script finished, but only 134 records were cleaned.
Resolved from this lesson's own record — real definitions, not invented for this page.
More from the same record, pulled by shared topic — not written new for this page.
When an AI model starts a program, the new program is linked to the AI model's process. If the AI model's process closes, the program it started will also close.
Before starting a server, a developer must kill all existing instances. After killing, the developer must check that no instances are running.
A developer needs to know the purpose of each script. A developer must understand what output each script creates.
A developer must always restart the server after any file change. The developer should never tell a user to run the server.
A process started in the background using a shell command will stop when the shell session ends. This happens even if the process has not finished its work. The process will show an exit code of 0, which means it looks like a success.