Sunday, February 20, 2011

Solaris 10 dfstab bug

I'll admit, it's been awhile since I have had to present NFS shares on Solaris 10 that were not ZFS file systems. ZFS makes this pretty easy, but hey, it's not like it was terribly difficult to edit the /etc/dfs/dfstab file. But after a recent head banging experience where my dfstab file would get magically overwritten during reboots, and my shares commented out; I started to wonder if I really need to hang up this IT thing and open the donut shop.

It turns out that Oracle has a little bug in Solaris 10 (6941744) which basically says that libsharecore.c has some incorrect code that improperly affects Solaris 10 systems.

Based on this thread it doesn't sound like a fix is here yet, so I put this together quickly to get past the issue. While I have no reason to suspect this script will cause issues, I provide it to you with the understanding that you will ensure it is the right solution for your environment. I placed this script at /etc/init.d/local, and linked it to rc2.d and rc3.d as necessary.

# This is a cleanup script due to an issue in Solaris 10 update 9 and previous
# SUN/Oracle bug 6941744
# From /etc/dfs/dfstab
# --------------------
# Use the sharemgr(1m) command for all share management
# This file is reconstructed and only maintained for backward
# compatibility. Configuration lines could be lost.
# --------------------
# created by Justin Richards, Lumenate
# Version 1.0 Date 02202011

case "$1" in
$CAT /etc/dfs/dfstab | $SED '/^# Error: Syntax: /s/# Error: Syntax: //' > /etc/dfs/dfstab.tmp ;\
$CP /etc/dfs/dfstab.tmp /etc/dfs/dfstab ; $SHARE
echo "Usage: $0 {start|restart}"
exit 1


No comments:

Post a Comment