Professional Web Applications Themes

how to send control-break or ctrl-c signal to background process? - Sun Solaris

Dear all, I have sent a job to run in background... However I now want to gracefully terminate it. This software has a good property that if I press control-break, or ctrl-c, it will enter into a graceful termination mode that it can still give me some partial useful information... so I don't want to use "kill -9" to kill it... instead, since it is run in background, I hope I can sent it a control-break or ctrl-c signal then it can output some partial useful information to the log file and then gracefully shutdown... Can anybody help me on ...

  1. #1

    Default how to send control-break or ctrl-c signal to background process?

    Dear all,

    I have sent a job to run in background... However I now want to gracefully
    terminate it. This software has a good property that if I press
    control-break, or ctrl-c, it will enter into a graceful termination mode
    that it can still give me some partial useful information... so I don't want
    to use "kill -9" to kill it...

    instead, since it is run in background, I hope I can sent it a control-break
    or ctrl-c signal then it can output some partial useful information to the
    log file and then gracefully shutdown...

    Can anybody help me on how to do that?

    Thanks a lot,

    -walala


    walala Guest

  2. #2

    Default Re: how to send control-break or ctrl-c signal to background process?

    walala wrote: 

    It is possible to use "kill" without typing "-9", you know...
     

    Just type "kill 1234", where "1234" is the process number.
    This is short for "kill -INT 1234", which sends a SIGINT
    signal to the process.

    As it turns out, this just what happens to the process if you
    hit Control-C. The terminal driver intercepts the Control-C
    character and sends a SIGINT to "all foreground processes".
    (You might also be interested to know that Control-Z sends a
    SIGTSTP signal to a process.) If you want, you can change
    which characters do this by using "stty". "man termio" will
    give you more information about the settings.

    - Logan

    Logan Guest

  3. #3

    Default Re: how to send control-break or ctrl-c signal to background process?

    Logan Shaw wrote:
     

    No. kill without a signal argument defaults to SIGTERM, not SIGINT.

    --
    Erik Max Francis && com && http://www.alcyone.com/max/
    __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
    / \ But the system has no wisdom / The Devil split us in pairs
    \__/ Public Enemy
    Erik Guest

  4. #4

    Default Re: how to send control-break or ctrl-c signal to background process?

    Erik Max Francis wrote:
     
     [/ref]
     

    Ooops. Good point.

    Why are those separate, anyway? They both seem to mean roughly
    the same thing, at least in a practical sense.

    - Logan

    Logan Guest

  5. #5

    Default Re: how to send control-break or ctrl-c signal to background process?

    Logan Shaw wrote:
     

    Because SIGINT is a user-generated interrupt, whereas SIGTERM is a
    signal to shutdown.

    --
    Erik Max Francis && com && http://www.alcyone.com/max/
    __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
    / \ I can't remember to forget you.
    \__/ Leonard Shelby
    Erik Guest

  6. #6

    Default Re: how to send control-break or ctrl-c signal to background process?

    which one is the correct one then?

    my simulation run for 3 days... if I send a wrong signal, it will terminate
    ungracefully and then all my data will lost...

    So I must send "ctrl-c" or "ctrl-break"...

    can you tell me which one to use?


    "Erik Max Francis" <com> wrote in message
    news:com... 
    >
    > Because SIGINT is a user-generated interrupt, whereas SIGTERM is a
    > signal to shutdown.
    >
    > --
    > Erik Max Francis && com && http://www.alcyone.com/max/
    > __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
    > / \ I can't remember to forget you.
    > \__/ Leonard Shelby[/ref]


    walala Guest

  7. #7

    Default Re: how to send control-break or ctrl-c signal to background process?

    On Sun, 28 Sep 2003, walala wrote:

    Will you stop posting!
     

    Can you read the kill man page?

    --
    Rich Teer, SCNA, SCSA

    President,
    Rite Online Inc.

    Voice: +1 (250) 979-1638
    URL: http://www.rite-online.net

    Rich Guest

  8. #8

    Default Re: how to send control-break or ctrl-c signal to background process?

    walala wrote:
     

    SIGINT.

    --
    Erik Max Francis && com && http://www.alcyone.com/max/
    __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
    / \ Forever we / Infinitely
    \__/ Sandra St. Victor
    Erik Guest

  9. #9

    Default Re: how to send control-break or ctrl-c signal to background process?

    Rich Teer wrote: 

    Rich, I know the plethora of doentation available out there is maybe
    a tad under-utilised on this occasion, but don't be too hard on him ;^)

    Beardy Guest

Similar Threads

  1. Undoing "Break apart" (ctrl-B)
    By Toby in forum Macromedia Flash
    Replies: 5
    Last Post: May 3rd, 07:59 AM
  2. How can I send a break to a remote machine?
    By sbriet@hotmail.com in forum Sun Solaris
    Replies: 13
    Last Post: September 29th, 05:55 PM
  3. send "Ctrl ]" to the remote system
    By SebMuller in forum PERL Modules
    Replies: 4
    Last Post: September 4th, 12:12 PM
  4. Replies: 1
    Last Post: July 21st, 07:15 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139