In this post we will see a case study of a Galera Cluster migration to AWS Aurora and quick solution to the replication issue. A friend received an error in…
Today lets talk a little about converting a MySQL table to CSV (Excel). My friend was looking to export MySQL to Excel, I saw couple of questions for export MySQL…
I’m going to narrate you a story that happened around a crashing MyQL, Corrupted InnoDB table and finally the recovery by table restore. We will see how our database administrator…
2 responses to “How to Pause (Suspend) a process in Linux with kill signals”
Hi there,
Your script could be improved somewhat, because if you only give it ‘start’ or ‘stop’ as parameter without a second parameter, it will happily execute a kill command, which will fail because the PID is missing.
For that, I suggest changing the line ‘if [ “$#” -eq 0 ]; then’ to ‘if [ “$#” -lt 2 ]; then’.
Secondly, the line under ‘usage() {‘ isn’t quite correct. I would suggest the following:
echo “$(basename $0) [stop|start] PID”
This way, the actual script name is shown, while the ‘basename’ makes sure the path to the script is left out.
Lastly, the semicolon after the last line isn’t necessary and looks a bit wacky because there is another line with ‘fi’ that isn’t followed by a semicolon, so the last line looks out of place.
Thank you for your inputs, Richard,
I was working on a PoC for something and this was one of the section of that which I found useful to share. That said, your recommendations are good. I will look to adjust this.
Cheers.