What are the most common situations a Liinux sysadmin will face that might require the use of signal/s, and what are the signals the sysadmin should send?
Starting with a process is consuming system resources (CPU/memory) and is unresponsive, or is running in the background and for some reason can't be closed normally. If my understanding is correct, the sysadmin should send SIGTERM and if this doesn't work, SIGKILL. Is this correct?
Any others? (I know there were at least a couple from the office hours session)
Great Question, LoL >> The only command I really know is Kill for processes, but I am not 100% on Signal Sending / Falling behind with work everyday and being a slacker.... I will catch back up though, I'm not a complete Potato
maybe @luisviveropena could enlighten us with his Linux Wisdom
I'm not a sys admin, but have used Linux for some time (lets say decades).
Every once in a while a process hangs and doesn't close down. You would probably start with SIGTERM, and use SIGKILL if the process doesn't respond.
Yesterday one of the participants said he uses SIGSTOP and later SIGCONT to stop a process and continue it later at a time when the resources aren't needed.
As for programmers, they might catch signals and react on them so that their program ends gracefully.
But the main use is to kill a process that has run astray.
@chrisfeig you are right. There are also two other signals that might be useful: SIGSTOP for stopping a process, and SIGCONT for continue a process. I remember Amaury mentioned yesterday that was useful for him, when working with a database related process, when you just can't kill the entire process, hehehe.
where do we find signals.c?
It's in the solutions tarball discussed in the introduction under resources, which tells you how to download it
It can also be downloaded directly from the menu, under Resources > Files.