Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 17 Apr 2014, 23:10
All times are UTC - 4
 Forum index » House Training » Beginners Help ( Start Here)
How to kill hidden firefox?(Solved)
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
kent41


Joined: 26 Nov 2006
Posts: 242

PostPosted: Sat 12 Mar 2011, 16:05    Post subject:  How to kill hidden firefox?(Solved)
Subject description: can not open new copy of firefox
 

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

_________________
Toshiba M35X S-111 - Aspire 5100-3357 using puppy 2.12 - 2.13 - 2.14 - 4.3.1 -
Bootable CD and no hard drive

Acer Aspire 1 netbook using thumbdrive or CD

Last edited by kent41 on Mon 14 Mar 2011, 11:58; edited 1 time in total
Back to top
View user's profile Send private message 
rokytnji


Joined: 20 Jan 2009
Posts: 1130
Location: Pecos/ Texas

PostPosted: Sat 12 Mar 2011, 17:01    Post subject:  

You can try

Code:
kill -9 firefox-bin


and see if Firefox will open after that that command.
Back to top
View user's profile Send private message Visit poster's website 
Makoto


Joined: 03 Sep 2009
Posts: 1722
Location: Out wandering... maybe.

PostPosted: Sat 12 Mar 2011, 17:21    Post subject:  

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 | 1GB RAM | 1.3GB swap ] * My Pidgin Builds for Puppy 4.3.1+
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
Back to top
View user's profile Send private message 
RetroTechGuy


Joined: 15 Dec 2009
Posts: 2635
Location: USA

PostPosted: Sun 13 Mar 2011, 00:23    Post subject: Re: How to kill hidden firefox
Subject description: can not open new copy of firefox
 

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:
ps | grep firefox


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

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


Now enter:

Code:
kill -9 14766


(Note: "-9" means "Kill it, and I mean RIGHT NOW!!!")

_________________
Wellminded Search
Add swapfile
Back to top
View user's profile Send private message 
kent41


Joined: 26 Nov 2006
Posts: 242

PostPosted: Sun 13 Mar 2011, 01:15    Post subject:  

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

_________________
Toshiba M35X S-111 - Aspire 5100-3357 using puppy 2.12 - 2.13 - 2.14 - 4.3.1 -
Bootable CD and no hard drive

Acer Aspire 1 netbook using thumbdrive or CD
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11049
Location: The Peoples Republic of California

PostPosted: Sun 13 Mar 2011, 04:30    Post subject:  

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:
#!/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.

~
killfox-fixed.zip
Description  Updated replacement for killfox.zip. Contents: killfox script
zip

 Download 
Filename  killfox-fixed.zip 
Filesize  437 Bytes 
Downloaded  113 Time(s) 

_________________
New! Puppy Linux Links Page

Last edited by Bruce B on Mon 14 Mar 2011, 08:27; edited 4 times in total
Back to top
View user's profile Send private message 
Moose On The Loose


Joined: 24 Feb 2011
Posts: 478

PostPosted: Sun 13 Mar 2011, 13:36    Post subject:  

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:

# 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.
Back to top
View user's profile Send private message 
kent41


Joined: 26 Nov 2006
Posts: 242

PostPosted: Sun 13 Mar 2011, 20:52    Post subject:  

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.

_________________
Toshiba M35X S-111 - Aspire 5100-3357 using puppy 2.12 - 2.13 - 2.14 - 4.3.1 -
Bootable CD and no hard drive

Acer Aspire 1 netbook using thumbdrive or CD
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11049
Location: The Peoples Republic of California

PostPosted: Mon 14 Mar 2011, 05:41    Post subject:  

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:

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


~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
don922

Joined: 19 Jan 2008
Posts: 375
Location: The land of 14" monitors

PostPosted: Mon 14 Mar 2011, 06:36    Post subject:  

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!

_________________
Don -- Thailand


Last edited by don922 on Mon 14 Mar 2011, 07:03; edited 1 time in total
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11049
Location: The Peoples Republic of California

PostPosted: Mon 14 Mar 2011, 06:57    Post subject:  

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.

~

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11049
Location: The Peoples Republic of California

PostPosted: Mon 14 Mar 2011, 08:11    Post subject:  

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.

_________________
New! Puppy Linux Links Page
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Beginners Help ( Start Here)
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0768s ][ Queries: 12 (0.0080s) ][ GZIP on ]