Archive
Posts from 2006
Securely backing up a wordpress configuration to a remote location
I have been using wordpress as my blogging engine for quite some time. To ensure that I can recover my blog in the event of a disaster (a good example would be a server catching on fire), I take weekly backups of the MySQL database that stores my posts and the wordpress configuration.Since the wordpress backups are relatively small, I typically use mysqldump to extract the data from the MySQL database, and openssl to encrypt the data. This allows me to email my backup to a remote location, and ensures that prying eyes cannot view any data that might be sensitive. To accomplish this, I use the following shell script: This solution has worked well for me for the past two years, and I have never had a problem running openssl with the "-d" (decrypt data) option to decrypt the data that openssl's "-e" (encrypt data) option produces…
$ read more →Fixing a broken Solaris zone
I applied the latest set of patches to my x86 Solaris 10 server this morning, and after the server was rebooted I noticed that my zones didn't start. When I ran the zoneadm utility with the "list" option, all of the zones were in the "installed" state (they should be in the running state since the autoboot variables was set to true): At first I thought the zones service might be in the maintenance state, but after reviewing the output from the svcs command, that theory turned out to be incorrect: Since the box contained several critical services, I decided to start the zones by hand and perform mostmortem analysis after the zones were back up and operational. When I ran zoneadm with the the "boot" option and the name of the zone to boot, I was greeted with the following error: Oh good grief! After reviewing my notes, I noticed that I had applied patch 122663-06 (a libezonecfg patch) as part of the patch bundle…
$ read more →Viewing previous dates with GNU date
GNU date has some nifty options, and is a time keepers toolbox rolled up into an ELF executable. One really cool option in GNU date is the ability to print a date in the past using the the "--date" option, and the "days ago" format string: Now if only more vendors would include GNU date with their operating system. :)
$ read more →Solaris needs SMART support! Please help!
While attempting to run the smartctl utility a few weeks back on an x86 Solaris 10 host with IDE disk drives, I received the following error: It turns out this error is caused by several missing ioctls in the x86 Solaris cmdk IDE device driver. Since I have always wanted to develop (or modify) a kernel device driver, I decided to start reviewing the source code in cmdk.c to see what would be needed to make smartmontools happy. After reading through the cmdkioctl routine in cmdk.c, it dawned on me that the SPARC IDE driver, dad, contained the ioctls that are used by smartmontools. If the dad device driver used the underlying DDI framework, it would be relatively trivial to port the missing pieces from the dad driver (the SPARC IDE driver) to the cmdk driver (the x86 Solaris IDE driver)…
$ read more →Debugging the ipfilter SMF service
I logged into one of my Solaris 10 hosts today to add some additional firewall rules, and noticed that the ipfilter service was in the maintenance state: This is odd, considering this was working the last time I had checked up on the server. When I dumped out the logfile mentioned in the service state listed above, I noticed that the shell script that starts ipfilter was bombing out at line 180: Since I didn't modify /lib/svc/method/ipfilter, I started to wonder why ipfilter all of a sudden quit working. The erorr message above indicated that there was an error in the script at line 180, which is a bit misleading considering the script only has 179 lines: To find the actual line that was causing the issue, I decided to change the shell in /lib/svc/method/ipfilter from /sbin/sh to /bin/bash ( As a side note -- I still don't quite understand why anyone would use /sbin/sh on Solaris hosts, considering zsh, tsch and bash are available. If the reason is because of dependencies, Sun should consider moving the shells folks actually use into one of the core packages!)…
$ read more →