postiffm/bibledit-desktop

Bibledit already running detection doesn't work well

Closed this issue · 19 comments

It assumes any process with bibledit in it's command line is bibledit-gtk. This means that it can't be directly started with gdb src/bibledit-gtk as it will detect gdb as another instance of bibledit. As a temporary workaround, you can do ln -s src/bibledit-gtk run and then gdb run.

Edit: it's been noted that --debug bypasses this check.

You can run bibledit with the --debug command line argument, or
  within gdb, do 

    set args --debug.


On 6/24/2016 4:07 PM, Lee Bousfield
  wrote:


  It assumes any process with bibledit in it's command line is
    bibledit-gtk. This means that it can't be directly started with
    gdb src/bibledit-gtk as it will detect gdb as
    another instance of bibledit. As a temporary workaround, you can
    do ln -s src/bibledit-gtk run and then gdb
      run.
  —
    You are receiving this because you are subscribed to this
    thread.
    Reply to this email directly, view
      it on GitHub, or mute
      the thread.

I missed that, --debug skips the already running check. Going to leave this open though because the root cause is still there.

I must have missed the original bug report. I don't get what the
  bug is.


On 6/24/2016 4:23 PM, Lee Bousfield
  wrote:


  I missed that, --debug skips the already running
    check. Going to leave this open though because the root cause is
    still there.
  —
    You are receiving this because you commented.
    Reply to this email directly, view
      it on GitHub, or mute
      the thread.

@postiffm If any process is passed an option containing bibledit-gtk, bibledit-gtk won't start because it thinks that process is another instance of bibledit. For instance, if you start some-script bibledit-gtk and leave it running, bibledit will refuse to open. This can be a problem if you start bibledit-gtk with a wrapper, (e.g. sh -c bibledit-gtk) as it detects the wrapper as another copy of bibledit.

Right on. It has been this way ever since I started looking at
  bibledit. Thanks for noting the bug for a future fix.


On 6/24/2016 4:58 PM, Lee Bousfield
  wrote:


  @postiffm If any process is passed an
    option containing bibledit-gtk, bibledit-gtk won't
    start because it thinks that process is another instance of
    bibledit. For instance, if you start some-script
      bibledit-gtk and leave it running, bibledit will refuse
    to open. This can be a problem if you start bibledit-gtk with a
    wrapper, e.g. sh -c bibledit as it detects the
    wrapper as another copy of bibledit.
  —
    You are receiving this because you were mentioned.
    Reply to this email directly, view
      it on GitHub, or mute
      the thread.

This will likely be fixed as part of the gtk3 migration, in which eventually we will use the new GtkApplication code. That has handling for single instances built in.

True but we must be careful because this feature of GtkApplication can be easily overridden with GNOME Tweak Tool: click Extensions > Launch new instance > turn it on > done. We will need an additional check like a secondary dbus channel etc. But it does not mean we should not use GtkApplication features.

I'm not sure if my problem is the same, but often if I try to execute BB, I have this error:
bb-already_executing
This says that BB is already running, but it isn't. If I run:

bibledit-desktop --debug

Then it works.
The last sentence in the terminal when I run bb without debug is:
T1859385920 Command: ps ax

This bug is really annoying!! It seems to be more present.
Is it possible to work on it?

This "feature" is meant to protect you from running multiple copies of the application because they may make conflicting changes to your .bibledit-desktop directory. Can you make sure that you are not running another copy?

ps -all | grep bibledit
0 S 1000 35347 124428 4 80 0 .... bibledit-desktop
The fourth column is the process id, also called PID.

If you find a process running which you don't know about, you can kill it. Figure out the PID first.

Then do

kill -9 PID
like this
kill -9 35347

Let me know if this helped. If not, perhaps there is another bug in how it determines if itself is already running.

@LAfricain can you explain how you are running into this problem? Are you running another script that has bibledit-desktop in the name?

ps -all | grep bibledit
cyrille@W54:~$ 

You can see nothing is running.

Are you running another script that has bibledit-desktop in the name?

I thought to bibleditserver from bibledit-cloud. I kill it but the problem is still there.

There has got to be something else. I'm thinking of a solution that other programs use...but it will have other side effects. Like, if you kill bibledit or it crashes, it will require you to remove a lock file in .bibledit.

I don't know if it is linked, but my shortcut (bibledit-desktop.desktop) when I search for software in the Unity dash on Ubuntu 18.04, git me a strange name of an old project, but I remove all about bibledit and reinstall the last version. See the shortcut:
shortcut

About the problem of bb is already running. After reboot computer I don't have it again. But I'm sure it will come again.

Try pulling the f87e1f1 latest commit and build. I think it will behave better for you. Let me know.

It seems to work well... I will still test few weeks. But I have still this strange shortcuts :(

I have no idea about that shortcut.

@LAfricain, Are things still working well with the detection of a previous copy of the program?

Yes, till now everything is ok. Sometime I need just to remove the file in the .bibledit folder.