Application restarts on Kill

Discussion in 'Mac Programming' started by JonnyFrond, Jan 15, 2011.

  1. JonnyFrond macrumors newbie

    Jan 15, 2011
    Hi there guys, I'm new here, so forgive me if i have not got this in the right room.

    Basically, I am learning how to use the command line on the mac, and I have come across a curious thing. Concerning the Kill command.

    I used it to quit the preview app, and it quits and then restarts.

    I have tried these so far

    kill -15 (PID) Application restarted
    kill -9 (PID) Application restarted
    and kill -3 (PID) Error message - Application quit unexpectedly.

    where (PID) is the process code.

    Now I can understand the last one, but I am very curious as to why the other two should make preview quit and then restart straight away.

    To be fair, it is possible that the icon is not quitting at all but just bouncing in the dock, but either way, what could I be doing wrong as concerns this, all other applications close very nicely with:
    kill -15 (PID)

    Kind regards

  2. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    I am unable to reproduce this behavior on 10.6.6. :confused:
  3. foidulus macrumors 6502a

    Jan 15, 2007
    Well first of all the easiest way to tell if it is really relaunching is to see if it gets a new PID. If it doesn't get a new PID then it isn't really restarting. The other is to see if there is some sort of helper daemon running that automatically relaunches it a la Finder. It could very well be there is some other process that is monitoring the Preview pid and automatically relaunching it when it detects it has been killed.

Share This Page