lynx fails to start if ubuntu-docs is not installed

Bug #220080 reported by Mark Warriner
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lynx (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: lynx

The text-based web browser 'lynx', in its default configuration, will fail to start if the ubuntu-docs package is not installed. Often a server installed as a command line system will not have this package installed. Attempts to start the application will produce the following error message after a short delay:

Can't Access `file://localhost/usr/share/ubuntu-artwork/home/index.html'
Alert!: Unable to access document.

Note: The file /usr/share/ubuntu-artwork/home/index.html is a symlink to /etc/alternatives/firefox-homepage, which is managed by the alternatives system, but usually points to /usr/share/ubuntu-artwork/home/firefox-index.html. This makes it difficult to debug this problem, since the original file is not actually supplied by any package, and thus is not returned by any searches on packages.ubuntu.com or with 'auto-apt search'.

I suggest either making ubuntu-docs a dependency for lynx, or if possible, patching or reconfiguring lynx to not exit upon failing to load its configured homepage.

Revision history for this message
Nathan Handler (nhandler) wrote :

I can confirm the bug is valid in lynx 2.8.6-2ubuntu2. You can easily bypass the bug by passing lynx a url as an argument. For example, instead of just running "lynx", run "lynx http://ubuntu.com". This keeps lynx from attempting to load the missing homepage, and bypasses the bug. I don't think adding ubuntu-docs as a dependency is the best solution. ubuntu-docs uses over 50 mb. I think it is a little overkill to install a 50 mb package when you only need a small html file. Having lynx not exit when it fails to load the homepage would be nice, but I'm not sure how easy this would be to implement. Most likely, this change would need to come from upstream. Here are some of my ideas:

1) Modify the lynx homepage to point to an actual URL. This would probably be the easiest solution. Lynx would either load the page, or it would display a 404 error if the page became unavailable.

2) Add the .html homepage to the lynx package. This would guarantee that it is available. The downside to this is that if we needed to update the homepage, we would need to update the lynx version and the version provided by ubuntu-docs.

Changed in lynx:
status: New → Confirmed
Revision history for this message
Mark Warriner (warriner) wrote :

You make a very good point about the size of ubuntu-docs.

Similar to option #2, how about instead having the lynx package include an html homepage as a very low priority alternative for /etc/alternatives/firefox-homepage. That way, if and when ubuntu-docs is installed, its supplied homepage will automatically take priority instead of the lynx supplied one.

I am not sure pointing to a real URL is a good idea. I could see some people might complain at this.

Revision history for this message
Nathan Handler (nhandler) wrote :

In order to make lynx know when to use /etc/alternatives/firefox-homepage and when to use the low priority alternative, the source would have to be modified. I don't think these modifications should be done in the form of a patch. If they were to be done, they should be done by the developer. That way, everything would be nice and neat. I'm not sure if the developer would be willing/able to do these changes. That is what lead me to my second option. I also agree with you that my first option isn't the best choice. If the homepage were set to a real URL, you risk presenting users with a 404 error upon starting lynx. I don't think anybody would want that. It also would require a working internet connection, which is not a requirement for lynx.

To recap, I feel the best solution would be for the lynx developer to incorporate a check to see if ubuntu-docs is installed or if /etc/alternatives/firefox-homepage exists (that way, other packages could provide the file as well). If yes, the homepage is set to /etc/alternatives/firefox-homepage. Otherwise, the homepage is set to a small html file provides by lynx. The second best option is to add a small .html homepage file to the lynx package (through a patch), and set the homepage to that file.

Revision history for this message
Nathan Handler (nhandler) wrote :

After examining the lynx package, I have learned a little more about how it handles the homepage. The homepage is specified in lynx.cfg. It is stored in the STARTFILE variable. The homepage only loads if no URL is specified on the command line or in the WWW_HOME environment variable. I also found a patch called "01_default-config.dpatch", which is used to configure the default lynx settings for ubuntu. One thing it does is change the default STARTFILE from "http://lynx.isc.org/" (the default lynx homepage) to "file:///usr/share/ubuntu-artwork/home/index.html" (the default lynx homepage on ubuntu). This makes it very easy to change the default lynx homepage on ubuntu. All we would need to do is modify the dpatch.

Revision history for this message
Mark Warriner (warriner) wrote :

1. I was suggesting that lynx provide, or perhaps better depend on a small package that provides, a low priority alternative for /etc/alternatives/firefox-homepage. We then modify the dpatch to set STARTFILE to point to that file. If ubuntu-docs is installed, then it will point to /usr/share/ubuntu-artwork/home/firefox-index.html and the user will have the same experience as they usually would. If ubuntu-docs is not installed, the link will point to the other homepage instead.

$ update-alternatives --display firefox-homepage
firefox-homepage - status is auto.
 link currently points to /usr/share/ubuntu-artwork/home/firefox-index.html
/usr/share/ubuntu-artwork/home/firefox-index.html - priority 40
 slave firefox-homepage-locales: /usr/share/ubuntu-artwork/home/locales-ubuntu
Current `best' version is /usr/share/ubuntu-artwork/home/firefox-index.html.

2. As another option, we could separate out the homepage from the ubuntu-docs package into another package and make both lynx and ubuntu-docs depend on that.

3. Alternatively, we could make that dpatch change, as you suggest. This is obviously the least effort. As a suggestion, STARTFILE could point to "file:///usr/share/doc/lynx/lynx_help/lynx_help_main.html", which is the same page presented when selecting the (H)elp command in lynx.

Revision history for this message
Nathan Handler (nhandler) wrote :

Creating a small package that provides the .html hompepage wouldn't be too difficult. However, I'm not sure separating the homepage from ubuntu-docs is the best idea. I think we should try and keep the solution within lynx, and try not to modify any additional packages (unless absolutely necessary). As for your third point, I believe some people (either the lynx or ubuntu developers) want the lynx homepage to be ubuntu related. Since we agreed that it should be a locally installed .html file instead of an internet site, we should probably add an .html file lynx. This would cause the problem of maintaining two copies of the homepage (one for lynx, and one for ubuntu-docs), but I think we can handle it. I just had one more idea. If we do package a .html file with lynx, why should we package the one that comes with ubuntu-docs? Why not modify it to be more lynx friendly? I think that would be a nice improvement. We could also modify it so that it doesn't need constant updates. By that, I mean not having it mention gutsy/hardy/intrepid or any other ubuntu codenames. By doing this, we wouldn't be forced to update it with every new ubuntu release.

Revision history for this message
Kees Cook (kees) wrote :

I think splitting the HTML files out of ubuntu-docs makes the most sense (leave the images behind). This keeps everything in one place, doesn't require changing any of the alternatives. Then lynx and ubuntu-doc can both depend on ubuntu-docs-html.

Revision history for this message
Matt Thompson (mattt416) wrote :

I had the same issue on 8.04 (2.8.6-2ubuntu2), which brought me to this bug report. Anyway, I've looked around a bit and can see that lynx on jaunty is marked as a transitional package, to be replaced by lynx-cur. I've since installed lynx-cur out of curiosity (as it's also available on 8.04) and can see that this package does not have the start up issue resulting from the missing HTML document. lynx-cur automatically set the STARTFILE variable to point to my system's domain name (http://`dnsdomainname`/) and if I reconfigure lynx-cur I have the option to point to a different URL or local file.

Revision history for this message
Jeremy Bícha (jbicha) wrote :

From what I can see, no supported Ubuntu release ships a lynx modified to show a Ubuntu home page by default. Therefore, this bug is fixed.

Changed in lynx (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.