Where did udevmonitor go?

In case you’re looking for the “udevmonitor” program on the Intrepid Ibex version of Ubuntu, it’s changed; use “udevadm monitor” now:

$ udevadm help
Usage: udevadm COMMAND [OPTIONS]
info query sysfs or the udev database
trigger request events from the kernel
settle wait for the event queue to finish
control control the udev daemon
monitor listen to kernel and udev events
test simulation run
version print the version number
help print this help text

It looks like udevmonitor was a symlink, and around April 2008, that symlink was removed. Someone asked about it on the Linux kernel mailing list and received this reply:

All udev tools are in one single binary called “udevadm”, which is
always in /sbin, and not like the old tools spread around in /sbin,
/usr/bin, /usr/sbin. See “man udev” for the reference to udevadm, and
“man udevadm” for the commands, which have been the individual tools
before.

So if you have a USB device that causes a hard freeze of your Linux computer when you plug it in, and you want to run udevmonitor to debug it, use udevadm monitor instead.

Virtual terminals not working? Check your keyboard.

(This is a boring post that I’m writing for people that have this same problem in the future. Just skip it.)

Every good Linux user knows that if you want to drop from X down into a text-based virtual terminal, you can press control-alt-F1 (or any other key up to F6), and control-alt-F7 returns you to the graphical mode. But what if that doesn’t work? In my case, it turned out to be my keyboard. My Microsoft Natural Ergonomic Keyboard 4000 has a key marked “F Lock” and unless that FLock key is activated (the “F” LED should be on), the wrong keystrokes were being sent to my Linux Ubuntu version of Intrepid Ibex. How can you debug this? Well, it took me a while.

After some Googling, here’s how I’d write the flowchart:

Try running “chvt 1” to switch your console to virtual terminal 1.
– If “chvt 1” does not work, you might get the message “Couldnt get a file descriptor referring to the console”. You probably need to be superroot. Once you run as root, that command should work.
– Maybe “chvt 1” fails in some other way. Dude, you’re outside my area of expertise. You could try typing “sudo modprobe vga16fb; sudo modprobe fbcon” . Or you could try typing the command “setupcon” to set up the font and keyboard on the Linux console. Or it’s possible that you need to edit /boot/grub/menu.lst and tweak the vga= setting or remove the “splash” parameter. Or you might want to check your /etc/gdm/gdm.conf file.

– Quick check: you might have the “DontVTSwitch” option set in your /etc/X11/xorg.conf file, which would disable virtual terminal switching.

If running “chvt 1” as superroot does work, then you probably have an issue with your keyboard mappings somehow.
– If you have a Microsoft Natural Ergonomic Keyboard 4000, make sure that the “F-Lock” key near the top-right of the main part of the keyboard is properly engaged. The “F” LED below the keyboard should be on.
– Next, run xev (possibly as root) to see raw xevents as you press keys. This thread helped, where the person said

Recently I tried to switch to VT (console) and I couldn’t – Ctrl+Alt+F1 didn’t work (and they used to couple of weeks ago). I don’t even know where to look for the problem; xev detects KeyRelease XF86_Switch_VT_1 event, /etc/inittab contain getty respawns.

When I ran xev myself, and pressed control-alt-F1, I saw an event like

KeyPress event, serial 38, synthetic NO, window 0x3400001,
root 0x1a6, subw 0x3400002, time 1848943, (42,37), root:(1751,59),
state 0x0, keycode 146 (keysym 0xff6a, Help), same_screen YES,
XLookupString gives 0 bytes:
XmbLookupString gives 0 bytes:
XFilterEvent returns: False

The fact that I saw a “Help” event rather than “XF86_Switch_VT_1” was what made me suspicious. Sure enough, activating the “F-Lock” key then triggered this event:

KeyRelease event, serial 34, synthetic NO, window 0x3400001,
root 0x1a6, subw 0x3400002, time 2873229, (38,51), root:(1747,73),
state 0xc, keycode 67 (keysym 0x1008fe01, XF86_Switch_VT_1), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False

and life was good. You might also consider tweaking xmodmap to return the values you expect. Or you might have a strange XkbModel or XkbLayout setting where switching your keyboard language or layout (e.g. from pc105 to pc104) might help.

Moving the locked top panel in Ubuntu/GNOME

A new version of Ubuntu (Intrepid Ibex) is coming out this week, so I’m trying out the release candidate. Here’s an annoyance I hit and how to solve it. I keep a list of steps to perform after installing Ubuntu, and one of my steps is

Drag the bottommost taskbar/panel to the right and the topmost taskbar/panel to the bottom.

I like my “start menu” at the bottom of the screen like Windows does rather than at the top of the screen like Apple’s Mac OS X does. Dragging the bottom panel to the right works fine, but dragging the top panel to the bottom of the screen didn’t work! So I do what any GNOME user would do: I right-click the panel, select “Properties,” and try to set the Orientation from “Top” to “Bottom” in the General tab. Except I can’t.

Instead, I see the message “Some of these properties are locked down”. So I do a Google search for that exact phrase. There’s not many pages that match that phrase, and most of them are translation pages. Grr. That means that not many people have encountered this problem before. After a little query rejiggering, I search for [gnome panel properties locked down] and find this Ubuntu forum thread in which the person says

It sounds like your gnome-panel is locked down. You can remedy this from gconf-editor. Start it from the quick launch dialogue (ALT+F2) or from the terminal: [with the command] gconf-editor

Once the editor has opened, navigate to “apps” > “panel” > “global”, and uncheck the key called “locked_down”.

Great! That sounds easy. I fire up gconf-editor and navigate to that spot, only to find that apps/panel/global isn’t set to locked_down. Hmm. Maybe there’s another locked_down value that is superseding things somewhere else? I search for locked_down anywhere else in gconf-editor and find something at /schemas/apps/panel/global/locked_down, but the value for that is a “<schema>”, and when I try to edit that, gconf-editor helpfully tells me that “Currently pairs and schemas can’t be edited. This will be changed in a later version.” Grrr. So that schema might be affecting my locked-down panel, but I can’t edit it? This is roughly where I start cursing in my head.

But that’s okay, because I’m a computer science geek. If I have to find a “locked_down” text string in the underlying filesystem, I can do that. I search in all the delightful dot directories in my home directory, and I don’t find any mention of that string. Quick pop quiz: would it be in .dbus, .local, .config, .cache, .gconf, .gconfd, .gnome2, or .gnome2_private? Hey Ubuntu/GNOME developers, do I really need 29 (really!) dot directories after a fresh install?

By the time that I’ve sudo’ed to a root shell and I’m in /etc running “find .* type -f | xargs -i{} grep -i locked_down {}” that’s when I’m cussing out loud. So I take a deep breath, metaphorically step back, and head to the Google again. This time I search for [gnome lock top panel] and the #1 result is this Ubuntu bug which leads me to this GNOME bug.

Browsing those bugs makes it clear what happened. Some non-savvy users with really sensitive touch pads were accidentally dragging their panels all over. The solution was to lock the top panel. I can understand why that decision got made. The discussion on the thread didn’t contain the answer (they were talking about making ALT+drag move the panel and mentioned another discussion about this issue), but it made me rethink what I was doing. GNOME/Ubuntu people were shooting to make accidental drags impossible, but they must have made it possible to drag the panel somehow. So I go back to the panel, right-click on it, and carefully read through the options. Sure enough, there’s an option under the right-click menu: “Allow Panel to be Moved“.

I understand why GNOME or Ubuntu folks decided to lock the top panel: they wanted to avoid accidental click-and-dragging by novice users. And maybe it’s my responsibility to carefully study every new menu when I install a fresh version of Ubuntu, instead of just quickly working through the instructions that I’ve written for myself without scouting out every new option. But if I right-click on a panel and select Properties, it’s pretty utterly useless to tell me “Some of these properties are locked down” without giving me any help on where to unlock the properties. There has got to be some user interface principle that says “Giving people an error message without any pointer on how to fix the error is frustrating.”

Is Intrepid Ibex better in some ways? Absolutely. It identified my display resolution correctly on my Wal-Mart PC that I use as my canary for test driving before I install Ubuntu on an important computer. That’s a first. But for everything that works better in recent versions of Ubuntu, I worry that something else will break. That’s why I predicted that Apple would approach 20% market share this year and not Ubuntu. I still root for Ubuntu and want it to do well, so I’ll keep you posted on what I find as I play with Intrepid Ibex.

Crap. My Ubuntu machine won’t boot

This sucks. On some very rare occasions, when I connect an SD card reader to my Ubuntu machine, it freezes. Normally I just reboot and everything is fine. But this time my Ubuntu machine won’t boot, and it shows a message like

Starting up …
Loading, please wait…
kinit: name_to_dev_t(/dev/disk/by-uuid/bd656dcd-04b4-412f-a880-62a6553bd8b) = sda5(8,5)
kinit: trying to resume from /dev/disk/by-uuid/bd656dcd-04b4-412f-a880-62a6553bd8b
kinit: No resume image, doing normal boot…

Then it hangs forever. Any Ubuntu/Linux gurus have suggestions on how to repair my system so it will boot?

Update: I think the machine is fixed now. Thanks to Sérgio Carvalho and Chris Fleming for the suggestions. It looks like somehow my swap partition got messed up, which affected things when my Linux machine got confused about whether my machine had hibernated. The fix was:

– When the machine boots up, press ‘Esc’ to get to the Grub menu
– Select one of the “recovery mode” options. This will boot you up to a single-user root prompt.
– Run “sudo fdisk /dev/sda” (this assumes that your hard drive is at sda)
– Type “p” to see which hard drive partition is labeled “Linux swap”. In my case the partition was /dev/sda5. Type “q” to exist fdisk.
– Type these commands:

sudo swapoff /dev/sda5
(Use whatever partition was labeled as “Linux swap” in fdisk. For me, this was /dev/sda5)
sudo mkswap /dev/sda5
sudo update-initramfs -u

These commands say “Stop using /dev/sda5 as a swap partition,” then mkswap tells your computer to set up /dev/sda5 as a new/fresh swap partition. Finally, update-initramfs with the -u (update) option will generate an initramfs image. The initramfs image is a gzipped blob of data that the Linux kernel unzips into RAM and then mounts to use as an initial file system.
– Type “reboot” and cross your fingers for your machine to boot up. For me, it rebooted just fine and started working normally.

Thanks to everyone who chimed in with an opinion on this.

Six Annoyances in Hardy Heron Ubuntu

(I’m going to publish this in rough draft format. I want to get the post live while lots of Ubuntu developers are thinking about Intrepid Ibex.)

I’m a huge fan of Ubuntu Linux. I’ve used many flavors of Linux over the years, and Ubuntu is my favorite by far. So it pains me to write this. For my needs, Ubuntu 8.04 (Hardy Heron) is worse than 7.10 (Gutsy Gibbon). I cannot recommend Hardy Heron at this time, and would instead recommend installing 7.10 for the time being. I sincerely hope that Ubuntu/Canonical developers do more work on the “fit and finish” of Intrepid Ibex, because that has always been a strong point in Ubuntu’s favor.

By the way, I’m not alone in my opinion about Hardy Heron. At SuperHappyDevHouse this past weekend I talked with a fellow techie who had Hardy running on his laptop. He agreed that Hardy has had more issues than Gutsy. And this in-depth post by another Ubuntu fan reaches the same conclusion:

The most important question is — do I recommend Ubuntu 8.04? If I were to answer simply ‘yes’ or ‘no’ the answer would be negative. If you need a good system, that ‘just works’, wait a few months before installing Hardy Heron, until it becomes really stable, as the LTS staple suggests.

Even when someone posts a positive review, you see commenters show up with quite a bit of complaints.

What are the issues?

I’ll try to pick out a few examples. Here’s a small one. I like to use the microGUI theme in metacity. Normally I would click System->Preferences->Appearance and select the Theme tab. Then I could drag the microGUI theme from this web page and drop it directly onto the Theme tab. Dragging and dropping themes was a wonderful little trick, but it didn’t work for me in Hardy Heron. Instead, a small dialog box appears and then disappears so quickly that I can’t even see if it has text on it. Update, 11/22/2008: This works in Intrepid Ibex now.

Here’s a big problem. In Ubuntu 7.10, it was trivially easy to share folders via Samba (SMB) or NFS. You clicked on System->Administration->Shared Folders and followed simple directions there to configure a shared folder. In Ubuntu 8.04, this menu option is gone. According to pages on the web, you may have to drop into a command-line, run “sudo apt-get install nautilus-share” to install a new package “nautilus-share” which has replaced the old shares-admin program, and then reboot or logout/login. Read this bug where people describe how awful this is, including a very user with the handle Thomas Boutell. Yes, it’s probably that Thomas Boutell, and if Boutell says that something is suboptimal, Ubuntu developers should listen. Right now the GUI throws out a cryptic error when what the user actually needs to do is reboot their machine or log out and back in. Here’s what another commenter says:

I can confirm this to be a problem. There is no way to create a share out of the box with the release of 8.04 hardy. This WAS working wonderfully in Gutsy 7.10. There was a folder sharing GUI on the admin menu under system tools, this seems to have been removed from Hardy 8.04.

I happen to agree with the expectations of the [original poster] Thomas Boutell, this should just work out of the box or there should be a readily obvious way to get folder/file sharing working again like it was in Gutsy. Why on earth was a completely functional feature of 7.10 removed from Hardy ?????

[and then the same user later]

This is just plain too much of a hassle: no one should have to go thru this just to share some files on his computer. Help me use linux, not hassle me when I try to use it.

In a related bug about having to reboot or log out and log in again after installing Samba, another user says:

It can be correct for linux security system. But how I can explain to the user, that he should restart his computer for share a folder?! Former windows users will laugh over me.

It sounds like nautilus-share doesn’t let you set your workgroup name either. So I guess you have to edit the smb.conf config file by hand to change your computer’s workgroup? That led one user to remark:

I guess I’m just getting over this phenomenon I’ve started to see in Ubuntu devs and Gnome devs in particular, of just whistling past the graveyard of usability and treating the users like ants at the picnic. The windows shares are BROKEN by any reasonable user’s standards, and a frank acknowledgment of the problem would go a long way.

Update, 11/22/2008: A workaround is to press alt-F2, then enter “shares-admin” and click “General Properties”, click “Unlock” and enter your password and click “Authenticate”, then change the Workgroup name there. You might need to share a folder first (to install Samba), then reboot, then do this change, then reboot again. I ended up editing smb.conf manually to set the workgroup and add whatever sharing I wanted to do.

To me, this feels like a series of choices by the Ubuntu team which may have been locally optimal (“this package has security issues or isn’t maintained — let’s turn it off”) but the net effect of these decisions adds up to a big black eye for Ubuntu. And again, I say this as an Ubuntu fan who wants Ubuntu to succeed. Maybe there wasn’t enough time to shake out bugs in the latest incarnation of GNOME. Maybe it will take a while to find the right pulse rate of software releases. If there’s a plan by Ubuntu/Canonical developers to improve this situation, I encourage them to talk about the future plan in the comments.

That issue encapsulates the sort of thing I’m seeing with Hardy, but let’s talk about a couple more sharing issues I ran into. The problem above was letting other computers connect to Hardy, but what about Hardy connecting to other computers’ shared drives? It used to be that if you click Places->Connect to Server and selected a Windows share, you saw a “Browse Network” button. Now that button is gone for me. I guess you need to know the exact name of the Samba or Windows share that you want to connect to? If so, that’s pretty annoying. It’s also inconsistent, because when I tried to add a printer on a remote machine, I could browse the network from the printer dialog box.

Update, 11/22/2008: In Intrepid Ibex, you can click Places->Network to browse the local network.

I want to talk about one more really annoying problem I ran into. In Gutsy I used “Connect to Server” to create a folder that was connected via ssh to my webhost. If I took a screenshot I could drop the file into that folder and it would magically be copied into a specific deep directory at my webhost. The feature worked perfectly — even better than WinSCP running on a Windows computer.

Now things seem horribly broken. One user asks about it here and includes an image. Evidently a decision was made to switch from something called “gnome-vfs” to something called “gvfs.” I like swapping out old code for new code as much as the next guy, but as a user, this switch is a code phrase for “the stuff that used to work perfectly is now nonfunctional.”

It also looks like someone in GNOME may have decided to change the default location of mounted volumes from $HOME to /, which makes me want to find and punch that person. Or offer them $100 to fix it back to sane behavior.

It’s really quite hard to find out exactly why this simple, useful ability (to create folders that were SSH-connected directly to a specific directory on a remote machine) became broken in Hardy. It appears to have something to do with “bookmarks,” but good luck finding out exactly what’s going on. By the way, if you upgraded from Gutsy to Hardy, all of your carefully-crafted existing shortcuts will break too. This gnome-vfs to gvfs issue is impacting regular Linux (including Fedora) users and causing them to complain. And why not? As one GNOME user states their case, “It should be possible for GNOME users to configure the default path of mounted volumes.”

Are there other annoyances?

As long as I’ve started a complaint thread, I’ll mention a few other things that are on my mind.

  • When I run the Update Manager and install updates, eventually I’m told that “Your system is up-to-date” — but sometimes it isn’t. If I click the “Check” button again, sometimes new updates are found to install. The net result is that I end up checking for updates multiple times, even after I’ve just been told that I’m up-to-date, because my system wasn’t really up-to-date. Please save users the time/effort of checking multiple times for updates and find a way to handle this transparently.
  • The “Hardy Heron” desktop background is sweet, but at 1920×1200 resolution it looks a little fuzzy, as if it had to be scaled up. I would recommend creating a very high-res desktop and then downscaling it so that it’s always sharp, even at the highest resolution.

Okay, that’s my complaints from playing with Hardy Heron for a couple days on my $200 Walmart PC, which I keep around as a guinea pig box for testing. I won’t be installing Hardy on my main Linux box. I might just keep running Gutsy until Intrepid Ibex comes out.

I’m giving my raw perspective as a user, and the upshot is that Hardy Heron feels like a step backwards on the things that matter to me. If I were a GNOME/Ubuntu/Canonical dev, my first reaction would be to leave a comment that says “Matt, you idiot! Don’t you know that XXXXXX is a simple solution for your problem? You didn’t even use the terminology right!” And I’m sure I’ve messed something up, like blaming Ubuntu for a problem that really belongs to GNOME or some other project. But the buck stops with Ubuntu and Canonical. If something in GNOME isn’t ready for prime-time, Ubuntu should hold off until it’s ready. Don’t replace shares-admin with nautilus-share until I can set a workgroup from a GUI. Don’t replace gnome-vfs with gvfs until I can make a drag-and-drop remote folder on my desktop. Don’t replace a sound system until the new sound system is well supported. It’s always a judgment call — I think moving to Firefox 3 was brilliant and acts as a good forcing function to move the community forward. But don’t go with so many new systems that the user experience suffers and Ubuntu takes a goodwill hit.

I love Ubuntu. I want Ubuntu to do well. I want to believe that Ubuntu can romp against the competition. But Hardy Heron feels like a misstep for some users, including me. Please work on fit and finish to get Ubuntu back to the robust, polished distribution that made me fall in love with it in the first place.

css.php