JacquesB JacquesB - 6 months ago 35
Python Question

Starting a separate process

I want a script to start a new process, such that the new process continues running after the initial script exits. I expected that I could use

to start a new process, and set
so that the main script may exit while the created process continues running.

But it seems that the second process is silently terminated when the main script exits. Is this expected behavior, or am I doing something wrong?

Answer Source

From the Python docs:

When a process exits, it attempts to terminate all of its daemonic child processes.

This is the expected behavior.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download