July 23, 2005

Joining CentOS 4 Samba to an Active Directory domain

Start with the official HOWTO on joining Samba 3 to an ADS domain.

  • Don’t forget to set up NTP on your Windows server unless you’re going to have your Linux box synchronize to your Windows box. I’ve got both Windows and Linux synchronizing to pool.ntp.org.
  • Make sure dns_lookup_kdc = true in /etc/krb5.conf, or else a kinit to your ADS realm will fail.

Everything else seemed to work as documented.

Don’t bother using authconfig (or system-config-authentication or redhat-config-authentication or whatever is in the authconfig-gtk package). I decided to turn on winbind in nsswitch.conf with that, in hopes it would make some other important changes. Instead it basically fucked up /etc/krb5.conf. Just go ahead and put winbind on those couple lines in /etc/nsswitch.conf yourself. Actually, I think it may have mad one other potentially useful change: template shell = /bin/false in /etc/samba/smb.conf.

July 10, 2005

VMware Workstation 5 and FC4

Grab http://ftp.cvut.cz/vmware/vmware-any-any-update92.tar.gz, extract, run runme.pl as root. Bridging may be working now (though I get a bunch of warnings when compiling the modules); at least, it doesn’t cause a kernel panic when I try to use the VMware bridged network interface. I do seem to be having some communication difficulties, but I think that might be due to local issues (DHCP, IPsec, iptables, etc.).

(If that file is missing, just look in http://ftp.cvut.cz/vmware/ and see if there’s a file with a similar name and a higher number.)

July 7, 2005

SBCL, Bluetooth DUN, and ipw2100 on FC4

Tried to rebuild the 0.9.2 release with the 0.9.1 RPM spec file. First problem: texi2pdf not found. There’s no such binary in FC4 at this time. Eventually I think it’s going to be in the texinfo package, but check Bugzilla since there are a couple bugs open on it as I recall. Anyway, it turns out texi2pdf is just texi2dvi --pdf, so just make a script to exec texi2dvi --pdf "$@", name it texi2pdf, put it in your path, and no more problems there.

Second problem: it keeps locking up on tests. I gave up at this point. Goes to 100%. I couldn’t even tell what test it was in. So I gave up, used the SBCL 0.9.1 RPM.

Then SBCL randomly started crashing with errors like:

internal error #29
    SC: 14, Offset: 4   lispobj 0x51082ff
fatal error encountered in SBCL pid 12264:
internal error too early in init, can't recover
The system is too badly corrupted or confused to continue at the Lisp
level. If the system had been compiled with the SB-LDB feature, we'd drop
into the LDB low-level debugger now. But there's no LDB in this build, so
we can't really do anything but just exit, sorry.

Turns out this is a result of kernel.randomize_va_space = 1 (that’s /proc/sys/net/kernel/randomize_va_space) which is the default in (at least) FC4’s kernel(s). You only get this error about 2/3 of the time; the rest of the time SBCL seems to work. The solution is to run SBCL like setarch i686 -R sbcl. I made a script in my path to do this when SBCL is built. Side note: I ran setarch i686 -R rpmbuild -ba sbcl.spec, but that didn’t make the build succeed. I didn’t try switching off the flag system-wide.

I tried to connect to the Internet with my phone during class, since there’s no wireless in the new building. Unfortunately I couldn’t get it to connect in class. I already had Bluetooth configured to connect to my v710 for DUN, but I’ve since had my phone flashed so it was no longer paired to my PC. When I did something like cat I’d first have my phone inform me of the pairing attempt and ask me for a PIN, then see things like hcid[4851]: pin_code_request in /var/log/messages. I couldn’t figure out how to tell the Bluetooth stack what PIN to use. gnome-bluetooth-manager was utterly useless: scan detected my phone, but it made like it was already detected. (Presumably some database somewhere indeed indicated the phone was already paired, but I needed a ‘re-pair’ option or something.)

Poking around revealed /etc/bluetooth/hcid.conf. There are two relevant parameters, pin_helper and dbus_pin_helper. In the default FC4 hcid.conf, pin_helper is commented out and dbus_pin_helper is set. At some point, I also noticed hcid would disappear after it spit out its pin_code_request. So I slapped strace on it, and behold (edited for brevity, wrapped for readability):

send(3, "<30>Jul  7 11:32:32 hcid[4851]: pin_code_request
write(2, "4851: arguments to dbus_type_is_basic() were incorrect,
assertion "_dbus_type_is_valid (typecode) || typecode ==
DBUS_TYPE_INVALID" failed in file dbus-signature.c line 259.nThis is
normally a bug in some application using the D-BUS library.n", 242) =
write(2, "type unknown isn't supported yet in
dbus_message_append_args_valistn", 68) = 68
July 6, 2005

Today, udev and hotplug are stupid

Things are frequently stupid. Don’t take it personally.

Sometimes I want to unload my wireless card driver. It’s the only way I’ve found to apparently turn it off (or, at least, the LED turns off). Maybe I should check out documentation, or /proc or /sys for some controls. Regardless, sometimes you want to unload a module.

Unfortunately, on my FC4 system, every time I rmmod ipw2100 it gets loaded again a few seconds. Turns out this is a combination of udev and hotplug.

I first suspected udev. Into /etc/udev/rules.d/10-darkness.rules I put:

DRIVER=="ipw2100",                      OPTIONS="ignore_device,last_rule"
BUS=="pci", ID=="02:02.0",              OPTIONS="ignore_device,last_rule"

They are redundant, but I hoped maybe one would work where the other didn’t. (For example, the kernel somehow didn’t know the driver name at the time it sent events to udev.) This had absolutely zero effects.

To get useful (bordering on too verbose) debugging information from udev, you actually have to rebuild the RPM, after changing %define debug false to true. After searching through the debug log, it looks like it’s correctly parsing my rules. Then it just goes and runs /etc/hotplug.d/default/default.hotplug net. I read the source, and it turns out that there’s some logic in udev that says “if this isn’t a device that’s going to go in /dev, I don’t care about it, so just short circuit and send it to hotplug.” This is, of course, before it does the if (ignore_device) kind of check.

So now I dig through hotplug. I’ve got HOTPLUG=no in /etc/sysconfig/network-scripts/ifcfg-wlan0 (and, incidentally, ifcfg-eth1, since the device is called eth1 before nameif runs) but clearly this is having no effect. HOTPLUG is checked in /etc/sysconfig/network-scripts/ifup. But then I look at /etc/hotplug/net.agent a bit more and see that it does some sort of dorky things:

  • It tries to use ip link show on the device to get its MAC, which it in turn uses to try and find a config file for the device (i.e., so it can see HOTPLUG=no).
  • When it goes to remove the device, it calls ifdown, and somehow that was triggering a modprobe of the device.

That last, especially, makes me think I just wasn’t removing this device correctly. So if anyone knows the right way I can conserve power when not using my Mini-PCI ipw2100 card, please let me know.

In the meantime, I just put some things before *) in /etc/hotplug.d/net.agent, along the lines of:

    debug_mesg darkness: no ifup wireless
    exit 0

I put that in both the cases for add|register and for remove|unregister. Now I can rmmod ipw2100 and it stays unloaded, but service waproamd start will still cause the module to load.

July 5, 2005

Metacity, keyboards, a little FC4

I’ve finished the first attempt at my Metacity patches. I’m using them now. I’ve already found and fixed two bugs, just in a few hours. My patches:

  • Keep clicks on a client window from raising the window in sloppy focus
  • Keep new windows from stealing focus (basically, new normal windows are never given focus, unless the mouse pointer happens to be in them; this behavior is like Sawfish)
  • Makes windows appear focused as you cycle through them with alt-tab
  • Gives you raise on cycle and an icon box in the center of the screen (Metacity seems to only offer one or the other normally)
  • Temporary raise on cycle

Maybe some other stuff. The patches are all ugly: code duplication, #ifdef 0ed sections, and the whole “make windows appear as focused” does so by essentially screwing up a state variable in the Metacity structure that tracks windows. So far, it seems to work like I want it to–which is to say, like I have Sawfish configured to work. I hope I won’t regret putting this work into kwin later.

Almost a month ago my W and E keys started breaking on my trusty Dell QuietKey keyboard. They would only register as a key press when you pressed them very hard, or maybe on a certain part of the key (that I didn’t usually hit). So I decided to put my keyboards in the dishwasher. One is the one I just described with the broken keys, the other an identical model that I had stashed away. Its problem was a sticky key; if I recall, I spilled something sugary in there. I know lots of places on the Internet describe pulling your keyboard apart and washing all the pieces, but that is way too much work for me, so I just slammed them in there as shown. (That other thing on the bottom is part of our meat grinder attachment for the mixer. It didn’t get quite clean.) Note that I did put a full load of detergent in there, and I give no guarantees about whether or not the rinsing agent (Jet Dry) was full or not. I think I washed them normally, except without heated dry.

Everyone says to let them dry out for a week, which seemed pretty reasonable. I didn’t get around to trying them until today, though.

The keyboard with the sticky keys: still has sticky keys. Though I swear it looks a lot cleaner down there, the apostrophe still sticks.

The keyboard with the non-working keys: still has non-working keys. Plus, the writing on some of the keys is either coming off, or has accumulated some sort of detergent residue turning it (the writing) kind of white.

So that experiment was a failure. Again, I might be able to get somewhere with that sticky key keyboard if I felt like taking it apart. I just don’t care that much. I whipped out another Dell keyboard I had lying around (not a QuietKey, though; did they stop making that model?) which should do just fine.

In FC4 new, my Firefox crashed again today, again when I used Tab Mix’s “Close Right Tabs…” function. Still using nss_ldap from FC2 since I’m convinced it works better, even though I can’t prove it. I looked at my firewall today when I needed to get apcupsd going and I realized that FC’s system-config-securitylevel sucks. It lists about six services, none of which were “apcupsd,” and the way you add additional ports doesn’t let you specify a source host. I have NFS mounts in /etc/fstab, yet FC made apparently no effort to open up some NFS ports, which I really think it needs to. (Correct me if I’m wrong.) So I’ll disable that and use my own scripts.