docker-compose down
sometimes crashes, leaving behind busy resources which prevent fully unmounting and remounting docker volumes
i can manually fix this by doing something like:
grep -l 12c8b1e0d711db12b /proc/*/mountinfo
which gives:
/proc/12053/mountinfo
/proc/16127/mountinfo
...
/proc/16139/mountinfo
/proc/16192/mountinfo
etc
where each number is the process PID now i can do
kill -9 16139 12053 ... 16139
I'm trying to put this into a bash script to help automate this process.
Question:
I need to pass the output of grep command through the correct regex to parse out the 2nd argument (the int value in each line of /proc/16192/mountinfo).
The I need to assemble these into a space separated string, and finally pass this string as argument to kill.
I'm not really sure how to approach this in bash scripting
Any and all pointers welcomed