-
Notifications
You must be signed in to change notification settings - Fork 10
script: add a systemd job to kill old apt processes #453
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
base: main
Are you sure you want to change the base?
Conversation
playbooks/kill_stuck_apt.yml
Outdated
| content: | | ||
| #!/bin/bash | ||
|
|
||
| PIDS=$(ps -eo pid,etime,comm | awk ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bro I think the LLM got drunk here.
Surely ps on Ubuntu supports the etimes column (notice the s at the end) which gives you process age in seconds, so we don't need all this awk slop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll switch it to using etimes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was mostly me that followed a stackoverflow thread which used etime and then took it to chatgpt to convert it into seconds, so its easier to do the kill command.
| - name: Copy kill_stuck_apt.sh to /usr/local/bin | ||
| copy: | ||
| dest: /usr/local/bin/kill_stuck_apt.sh | ||
| content: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use templates for the systemd service unit, and timer unit, but drop the script content inline. Any reason not to have this in a separate file as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try moving it to a separate file.
|
Warning
This is a public repository, ensure not to disclose:
What kind of PR is this?
Required: Mark one of the following that is applicable:
Optional: Mark one or more of the following that are applicable:
Important
Breaking changes should be marked
kind/admin-changeorkind/dev-changedepending on typeCritical security fixes should be marked with
kind/securityWhat does this PR do / why do we need this PR?
...
Information to reviewers
Checklist