Find the answer to your Linux question:
Results 1 to 2 of 2
SIGKILL & SIGTERM are signals sent by shutdown but i am not able to catch these signals when all terminals are killed ...i want a program that could catch signal ...
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Posts
    3

    Catch signal sent by linux os on shutdown

    SIGKILL & SIGTERM are signals sent by shutdown but i am not able to catch these signals when all terminals are killed ...i want a program that could catch signal sent by linux os on shutdown or logout

  2. #2
    Linux Engineer hazel's Avatar
    Join Date
    May 2004
    Location
    Harrow, UK
    Posts
    955
    You can't catch SIGKILL. It is the nature of this signal that no program can handle it. A program that receives SIGKILL just crashes and that's that.

    SIGTERM can be handled; in fact many programs handle it by cleaning up their resources, closing files and so on, then exiting. You can write a program to handle SIGTERM in whatever way you desire and then test it by sending it a SIGTERM using the kill command.
    "I'm just a little old lady; don't try to dazzle me with jargon!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...