Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Chrome 35 on Linux - Java plug-in not working

Today Google demonstrates to us how not to update critical platform software: the latest stable version 35.0.1916.114 contains "a number of fixes and improvements", one of them being dropped support for Oracle's Java plug-in on Linux, as a consequence of discontinuing support for the prerequisite NPAPI (one wonders whether it has anything to do with the ongoing Google vs. Oracle case).

After installing the new version there is absolutely no notification to the user that this functionality, which is essential for some applications (e.g. online banking and some enterprise applications), is no longer available. Although the plug-in symlink is present in the correct location and it wouldn't be difficult to alert about incompatibility, it simply doesn't appear in the about:plugins list. For sure hundreds of hours will be wasted in sum by users trying to troubleshoot this issue on their and following outdated instructions. As of 2014-05-21, there is no replacement Java plug-in for Chrome 35 on Linux available.

For more information see this discussion thread.

Solution for mount fails with "No such file or directory"

If you find yourself stuck in an initramfs Busybox shell, trying to manually mount the root filesystem (using a command such as mount /dev/mapper/yourrootfs /root) and getting a confusing "No such file or directory" message in response, then check whether the appropriate kernel module for your filesystem type is loaded (i.e. run "lsmod"). Something as simple as "modprobe ext2" before the mount command might be the entire solution you need (it was for me today, in context of an interrupted Debian dist-upgrade from squeeze to wheezy)!

Solution for GSS-API major_status:00090000, minor_status:861b6d0c

Problem: You are trying to configure mod_auth_kerb to work with Active Directory. You have created the technical user account "yourserver" for HTTP service in AD and associated it with the Kerberos SPN HTTP/your.server.com@YOURDOMAIN.COM using ktpass.exe. When accessing the page which requires Kerberos auth with IE, you see the following error messages in Apache error log (after raising LogLevel to debug):
[client nnn.nnn.nnn.nnn] Warning: received token seems to be NTLM, which isn't supported by the Kerberos module. Check your IE configuration.
src/mod_auth_kerb.c(1101): [client nnn.nnn.nnn.nnn] GSS-API major_status:00090000, minor_status:861b6d0c
[client nnn.nnn.nnn.nnn] gss_accept_sec_context() failed: A token was invalid (, Unknown code)
You have checked your IE (or Firefox) configuration and are pretty sure that the browser should be sending a Kerberos ticket instead of attempting NTLM authentication.

Solution: First apply some more diagnostics:
  1. Check if the command
    kvno HTTP/your.server.com@YOURDOMAIN.COM
    gives you this message: "HTTP/your.server.com@YOURDOMAIN.COM: Server not found in Kerberos database while getting credentials". If yes, you likely have the problem described here.
  2. On the Windows AD server check the output of setspn -l yourserver. Does it appear like so?
    Registered ServicePrincipalNames for CN=yoursever,OU=Service Accounts,OU=Accounts,DC=yourdomain,DC=com:
            HTTP/your.server.com@YOURDOMAIN.COM
    If yes, then you likely have the problem described here. The domain suffix highlighted in red should not appear in the command's output in a correct configuration.
To fix the incorrect SPN association, use the following commands on AD server:
setspn -d HTTP/your.server.com@YOURDOMAIN.COM yourserver
setspn -A HTTP/your.server.com yourserver

Solution for GSS-API major_status:000d0000, minor_status:96c73ae6

Problem: You are trying to configure mod_auth_kerb. When you access a page that requires Kerberos auth with IE, a popup asking for password appears. In Apache error log (after raising LogLevel to debug), you can see the following messages appearing:
[debug] src/mod_auth_kerb.c(1101): [client nnn.nnn.nnn.nnn] GSS-API major_status:000d0000, minor_status:96c73ae6
[error] [client nnn.nnn.nnn.nnn] gss_accept_sec_context() failed: Miscellaneous failure (, Unknown code)
Solution: Check that the kvno (key version number) stored in your keytab matches the kvno reported by the kvno command. You can view kvno from keytab using
klist -Kekt /path/to/keytab
Compare this against
kvno HTTP/your.server.com
The kvno command only works after a successful authentication with kinit. You can recreate your keytab with the expected kvno (in the example below: 3) using ktutil:
add_entry -password -p HTTP/your.server.com@YOURDOMAIN.COM -k 3 -e RC4-HMAC
wkt /path/to/newkeytab

Solution for "Key table entry not found while getting initial credentials"

Problem (with Kerberos on Debian stable):
kinit -V -k -t /tmp/keytab HTTP/somehost@LOCALDOMAIN
kinit: Key table entry not found while getting initial credentials
However klist -k -t /tmp/keytab works and correctly displays HTTP/somehost@LOCALDOMAIN as present under Principals. The keytab entry was previously created with using addent -password -p HTTP/somehost@LOCALDOMAIN -k 1 -e rc4-hmac.
Solution:
Had to adjust /etc/krb5.conf:
default_tkt_enctypes = arcfour-hmac-md5 des-cbc-crc des-cbc-md5
default_tgs_enctypes = arcfour-hmac-md5 des-cbc-crc des-cbc-md5
Source link

Fix for "No such file or directory" while trying to mount --bind

Problem: The command mount --bind /mnt/data/usr /usr in Linux fails with "No such file directory". /mnt/data is a mount point of a dm-crypt device. strace shows ENOENT for the mount syscall, no other clues. Variants that don't refer to /usr (for example, to /usr2 instead), do work as expected. The same error occurs after and during boot process, so it's not explainable by used files.

Solution: The problem disappeared after upgrading the kernel from 2.6.34 to 2.6.38.8.

Fullscreen Flash Player on Debian lenny

Problem: Flash plugin crashes in Firefox on 64 bit Debian lenny whenever entering fullscreen mode. The console displays an error message like "libflashplayer.so: undefined symbol: gtk_widget_get_window". Both Firefox and Flash plugin were installed manually rather than from a Debian package on the affected system.

Solution: This problem occurs due to an outdated version of 32 bit libgtk2 in Debian lenny (ia32-libs-gtk), which doesn't have the required symbol. As a remedy, you should install 64 bit versions of libgtk2, Firefox and Flash player from Debian packages. However, these packages are not found in lenny repository, so you first need to add the backports repository to your apt (important: also add contrib behind main in the repository definition!) After that, just go ahead with

apt-get -t lenny-backports install flashplugin-nonfree iceweasel libgtk2.0-0

Solution for Selenium RC Firefox startup crash

Problem: A Selenium RC server under Linux starts a Firefox 3 (or 3.5) process, which then crashes immediately. A useless error dialog mentioning Gnome bug-buddy appears, the test script hangs. When started manually, the same version of Firefox works without flaw (including the Selenium IDE add-on).

Solution: (note: this was written for Selenium RC 1.0.1; you may wish to try the most current version (eg. 1.0.3) before troubleshooting)

  1. Check your ~/mozilla/.plugins and remove plug-ins (symlinks) that you don't need. In my case, the Java 1.4.2 Plug-in caused the crash.
  2. If the above doesn't help, gathering more information related to the crash may provide a clue, as described in the following steps.
  3. Write a little wrapper for the firefox script. Save it in /usr/local/firefox/firefoxg or somewhere else:
    #!/bin/sh
    exec /usr/local/firefox/firefox -g $*
    
    If you start Firefox using this wrapper, you will notice that instead of the browser a debugger opens, in my case, the ddd debugger frontend. You can then launch the executable by typing run in the debugger console. In case of a crash (segmentation fault), you will see a stack trace which may contain interesting clues.
  4. Update your Selenium RC test script to reference the wrapper, e.g. browser => "*firefox /usr/local/firefox/firefoxg".
  5. In the shell where you launch the Selenium RC server, set the environment variable GNOME_DISABLE_CRASH_DIALOG=1, so that Gnome bug-buddy doesn't bother you on crash.
  6. Go ahead and start the test script. The debugger will open. Actually, two instances of the debugger will open, the second one only after the first one is terminated. Type run in the debugger console to continue execution in each case. In my environment the first instance just crashed gdb. However, the second instance produced a backtrace which helped to put blame on the Java plug-in as shown below:

Renaming rausb0 to wlan0

Problem:When a USB wireless device using the rt73 driver is plugged in under Linux, it appears (e.g. in ifconfig) as rausb0 rather than the more familiar device name wlan0.
Solution:Add the following line to your /etc/udev/rules.d/70-persistent-net.rules in order to rename the device:
ACTION=="add", KERNEL=="rausb0", NAME="wlan0"

To diagnose this sort of problems, launch udevadm monitor before running modprobe rt73. The correct output of udevadm monitor while the renaming rule is in effect should look as follows:

UEVENT[1232279287.492254] add      
/module/rt73 (module)
UEVENT[1232279287.494837] add      
/bus/usb/drivers/rt73 (drivers)
UEVENT[1232279287.496842] add      
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1:1.0/rausb0 (net)
UEVENT[1232279287.501910] add      
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1 (firmware)
UDEV  [1232279287.505345] add      
/module/rt73 (module)
UDEV  [1232279287.508952] add      
/bus/usb/drivers/rt73 (drivers)
UDEV  [1232279287.534015] add      
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1:1.0/wlan0 (net)
UEVENT[1232279287.555346] remove   
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1 (firmware)
UDEV  [1232279287.558466] remove   
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1 (firmware)
UDEV  [1232279287.561163] add      
/devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1 (firmware)

ModeLine ignored by xorg display driver

In the recent past, I used to switch screen resolutions in XFree/X.org by pressing the CTRL-ALT-minus or CTRL-ALT-plus keys. For each supported mode, there used to be a ModeLine entry in xorg.conf and those entries were referenced by the "Screen" section. As often happens when technology "advances", on my new Dell D830 notebook (using xorg 1:7.3+18 from Debian 'testing', GM965/GM960 graphics controller, 'intel' display driver), this tried and true method no longer works. The magic key combo is ignored altogether, as is adding ModeLines to xorg.conf. No warnings in /var/log/Xorg.0.log nor anywhere else are recorded, AFAICS. The standard xorg.conf seems almost empty, which in itself is a good thing (less configuration means less opportunity for mistakes). The bad thing, obviously, is that invalid or deprecated (?) configuration entries are silently skipped without a clue for the user about what is going on inside the black box, whether its behavior is normal or not, and which alternatives might be available. This is an example of what I like to call an "observability" problem. Sometimes a careless implementation is to blame, but such problems may also have their roots in software designers' inability to correctly foresee and specify the possible variance in implementations.

Fortunately, there is an easy solution to ignored ModeLines. xorg includes a program called xrandr, which can be used to test and programmatically set a resolution, as described in the Ubuntu Wiki article X/Config/Resolution. This seems to be a substitute for the traditional ModeLines in xorg.conf. Although the Wiki article mentions that xorg.conf can still be used for specifying resolutions, this is simply not the case in my setup.

Multi-boot configuration for Vista, Windows XP, Linux

I bought my (Dell) notebook with Windows Vista preinstalled. Because some of my customers stay loyal to Windows XP and I prefer Linux for flexibility, I wanted to also install both of these OSes on the same disk, so as to have a choice of each operating system through the GRUB boot menu (Linux being the dominant OS and the other two secondary choices). This article contains a record of my installation with some warnings and explanations mixed in, unlike those "easy" HOWTOs that omit the gory details and leave you wanting if anything goes wrong in the process or your preconditions differ slightly.

First of all, it is important to note that the final configuration which I settled upon does not include all three OSes within a single GRUB boot menu. Instead, the menu contains two categories of items: Linux (one item per kernel configuration) and Windows (just one item for booting either Windows XP or Vista). The Windows menu item instructs GRUB to delegate control to Vista's own boot loader, which then offers a second choice between Vista and XP.

The entry for the Windows menu item in /boot/grub/menu.lst is trivial:

title           Windows Vista/XP
root            (hd0,2)
savedefault
makeactive
chainloader     +1

The partition table in the final configuration looks as follows - (hd0,2) in GRUB-speak refers to /dev/sda3:

  Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          23      184716   de  Dell Utility
/dev/sda2              24        1069     8401995    7  HPFS/NTFS
/dev/sda3   *        1070        7494    51602432    7  HPFS/NTFS
/dev/sda4            7495       29863   179678992+   5  Extended
/dev/sda5   *        7495        9925    19526976   83  Linux
/dev/sda6            9926       10411     3903763+  82  Linux swap / Solaris
/dev/sda7           10412       29863   156248158+  83  Linux

/dev/sda1"Diagnostics" partition; this is a small FAT16 partition preinstalled by Dell. It contains programs for testing memory etc.
/dev/sda2The Windows XP partition; originally the same block range used to hold a ~10 GB "recovery" partition, which was apparently too small for Vista for its intended purpose.
/dev/sda3The Windows Vista partition; originally it occupied the rest of disk and had to be shrunk to make room for Linux.
/dev/sda4The extended partition which holds /dev/sda5, /dev/sda6, /dev/sda7. It is very important to create this partition because any disk can only hold 4 primary partitions. If you forget this little quirk, you will likely end up with large amounts of unpartitioned (that is, unusable) disk space.
/dev/sda5The Linux boot/root partition.
/dev/sda6The Linux swap partition.
/dev/sda7The Linux "data" partition, which in my case holds an encrypted file system for /home and /usr/local (not quite relevant)

The non-trivial part of the setup concerns the order of installation and the steps required to make both boot managers work correctly. The same approach might be used to install in a different order. The key piece of information to keep in mind is which step overwrites which boot records.

  1. Before installing anything, I made snapshots of the Master Boot Record (/dev/sda) as well as of each partition's initial sectors using a Knoppix CD. After booting from the CD, I issued commands like dd if=/dev/sda1 of=/path/to/sda1/backup/file bs=512 count=32 for each partition and the main MBR. To store the backup files, I used the /dev/sda1 "diagnostics" partition. A USB stick could be used just as well. I heuristically chose to back up the first 32 sectors of each partition, not being sure how many of them really need to be protected. This number has later turned out sufficient.
  2. I began by resizing Vista's own partition using Vista's disk management tool. It didn't allow me to go below 50 GB. I used the same tool to delete the /dev/sda2 "recovery" partition in order to create a gap for installing Windows XP. (By the way, an attempt to use the Partition Magic tool to scale down Windows XP below 40 GB and move it to the beginning of disk resulted in an unbootable system; now I believe PM can't deal at all with Vista.)
  3. I installed Windows XP, creating a new partition for it during the installation process. Actually, I had to first create a custom Windows XP installation CD based on the original one, in order to include some missing SATA disk drivers. The Windows XP installer did not just alter the MBR, but it also overwrote the beginning of the Vista's /dev/sda3 partition. Accordingly, I was unable to boot Vista after this step (instead Windows XP booted itself).
  4. Using the Knoppix CD, I created another set of boot sector backup files (just in case; those were not used later on).
  5. I proceeded to install Linux (Debian), taking care to use the "expert mode" to create an extended partition. (It later turned out that fdisk is too dumb to expand this partition in order to accommodate new logical partitions; I recommend cfdisk instead.)
  6. At this point, I had a configuration which booted Linux, and (if I recall correctly) Windows XP, based on an entry in GRUB's menu.lst created by the installer - the same entry I pasted in the beginning of this post.
  7. Having booted into Linux, I created another set of boot sector backup files (again, just in case).
  8. The really interesting part begins now. To "revive" Vista's boot loader, I restored with dd the 16KB backup of Vista's partition I made in Step 1. This left me being able to boot Linux and Vista, but not Windows XP. (It is noteworthy that partition numbering changes when you delete a partition. For example, /dev/sda1, /dev/sda2, /dev/sda3 became /dev/sda1, /dev/sda2 after deleting the "recovery" /dev/sda2 partition. The original ordering was restored after installing Windows XP into /dev/sda2, though.)
  9. In Vista, I installed the free EasyBCD tool, which lets you edit Vista's own boot loader entries. Here I added a "Windows XP" menu entry and pointed it to the partition with Windows XP (which is called D: from Vista's own perspective).
  10. At this stage, my attempts to boot into Windows XP using Vista's boot loader failed with an error message about missing NTLDR. To fix this, following advice from the EasyBCD forum, I booted into Vista and copied c:\ntldr.dll to Windows XP's d:\ntldr.dll (where it was, in fact, missing). In order to see the file c:\ntldr.dll in Vista, I had to tweak some settings regarding displaying hidden and system files.

Having completed all of the above steps, I was able to boot all three OSes - Linux directly using GRUB, and the two versions of Windows by redirecting GRUB into Vista's boot loader. It might not be the nicest possible configuration (requires a few extra key strokes during the boot process), but it works.

Solution for Gtk-WARNING **: ... : wrong ELF class: ELFCLASS64

(eclipse:13576): Gtk-WARNING **: /usr/lib/gtk-2.0/2.10.0/engines/libbluecurve.so: wrong ELF class: ELFCLASS64

If you get the above error message in a 64 bit Linux system while trying to run a 32 bit application using GTK 2 (like Eclipse), it means that GTK is picking up the wrong (64 bit) version of a plugin library. The first step is, of course, to check that the 32 bit version of the library is available (example location in Debian/Ubuntu; I first extracted the library from the i386 package and moved it to this location):

jpl@debian:~$ file /emul/ia32-linux/usr/lib/gtk-2.0/2.10.0/engines/libbluecurve.so /emul/ia32-linux/usr/lib/gtk-2.0/2.10.0/engines/libbluecurve.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped

Even though the 32 bit version exists and is available in the library search path used by the dynamic linker, GTK insists on using the 64 bit version.

Changing LD_LIBRARY_PATH, adding the particular library to LD_PRELOAD, changing -Djava.library.path do not fix the problem. However, a similar easy solution exists - override the search path by setting the GTK_PATH environment variable in a wrapper script for the 32 bit application in question:

export GTK_PATH=/emul/ia32-linux/usr/lib/gtk-2.0

This issue has been reported as Debian bug 490947 and Ubuntu bug 190227. Reports elsewhere linked it to RealPlayer, however this appears to be a problem with the (packaging of) the GTK2 library, so various applications are affected.