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

prekill_hooks to run a shell script #154

Open
steverweber opened this issue Jan 12, 2022 · 0 comments
Open

prekill_hooks to run a shell script #154

steverweber opened this issue Jan 12, 2022 · 0 comments

Comments

@steverweber
Copy link

I might just be missing something obvious but the documents don't seem to have an example of hooking a bash script using prekill_hooks. I'm wondering if that is possible or something that can be added because it would add a bunch of flexibility.

My use case:

  • a university managing large shared multi user servers
  • often users have code that'll try and eat up all the memory I kill'em off when near 90% of memory

What I hope to do with oomd is catch that out of control PID or process group and use prekill_hooks to pass that information to a bash script to metric/inform admins and the user before oomd does it's magic making it hard to track down details of what was running.

In the script I would then using stdin or args find out the username and send them an email along with a simple grep of ps -aux | grep <PID?> so they know some details on what got killed.

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

1 participant