Skip to content
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

Improve the robustness of startLoginServerLogWatcher and stopLoginServerLogWatcher #3

Open
adamkorynta opened this issue Jun 26, 2024 · 2 comments

Comments

@adamkorynta
Copy link
Collaborator

adamkorynta commented Jun 26, 2024

Based on feedback in PR: https://github.com/USACE-WaterManagement/cwms-logging/pull/2/files#diff-73bdb227d3042d65b857c09e306f8a51f78476f39d91bfedac01c5cfaf0c90b9

Need to add python process management instead of relying on the fragile pid written to disk.

Needs to gracefully exit the python process instead of terminating via kill.

@adamkorynta
Copy link
Collaborator Author

Likely need to add a SIGTERM and SIGINT handler:

def exit_gracefully(signum, frame):
    logging.info('Exited')
    exit(0)

signal.signal(signal.SIGTERM, exit_gracefully)

@rma-psmorris
Copy link
Collaborator

rma-psmorris commented Jun 26, 2024

We might want to look at more than just process start/stop as understanding process status is also useful. Are there Python frameworks that do daemon process management that we could utilize?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants