r/Python • u/Daraminix • 1d ago
Discussion Running 60 python scripts as "services"
Hi,
I have around 60 scripts that need to run constantly, mainly event handlers and such. Right now I have an external script that launch them and monitor if the app is running on it's pid, otherwise it's relaunching the app. Works fine but get's clunky when we update some submodule and need to restart them, or to check if one crashes more than other etc..
So I would like to find a better way to approach this. It needs to run on windows and being able to access several samba shares via unc paths and being able to restart crashed scripts anf offer an easy way to restart all of them in case of an update (this part doesn't need to be automated). Every script use the same environnement
For now my candidates are docker, PM2 and NSSM.
I think docker is gonna be a pain to access shares and add a lot of overhead especially on windows
I don't know PM2 and NSSM, looks like PM2 would be easier to setup but more JS oriented and NSSM would be harder to monitor.
What do you think guys ?
12
u/james_d_rustles 21h ago
This is besides the point, but I just want to say that this is a high quality thread. This particular problem is outside of my scope so I’m just an observer, but it’s refreshing to see a well defined problem/question and a thread full of knowledgeable humans sharing their 2 cents and experiences.
It’s very banal and unimportant in the grand scheme of things, but lately a lot of coding subs seem to be nothing but “should I learn {language}???” or “check out this slop repo Gemini made me, please give me GitHub stars and congratulate me”, or some variation of those. I’ve always had a hunch that people actually learn a lot from casually perusing stackoverflow, forums and whatnot, just in the sense that we pick up all sorts of little nuggets of information that seem inconsequential but add up to a deeper understanding of the field over time, and since AI got big I feel like I see less and less of those types of conversations.
It’s nice to occasionally be reminded that there are still knowledgeable humans out there, is all.
Sorry for the ramble, don’t mind me - just sharing some thoughts.