-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check if another instance of ZPUI is running #120
Comments
We do have a pidfile already, too: |
could we add that to avoid someone trying to run 2 instances at the same time? |
Sure, that's doable - no idea how exactly yet, but sure, why not. I'd suggest a warning more than "refuse to start", I'd rather not make this into something that developers would have to fight in case of a bug with detection mechanism |
I meant for it to pause at start asking if you wanted to continue anyways, try to top the other PID, or just close |
not sure about an argument - don't want anyone to run "main.py --help" to figure out a bug. A pause on start sounds more dev-friendly =) |
so I see the line that says to use |
hmm. Could you debug the service file? |
As in, how to force systemd to create it |
Actually I will set it up that when it checks It will just create a file if it doesn't exist, and if it does exist and its the same pid as the current running version, it will just continue |
hmm, sounds like a good workaround |
How
At start up, check if there there is a PID file at
/tmp/zpui.pid
, and if there is check if the number inside the files PID is still running, if it is, then fail to start if no console, and if there is a console say another instance is still running and ask if they want to quit or try again. and if its running, say a warning and then overwrite with that processes PID is still there and that most likely means a failed shutdown, and then start like normalThe text was updated successfully, but these errors were encountered: