Archive

Archive for April, 2009

Moved my last home server to Mac OS X Server 10.5.x

April 19, 2009 Leave a comment

I’ve got two G4 desktops acting as my home servers, one of which was running web, Open Directory and Time Machine backup services for my home’s Macs and the other providing my DNS and VPN services. The OD server is running Mac OS X Server 10.5.x, but the other was running (until yesterday) Mac OS X Server 10.4.11. Since I usually try to keep my OSs current, I decided that it was time to upgrade. Using the Apple migration documentation, I installed Mac OS X Server 10.5.6 onto an external Firewire drive and used the data from my 10.4.11 boot drive to migrate the needed services. I migrated over my AFP and VPN services fairly easily, but I kept running into issues with migrating my DNS. The import (outlined on page 33 in the migration documentation) would go smoothly, but then my DNS entries would vanish out of Server Admin. DNS was apparently working, as I could do lookups, but I was unable to edit any entries or add new ones.

After trying a couple of times to migrate the DNS service, I gave up and decided to re-create the entries. When I re-built the DNS entries by hand, I saw the same phenomenon happening. I was getting near the end of the job (having saved after every step, I saw the DNS entries disappear from Server Admin after I’d made the DNS entry for my wife’s laptop. When I looked in the log, I saw this (log entries altered to conceal internal DNS names and IPs):

18-Apr-2009 14:43:43.111 dns_rdata_fromtext: /var/named/zones/db.myinternal.net.zone.apple:18: near ‘Mac’: extra input text
18-Apr-2009 14:43:43.112 zone myinternal.net/IN/com.apple.ServerAdmin.DNS.public: loading from master file db.myinternal.net. failed: extra input text
18-Apr-2009 14:44:32.902 shutting down
18-Apr-2009 14:44:32.903 stopping command channel on 127.0.0.1#54
18-Apr-2009 14:44:32.904 no longer listening on 127.0.0.1#53
18-Apr-2009 14:44:32.904 no longer listening on 10.0.0.70#53
18-Apr-2009 14:44:32.934 exiting

When I looked at line 18 of /var/named/zones/db.myinternal.net.zone.apple, I saw the following:

littleshiny IN HINFO “PowerBook G4 12 “” “Mac OS X 10.5.x”

My whole problem with importing my DNS was a comment that I’d made in the Hardware info section of the DNS entry. I’d set it on 10.4.11′s DNS service as PowerBook G4 12″. 10.5′s DNS service didn’t know what to do with the extra in the configuration file, so it failed. I altered the entry to the following:

littleshiny IN HINFO “PowerBook G4 12 inch” “Mac OS X 10.5.x”

Once that change was made, DNS fired right up and everything appeared normal in Server Admin. DNS was the last remaining issue (VPN worked fine once I re-entered the shared secret, and AFP worked normally.) After that, I made one last backup of the 10.4.11 boot drive, then erased the boot drive and cloned my new 10.5.6 Server installation on to the boot drive.

Once the newly-minted 10.5 server was successfully booting from its internal boot drive, I was then able to set up the drive that I had been using to make a synchronized backup on 10.4.11, to now be the Time Machine backup drive for the server and let Time Machine back up the server overnight. 24 hours later, everything looks like its working like it should, so I’m calling this a success.

Using .bashrc with Terminal

April 6, 2009 2 comments

I got a question from a user today that was pretty interesting. Boiled down, it was “I’ve set up a .bashrc file with my preferred settings. It works fine in XWindows with xterm, but is being ignored by Terminal. Why?”

This has to do with how the bash shell handles different shells. If you read the bash man page (‘man bash’), in the section on startup files, it explains which files are read when. The tricky part is that there are two types of shells: “login” shells and “non-login” shells, and bash reads different files depending on the type of shell.

A “login” shell reads ~/.profile but not ~/.bashrc
A “non-login” shell reads ~/.bashrc but not ~/.profile

A new Terminal window in OS X starts a “login” shell and hence reads ~/.profile but not ~/.bashrc
The situation is reversed for xterm (running under X11 in OS X).

What should fix it is to set up a .profile file to that sources your .bashrc file like this:

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

That way, you don’t have to worry about making changes to .profile; Terminal will just get the changes from .bashrc. For what it’s worth, this is an issue with several Unix-based OSs.

Categories: Geeky, Mac OS X
Follow

Get every new post delivered to your Inbox.

Join 143 other followers

%d bloggers like this: