nekohayo / specto

Automatically exported from code.google.com/p/specto
0 stars 0 forks source link

Specto thinks it's already running if its process has ended and a new process has taken its older pid #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
$ specto
 8298 ?        00:00:00 azureus
CRITICAL - main.Specto  - Specto is already running!

Specto appears to save a ~/.specto/specto.pid file with the pid of the
specto process that has last run. If a new process has been launched and
has received the pid the old specto process had, specto will refuse to
launch without telling the user why unless it is launched from the command
line.

It seems to me that it would make sense to remove the specto.pid file when
specto is closed, which would prevent this from happening. I've deleted the
file myself and it starts up fine so I can't see any reason to keep it.

Original issue reported on code.google.com by vfi...@gmail.com on 24 Nov 2006 at 10:30

GoogleCodeExporter commented 9 years ago
Indeed, did not think of that at first :) the thing that comes to my mind is 
simply
adding an additional line that removes that specto.pid file when Quit is called 
in
the main module, but it may not be 100% bulletproof (what if Specto crashes? 
what if
X crashes? though the chances of this happening and another program "stealing" 
the
pid before specto starts again are pretty slim).

If you have ideas of a better technique to fix this, they are welcome :]

Original comment by nekoh...@gmail.com on 25 Nov 2006 at 12:07

GoogleCodeExporter commented 9 years ago
I'm not sure, but obviously removing the specto.pid file on exit will reduce the
likelihood of this happening substantially. Perhaps Specto could check the name 
of
the running process with the pid to see if it's Specto and not 'azureus' for 
example,
too.

Original comment by vfi...@gmail.com on 8 Dec 2006 at 1:06

GoogleCodeExporter commented 9 years ago
I fixed this in SVN revision 10, I think. Please test and tell me if it's fixed 
for
you (I have no idea how to test it myself).

Original comment by nekoh...@gmail.com on 8 Dec 2006 at 3:51

GoogleCodeExporter commented 9 years ago
Well, just do a "ps aux", then take a pid that's being used, put it in the 
specto.pid
file, and try to execute specto. I suppose I'll get around to trying it myself 
in a
little bit.

Original comment by vfi...@gmail.com on 8 Dec 2006 at 4:01

GoogleCodeExporter commented 9 years ago
Seems to work for me

Original comment by nekoh...@gmail.com on 8 Dec 2006 at 4:17

GoogleCodeExporter commented 9 years ago
Fair enough, then thanks for being so responsive and working on an application 
that
I've wanted for Linux for a long time

Original comment by vfi...@gmail.com on 8 Dec 2006 at 4:27

GoogleCodeExporter commented 9 years ago
marking as verified since it worked for me and I had no further problem reports 
on
that issue since december

Original comment by nekoh...@gmail.com on 1 Jul 2007 at 2:27

GoogleCodeExporter commented 9 years ago

Original comment by nekoh...@gmail.com on 18 Mar 2008 at 1:56