Terminal Kill reopens app

Joined
Jan 16, 2011
Messages
6
Reaction score
0
Points
1
Location
London UK
Your Mac's Specs
MacBook Pro 2.53 Intel core 2 duo with 4Gb of Ram Running OSX 10.5 Leopard
Hi there guys,

I'm new here, and also new to the terminal which I am keen to learn.

I have been doing ok with it and am having fun, though I have come across an issue I have not been able to find the answer for with the joys of Google.

Basically, there are certain applications on my mac that reopen if I kill them in terminal. The ones that have don't this so far are Google Chrome, Mac's own mail app, and the preview app.

basically I have tried 3 different ones so far and am a little flummoxed.

I tried these commands so far and don't want to proceed without some input.

Kill -9 (pid) App reopened
kill -15 (pid) App reopened
kill -3 (pid) App closed, though error message of Application closed unexpectedly.

I am literally just using the terminal from open, I have not changed to any root or anything, as I am just getting to grips with moving, renaming files, opening things and trying to close them.

Any feedback here would be very appreciated.

Kind regards

Jonny
 
Joined
Oct 22, 2010
Messages
2,571
Reaction score
79
Points
48
Location
Bretforton, Worcestershire
Your Mac's Specs
MacBook Pro 15" 2014, 2.2GHz i7, 16GB RAM, 250GB SSD, OSX 10.9.5 - iPhone 5s 16gb
Try using the "sudo" command at the beginning of the command. i.e "sudo Kill..."

- Simon
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
How exactly are you doing this? How are you getting the PIDs? For the sake of testing this, I just tried it here and it worked as you'd expect with the 9 and 15 switch (app closed and stayed that way).


Try using the "sudo" command at the beginning of the command. i.e "sudo Kill..."

- Simon
Not needed. You don't need root privileges to kill processes started by the user.
 
Joined
Oct 22, 2010
Messages
2,571
Reaction score
79
Points
48
Location
Bretforton, Worcestershire
Your Mac's Specs
MacBook Pro 15" 2014, 2.2GHz i7, 16GB RAM, 250GB SSD, OSX 10.9.5 - iPhone 5s 16gb
It was a long shot, just I can't think of a reason it will be re-opening the apps. Some Googling is required I think... lol

- Simon
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Have you tried using killall instead of kill to end the process? I'm not sure if that will make a difference but it's worth a shot. Note that killall uses process names and not PIDs. For instance, to kill Preview, you would do the following:
Code:
killall -9 Preview
 
OP
J
Joined
Jan 16, 2011
Messages
6
Reaction score
0
Points
1
Location
London UK
Your Mac's Specs
MacBook Pro 2.53 Intel core 2 duo with 4Gb of Ram Running OSX 10.5 Leopard
Oh wow, thanks for the quick replies, I posted a similar question on a different forum, yesterday, but still no one has replied.

Right ok, I found the pid's from using the command:

ps -e

and I also tried

ps -ax

They appear to do the same thing that is list all running processes.

Right now, I have just done this again so I could take a screen shot and it all worked perfectly.

I think I have found the problem. A while ago, I installed visor for the terminal, cos it looked cool et al. For those not familiar, it is a plug in that means you can open and close a terminal window using a hot key, and it just pops down from the top of the screen in a slightly sci fi school boy fantasy way, and it is when I do these things in the visor terminal window that this happens. I just did this on the most stubborn one to date which was the Preview app, whilst in an actual Terminal window, and it would open and close happily.

Thank you for your time, I hope this might help someone else new to the ways of the command line.

I think I will disable visor for the time being until I know why the behaviour.

Kind regards

Jonny
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top