Bug 437596 - Firefox needs to register proper name for session restore
Firefox needs to register proper name for session restore
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: firefox (Show other bugs)
10
All Linux
medium Severity medium
: ---
: ---
Assigned To: Martin Stransky
Fedora Extras Quality Assurance
: Reopened
: 448895 452200 474871 477276 489641 495316 502865 505929 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-14 22:52 EDT by Orion Poplawski
Modified: 2009-08-06 09:10 EDT (History)
17 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-08-06 09:10:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
KDE Software Compilation 167373 None None None Never
Mozilla Foundation 453689 None None None Never

  None (edit)
Description Orion Poplawski 2008-03-14 22:52:14 EDT
Description of problem:

Moved an existing user to a freshly installed rawhide system.  about:plugins was
blank until I ran  mozilla-plugin-config -f -c and then mozilla-plugin-config
-l.   Why does this work without this?  Anything else I can do to help debug?


Version-Release number of selected component (if applicable):
firefox-3.0-0.40.cvs20080312.fc9.i386
Comment 1 Matěj Cepl 2008-03-17 11:59:16 EDT
Did you MOVE the original ~/.mozilla folder from the old system, or did you
start with the fresh (empty) ~/.mozilla?
Comment 2 Orion Poplawski 2008-03-17 12:11:04 EDT
Well, what I'm doing is backing up my home directory, installing the OS, then
restoring by home directory.  Essentially doing an upgrade.  So I'm not starting
with an empty .mozilla.
Comment 3 Matěj Cepl 2008-03-17 13:23:35 EDT
I am afraid, that you just have to ask your sysadmin (which is probably you as
well, right ;-)) to run mozilla-plugin-config -f -c
Comment 4 Orion Poplawski 2008-03-17 13:37:09 EDT
*really* ?  This seems incredibly broken.  What if I were to put
mozilla-plugin-config -f -c into the login scripts?
Comment 5 Matěj Cepl 2008-03-18 09:39:00 EDT
I don't see any problem with that. Your point?
Comment 6 Martin Stransky 2008-03-25 10:15:28 EDT
mozilla-plugin-config -f -c is called when firefox starts. You don't have to run
it by hand.
Comment 7 Orion Poplawski 2008-03-25 11:49:46 EDT
I know what the problem is - my KDE session starts firefox automatically, but
that startup does not trigger a mozilla-plugin-config run.  This is because the
restart command gets registered in .kde/share/config/ksmserverrc as:

restartCommand3=/usr/lib/firefox-3.0b5pre/firefox,--sm-config-prefix,/firefox-ce8bf1/,--sm-client-id,10626f6e61000120645951400000155330012,--screen,0

This problem was fixed somewhere along the line in previous versions of
firefox/KDE to register the startup command as "firefox" so that the shell
wrapper gets run properly.
Comment 8 Matěj Cepl 2008-03-25 13:27:59 EDT
So, here it goes to KDE folks.
Comment 9 Kevin Kofler 2008-03-25 14:16:57 EDT
What can we do in KDE about that? How is the KDE session manager supposed to 
know that /usr/lib/firefox-3.0b5pre/firefox shouldn't be invoked directly? As 
far as it's concerned, that's the executable which is being run.
Comment 10 Rex Dieter 2008-03-25 14:30:04 EDT
highlights that firefox packaging not using (unversioned) /usr/lib/firefox/ is
(at least a little) crack.
Comment 11 Orion Poplawski 2008-03-25 15:25:50 EDT
I disagree with the re-assignment to KDE.  firefox needs to register the proper
restart command with the session manager.  I remember that this was broken for a
while in the early Fedora days, but was fixed.  On F-8 the restart command in
ksmserverrc is "firefox", so it ends up running /usr/bin/firefox.
Comment 12 Christopher Aillon 2008-03-25 16:24:32 EDT
It working in F-8 is probably just luck.  I don't believe there was ever a fix
done for this, but I could be wrong.

In any case, I'm not familiar with what firefox needs to do in order for KDE to
be happy on session restart.  Some guidance would be appreciated.
Comment 13 Orion Poplawski 2008-03-25 18:02:16 EDT
Okay, looks like session management stuff has actually been added to firefox 3
(xulrunner 1.9), and I'm guessing that is what has changed.  See
https://bugzilla.mozilla.org/show_bug.cgi?id=93789 for a bit of history as well.

In xulrunner-1.9/mozilla/toolkit/xre/nsNativeAppSupportUnix.cpp, save_yourself_cb():

    nsCAutoString path;
    char* argv[1];

    // Strip off the -bin suffix to get the shell script we should run; this is
what Breakpad does
    nsCAutoString leafName;
    rv = executablePath->GetNativeLeafName(leafName);
    if (NS_SUCCEEDED(rv) && StringEndsWith(leafName, NS_LITERAL_CSTRING("-bin"))) {
      leafName.SetLength(leafName.Length() - strlen("-bin"));
      executablePath->SetNativeLeafName(leafName);
    }

    executablePath->GetNativePath(path);
    argv[0] = (char*)(path.get());

    gnome_client_set_restart_command(client, 1, argv);


Looks like somewhere along the line, someone decided to add the path to the
command, but this causes the problem.
Comment 14 Kevin Kofler 2008-03-25 18:08:46 EDT
So maybe adding:

if (getenv("KDE_FULL_SESSION"))
  argv[0] = "/usr/bin/firefox"
else {
...
}
gnome_client_set_restart_command(client, 1, argv);

around it is enough to make it work? Or even just replace the whole block with:

argv[0] = "/usr/bin/firefox"
gnome_client_set_restart_command(client, 1, argv);

?
Comment 15 Orion Poplawski 2008-03-25 18:22:50 EDT
I would imagine that having the /usr/lib/firefox.. path would break things under
any desktop, not just KDE.  I just don't think firefox starts up well without
going through the scripts to set the various environment variables (unless
something else is trying to save/restore those - but I don't think so).  I think
"firefox" would be the proper upstream solution (which won't know where it gets
installed), but someone there felt it necessary to add a path for some reason.
Comment 16 Orion Poplawski 2008-03-25 18:41:55 EDT
Path was added because of this bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=262258

There used to be a shell script in the firefox directory called "firefox" that
ran "firefox-bin".  But now "firefox" is the binary itself.  /usr/bin/firefox
calls /usr/lib/firefox<ver>/run-mozilla.sh which runs /usr/lib/firefox<ver>/firefox.

Oh joy.
Comment 17 Bug Zapper 2008-05-14 02:04:25 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 18 Rex Dieter 2008-09-04 10:13:56 EDT
*** Bug 455975 has been marked as a duplicate of this bug. ***
Comment 19 Rex Dieter 2008-09-04 10:15:46 EDT
*** Bug 448895 has been marked as a duplicate of this bug. ***
Comment 20 Rex Dieter 2008-09-04 10:17:11 EDT
kde upstream has been notified of this issue too, http://bugs.kde.org/167373
Comment 21 Rex Dieter 2008-10-24 14:02:39 EDT
*** Bug 452200 has been marked as a duplicate of this bug. ***
Comment 22 Matěj Cepl 2008-12-05 16:20:34 EST
Bug 474871 is a reproducer for F10.
Comment 23 Matěj Cepl 2008-12-05 16:21:08 EST
*** Bug 474871 has been marked as a duplicate of this bug. ***
Comment 24 Matěj Cepl 2008-12-20 08:41:30 EST
*** Bug 477276 has been marked as a duplicate of this bug. ***
Comment 25 Roderick Johnstone 2009-01-06 09:54:20 EST
As far as I can see nothing has happened upstream as in #20. Last comment there posted July 2008. I have put a comment on  http://bugs.kde.org/167373
Comment 26 Matěj Cepl 2009-02-06 17:19:15 EST
*** Bug 484456 has been marked as a duplicate of this bug. ***
Comment 27 Matěj Cepl 2009-04-15 00:51:40 EDT
*** Bug 495316 has been marked as a duplicate of this bug. ***
Comment 28 ruslan 2009-04-28 01:08:35 EDT
Rawhide,

firefox-3.1-0.11.beta3.fc11.i586,

KDE-4.2.2

If firefox starts when start my session kde, then now it work flash.
Thanks. Good work!
Comment 29 Matěj Cepl 2009-05-27 17:06:29 EDT
*** Bug 502865 has been marked as a duplicate of this bug. ***
Comment 30 Matěj Cepl 2009-06-17 15:25:35 EDT
*** Bug 502865 has been marked as a duplicate of this bug. ***
Comment 31 Matěj Cepl 2009-06-17 15:28:49 EDT
*** Bug 502865 has been marked as a duplicate of this bug. ***
Comment 32 Oliver Henshaw 2009-07-23 13:33:34 EDT
If I read the upstream bug correctly, the fix isn't actually in firefox yet - right? For whatever reason, the flash plugin now always works on session restore on F11. But nspluginwrapper doesn't always work - sometimes flash is running in-process, sometimes in npviewer.bin.

$ grep firefox .kde/share/config/ksmserverrc
program6=firefox
restartCommand6=/usr/lib/firefox-3.5/firefox,--sm-config-prefix,/firefox-675RhC/,--sm-client-id,10d6dd7374000124818871600000019730025,--screen,0

Also, since updating to F11, I often see "Firefox is having trouble recovering your windows and tabs. This is usually caused by a recently opened web page." on session restore. If I confirm "Restore", firefox  appears to successfully bring up all tabs in all windows.
Comment 33 Martin Stransky 2009-07-23 14:50:06 EDT
The fix has been committed to a firefox devel branch and I've asked for inclusion to 3.5.x line.
Comment 34 Martin Stransky 2009-07-23 14:51:20 EDT
Anyway, reopened as we need to fix our part in /usr/bin/firefox launcher script.
Comment 35 Martin Stransky 2009-08-06 09:03:24 EDT
*** Bug 489641 has been marked as a duplicate of this bug. ***
Comment 36 Martin Stransky 2009-08-06 09:03:39 EDT
*** Bug 505929 has been marked as a duplicate of this bug. ***
Comment 37 Martin Stransky 2009-08-06 09:10:57 EDT
Fix added to firefox-3.5.2-3.fc11 & firefox-3.5.2-2.fc12.

Note You need to log in before you can comment on or make changes to this bug.