{"id":28256,"library":"sppm","title":"Sample Python Process Manager","description":"SPPM is a Python process management library that simplifies daemonization, service supervision, and command-line process control. Current version 2.1.4 supports Python >=3.8.5. Released under MIT license, maintained on GitHub with irregular cadence.","status":"active","version":"2.1.4","language":"python","source_language":"en","source_url":"https://github.com/geekcampchina/SamplePythonProcessManager","tags":["process-manager","daemon","supervision","cli"],"install":[{"cmd":"pip install sppm","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"Direct import of module does not expose ProcessManager; use explicit from import.","wrong":"import sppm","symbol":"ProcessManager","correct":"from sppm import ProcessManager"}],"quickstart":{"code":"from sppm import ProcessManager\n\npm = ProcessManager()\npm.start('my_process', 'python worker.py')\nstatus = pm.status()\nprint(status)\npm.stop('my_process')","lang":"python","description":"Initialize a ProcessManager, start a command as a managed process, check status, then stop it."},"warnings":[{"fix":"Test on target OS and handle platform-specific behavior.","message":"ProcessManager uses fork() on Unix; on Windows, it may fall back to subprocess spawn. Ensure your application code handles both.","severity":"gotcha","affected_versions":"all"},{"fix":"Use unique names per process or check if a name already exists via status().","message":"When running multiple processes, avoid starting processes with the same name; subsequent starts silently overwrite the previous entry.","severity":"gotcha","affected_versions":">=2.0.0"},{"fix":"Replace pm.run(cmd) with pm.start('name', cmd).","message":"The 'run' method is deprecated in 2.1.0+; use 'start' instead.","severity":"deprecated","affected_versions":">=2.1.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use 'from sppm import ProcessManager'.","cause":"Using 'import sppm' then calling 'sppm.ProcessManager' instead of importing the class directly.","error":"AttributeError: module 'sppm' has no attribute 'ProcessManager'"},{"fix":"Either stop the existing process first with pm.stop('name'), or use a different name.","cause":"Attempting to start a process with a name that is already registered and still running.","error":"ProcessManagerError: Process 'name' already running"},{"fix":"Reduce number of managed processes, increase system limits, or switch to spawn-based backend.","cause":"Fork failure due to system memory limits or process table exhaustion, typically on systems with many processes or restricted containers.","error":"OSError: [Errno 12] Cannot allocate memory"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}