[geeks] [rescue] Solaris 10 puzzle

Magnus Bergman geeks at wrath.trisec.net
Mon Feb 21 19:15:13 CST 2005


On Mon, Feb 21, 2005 at 02:42:12PM -0800, Phil Stracchino wrote:

> Nevertheless, SOMETHING on this system is repeatedly resetting the 
> system's hostname to '-s' at intervals of a few minutes, and I can't 
> figure out what it is.  I've even tried grepping the entire system for 
> stray 'uname -S' calls.  No joy.  I'm fresh out of ideas.

Most probably it's something doing "hostname -s" which at least in *BSD
(and maybe Linux?) means "Trim off any domain information from the printed
name".

So, lets try to find out what's doing this. Dtrace is the most fun way of
doing this IMHO, and solving problems is supposed to be fun.

If you run the D-hack below for a while it should tell you what is executing
"hostname" and with what arguments.

Best Regards //Magnus



#!/usr/sbin/dtrace -s

#pragma D option quiet

proc:::exec
{
        self->parent = execname;
}

proc:::exec-success
/self->parent != NULL && execname == "hostname"/
{
        printf("%-20s executed %s\n", self->parent, curpsinfo->pr_psargs);
        self->parent = NULL;
}

proc:::exec-failure
/self->parent != NULL/
{
        self->parent = NULL;
}



More information about the geeks mailing list