2004-10-19-1105Z


More adventures in the life of the internet café clerk. I finally got around to upgrading all the necessary packages so I could install Mozilla Firefox 1.0. And in a completely unrelated issue, I had switched USB support into a module instead of built-in to the kernel, to try and work out some problems with my webcam (not the JB1, a different one, which also doesn't work... grr...). Well, to keep a short story short, the troublesome workstation, codenamed billy, Oopsed and wouldn't come all the way up into Xwindows. What's funny is that alyce, workstation 1, had the same Oops and still came up all the way.

The message included this: "kernel BUG at slab.c:815". I googled that and got a bunch of hits. One recommended putting "noacpi" into the kernel boot options. I did. No help. So then I just disabled the hotplug startup script on the thin clients. Presto, billy is OK again. No Oops, not on alyce either.

In case you're curious, here's the latest revision of /etc/pxeclient.init:

#!/bin/bash
exec </dev/console >/dev/console 2>/dev/console
PATH=/bin:/sbin:/usr/bin:/usr/sbin
ramfs() {
 number=$1; mb=$2; mountpoint=$3
 dd if=/dev/zero of=/dev/ram$number bs=$((1024 * 1024)) count=$mb &>/dev/null
 mke2fs -q -m0 -i1024 /dev/ram$number &>/dev/null
 mount -n -o rw /dev/ram$number $mountpoint &>/dev/null
}
echo Setting up ramdisks...
ramfs 0 4 /tmp
chmod 1777 /tmp
ramfs 1 8 /mnt/tmp/etc
ramfs 2 6 /mnt/tmp/var
ramfs 3 4 /mnt/tmp/home
ramfs 4 2 /mnt/tmp/dev
echo Ramdisks created, now populating with files...
mount -n -t proc proc /proc &>/dev/null
ifconfig lo up # didn't used to be necessary, but seems so now...
#echo Mount status: $(</proc/mounts) # FIXME debugging only
cp -a /etc /dev /mnt/tmp
#echo Home directories: /home/* # FIXME debugging only
cp -a /home/internet /mnt/tmp/home
# now overwrite necessary files with client configurations
cp -af /ref/client/* /mnt/tmp
echo Ramdisks populated, now unmounting...
umount /mnt/tmp/*
echo Remounting ramdisks at proper mountpoints...
mount -n -o rw /dev/ram1 /etc
mount -n -o rw /dev/ram2 /var
mount -n -o rw /dev/ram3 /home
mknod /tmp/ram4 b 1 4
mount -n -o rw /tmp/ram4 /dev
echo Creating /etc/mtab from /proc/mounts...
cp -f /proc/mounts /etc/mtab
echo Mounting /dev/pts, unix pty support...
mount -o rw,gid=5,mode=620 -t devpts devpts /dev/pts
# define bootserver
echo Setting environment variables from /proc/net/pnp...
for declaration in $(grep -v '^#' /proc/net/pnp | sed -e 's/ /=/'); do
 declare $declaration
done
netroot=$(echo $bootserver | cut -d '.' -f 1,2,3)
gateway=$netroot.1
echo Mounting $bootserver:/opt as /opt...
mount -t nfs -o ro,nolock $bootserver:/opt /opt
echo Creating default route...
route add default gw $gateway
export bootserver gateway
#/bin/bash -l # FIXME debugging only
echo Passing control to /sbin/init...
exec /sbin/init

And /opt/bootlocal.sh:

#!/bin/bash
# put other system startup command here

# if syslogd failed, try a restart [ -z "$(pidof syslogd)" ] && /etc/init.d/syslog restart [ -z "$(pidof syslogd)" ] && echo "System is not logging!" >&2

# if dhcpd3 didn't start yet, try again here [ -z "$(pidof dhcpd3)" ] && /etc/init.d/dhcp3-server restart [ -z "$(pidof dhcpd3)" ] && echo "Still no DHCP service running!" >&2

# if httpd isn't running, attempt to start it here [ -z "$(pidof httpd)" ] && /etc/init.d/httpd restart [ -z "$(pidof httpd)" ] && echo "Still no HTTP service running!" >&2

# find out who we are declare $(ifconfig eth0 | awk '$2 ~ "^addr:" {print $2}' | sed -e 's/:/=/') if [ "$addr" ]; then echo Determined address to be: $addr >&2 hostname=$(grep "^$addr\>" /etc/hosts | awk '{print $2}') if [ "$hostname" ]; then echo Setting hostname to $hostname >&2 hostname $hostname fi # did we lose our default route? if so, fix it if ! [ "$(awk '$2 ~ "00000000"' /proc/net/route)" ]; then net=$(echo $addr | cut -d '.' -f 1,2,3) gateway=$net.1 # not always true, but in my case it is echo Setting default gateway to $gateway >&2 route add default gw $gateway fi fi

# set up binfmt_misc for postFORTH binaries [ -d "/home/jcomeau" ] && make -f /home/jcomeau/src/postforth-2/Makefile \ /proc/sys/fs/binfmt_misc/forthcom # now we can (maybe) add other stuff to binfmt_misc if [ -f "/proc/sys/fs/binfmt_misc/register" ]; then echo ':DOSWin:M::MZ::/usr/local/bin/wine:' > /proc/sys/binfmt_misc/register fi

# fix MTU for funky router that steals 8 bytes out of the packet ifconfig eth0 mtu 1492

# make reboot "safe" for unattended shop ! grep -q '^x:' /etc/inittab && su - internet -c startx &

Back to blog or home page

last updated 2013-01-10 20:31:56. served from tektonic.jcomeau.com