How to kill hidden firefox?(Solved)

Booting, installing, newbie
Post Reply
Message
Author
User avatar
kent41
Posts: 242
Joined: Sun 26 Nov 2006, 09:00

How to kill hidden firefox?(Solved)

#1 Post by kent41 »

When I try to open firefox I get a message that firefox is already running and I must kill it or reboot.
I have tried to re-boot but no help. I removed and re-installed firefox and still get message.
I have looked in TOP and do not see firefox running.
I have looked in Pprocess process manager and do not see firefox in there either.

Where else can I look to kill firefox?

I am using puppy 4.3.1 on a 2G usb thumb drive and firefox 3.5.6 on a acer netbook
Last edited by kent41 on Mon 14 Mar 2011, 15:58, edited 1 time in total.
[size=75][color=darkred]Toshiba M35X S-111 - Aspire 5100-3357 using puppy 2.12 - 2.13 - 2.14 - 4.3.1 -
Bootable CD and no hard drive[/color][/size]
Acer Aspire 1 netbook using thumbdrive or CD

rokytnji
Posts: 2262
Joined: Tue 20 Jan 2009, 15:54

#2 Post by rokytnji »

You can try

Code: Select all

kill -9 firefox-bin
and see if Firefox will open after that that command.

User avatar
Makoto
Posts: 1665
Joined: Fri 04 Sep 2009, 01:30
Location: Out wandering... maybe.

#3 Post by Makoto »

Find your Firefox profile directory. It should be ~/.mozilla/firefox/('random' characters), I believe.

In that directory, if there is a file named something like ".lock" and/or ".parent-lock", delete them. Then, try starting Firefox again.
(The files are meant to prevent more than one instance of Firefox from running at a time, basically. However, if FF crashes, the files may not be deleted, and FF will unfortunately think another instance is already running, when there aren't any.)
[ Puppy 4.3.1 JP, Frugal install ] * [ XenialPup 7.5, Frugal install ] * [XenialPup 64 7.5, Frugal install] * [ 4GB RAM | 512MB swap ]
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

Re: How to kill hidden firefox

#4 Post by RetroTechGuy »

kent41 wrote:When I try to open firefox I get a message that firefox is already running and I must kill it or reboot.
I have tried to re-boot but no help. I removed and re-installed firefox and still get message.
I have looked in TOP and do not see firefox running.
I have looked in Pprocess process manager and do not see firefox in there either.

Where else can I look to kill firefox?

I am using puppy 4.3.1 on a 2G usb thumb drive and firefox 3.5.6 on a acer netbook
Open rxvt (command window), and enter:

Code: Select all

ps | grep firefox
Note the "firefox-bin", and the number on the left side, for example (from my machine right now):

Code: Select all

14766 root       0:00 /bin/sh /usr/lib/firefox/run-mozilla.sh /usr/lib/firefox/firefox-bin
Now enter:

Code: Select all

kill -9 14766
(Note: "-9" means "Kill it, and I mean RIGHT NOW!!!")
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
kent41
Posts: 242
Joined: Sun 26 Nov 2006, 09:00

#5 Post by kent41 »

Thanks for all the suggestions however the thumbdrive
seem to have other issues and I found it would be just as easy to re-install.

I deleted the .lock and the .parentlock but that did not help.
I had added lots of changes so now I will have to reload all my changes and updates.

Thanks again
[size=75][color=darkred]Toshiba M35X S-111 - Aspire 5100-3357 using puppy 2.12 - 2.13 - 2.14 - 4.3.1 -
Bootable CD and no hard drive[/color][/size]
Acer Aspire 1 netbook using thumbdrive or CD

Bruce B

#6 Post by Bruce B »

I wrote this script quite quickly and tested it. It seems to work fine. If problems let me know.

First we try and be nice to the ghost app, if that doesn't work, we use
signal 9, the ghost buster.

Code: Select all

#!/bin/bash

### MODIFIED to reflect changes

# first kill gently try up to 12x

while [ x$cnt != x11 ]; do

	id=`pidof -s firefox`

	if [ ! -e $id ] ; then
		kill -s 15 $id
	fi

	idbin=`pidof -s firefox-bin`

	if [ ! -e $idbin ] ; then
		kill -s 15 $idbin
	fi

	cnt=`echo $((cnt + 1))`

done

cnt=0

# test and force kill try up to 8x

while [ x$cnt != x7 ] ; do

	id=`pidof -s firefox`

	if [ ! -e $id ] ; then
		kill -s 9 $id
	fi

	idbin=`pidof -s firefox-bin`

	if [ ! -e $idbin ] ; then
		kill -s 9 $idbin
	fi

	cnt=`echo $((cnt + 1))`

done

# test and report

id=`pidof -s firefox`
idbin=`pidof -s firefox-bin`

if [ -e $id ] && [ -e $idbin ] ; then
	echo "Success, Firefox isn't running"
else
	echo "Sorry, Firefox appears to be running"
fi
Note: All the iterations don't do anything unless there is something to do.
But Firefox has several threads and PIDS.

File attached, unzip it and put in your path, one of the bin directories

File name is killfox

~

EDIT: the -xs switch didn't work with Puppy's BusyBox pidof. I fixed
the downloadable file by replacing the -xs with just -s and it works
fine.

If you downloaded the killfox.zip file, please download killfox-fixed.zip
to replace the script killfox.

Sorry for the inconvenience.

Note - the script requests Firefox to close several times before
forcing it do close. If Firefox closes on request, it will give a normal
shutdown and likely prevent corrupting Cache or configuration files.

~
Attachments
killfox-fixed.zip
Updated replacement for killfox.zip. Contents: killfox script
(437 Bytes) Downloaded 207 times
Last edited by Bruce B on Mon 14 Mar 2011, 12:27, edited 4 times in total.

User avatar
Moose On The Loose
Posts: 965
Joined: Thu 24 Feb 2011, 14:54

#7 Post by Moose On The Loose »

You can make your script a little faster with

# A=$(( 1 + 1 ))
# echo $A
2

instead of using the echo to do it.

You can also use a for loop like:

Code: Select all

# for A in firefox firefox-bin madeup madeupmore ; do
> echo $A
> done
firefox
firefox-bin
madeup
madeupmore
# 
to do more than one program's PID. With seamonkey, I seem to get a total of 3 zombie programs when is crashes. Perhaps with firefox there are only 2.

User avatar
kent41
Posts: 242
Joined: Sun 26 Nov 2006, 09:00

#8 Post by kent41 »

Thanks Bruce I will add the script to my bag of tricks and the next time Firefox acts up I have a bigger hammer.

Kent

EDIT: for some reason I was getting a x error on pidof - I removed the -x and kept the -s and it works ok now.
[size=75][color=darkred]Toshiba M35X S-111 - Aspire 5100-3357 using puppy 2.12 - 2.13 - 2.14 - 4.3.1 -
Bootable CD and no hard drive[/color][/size]
Acer Aspire 1 netbook using thumbdrive or CD

Bruce B

#9 Post by Bruce B »

kent41 wrote:Thanks Bruce I will add the script to my bag of tricks and the next time Firefox acts up I have a bigger hammer.

Kent

EDIT: for some reason I was getting a x error on pidof - I removed the -x and kept the -s and it works ok now.
Two different tools. I used the GNU pidof which supports the -x switch.

-s Single shot - this instructs the program to only return one pid

-x Scripts too - this causes the program to also return process id's of shells running the named scripts

I installed my own Firefox. The name filename firefox is a script. The name firefox-bin is a binary file.

Here is the help for Puppy's pidof - note that -x isn't supported, so
it needs to be removed for that tool. Sorry.

Code: Select all

BusyBox v1.16.2 (2010-06-19 18:02:46 GMT-8) multi-call binary.

Usage: pidof [OPTIONS] [NAME]...

List PIDs of all processes with names that match NAMEs

Options:
        -s      Show only one PID
        -o PID  Omit given pid
                Use %PPID to omit pid of pidof's parent
~

don922
Posts: 433
Joined: Sat 19 Jan 2008, 07:58
Location: Nong Yai Buah

#10 Post by don922 »

I see the title "How to kill hidden firefox"; will it kill a running firefox or only a "hidden firefox"?

I downloaded killfox and installed it in /root/bin. To test it I open FirePup (firefox 1.5.0.12) and ran killfox. Killfox reported "Success, Firefox isn't running". However, nothing changed with firefox it is running as before.

What is going on?

Edit:
Fixed - reread the comments about removing the pidof -x option and everything works right.

Bruce B posted his answer below while I was doing this edit. He must not sleep!
Last edited by don922 on Mon 14 Mar 2011, 11:03, edited 1 time in total.
[color=green][i]Don -- Thailand[/i][/color]
[url=http://www.puppylinux.com][img]http://tinypic.com/4e0tojl.jpg[/img][/url]

Bruce B

#11 Post by Bruce B »

I'm still setting up Puppy 5.20. I think it is because of the x in the
pidof -xs (explained above)

You can remove the -x and make it just -s and try it again. Otherwise, I'll
troubleshoot it for you, if I don't hear back.

~

Bruce B

#12 Post by Bruce B »

don922 wrote: Edit:
Fixed - reread the comments about removing the pidof -x option and
everything works right.
Don,

It was the x as I guess you figured out. I uploaded the fixed script also.

Bruce

Thanks to all for their tips and patience.

Post Reply