Welcome to the Linux Foundation Forum!

LFS201 - Chapter 4 Discussion // Questions // Banter

Options

SIGNALS

Comments

  • chrisfeig
    chrisfeig Posts: 32
    Options

    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)

  • blackbear710
    Options

    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

  • blackbear710
    Options

    maybe @luisviveropena could enlighten us with his Linux Wisdom

  • heiko_s
    heiko_s Posts: 99
    Options

    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.

  • luisviveropena
    luisviveropena Posts: 1,154
    Options

    Hi all,

    @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.

    Many regards,
    Luis.

  • owenpkent
    owenpkent Posts: 6
    Options

    where do we find signals.c?

  • coop
    coop Posts: 915
    Options

    It's in the solutions tarball discussed in the introduction under resources, which tells you how to download it

  • fcioanca
    fcioanca Posts: 1,903
    Options

    It can also be downloaded directly from the menu, under Resources > Files.

Categories

Upcoming Training