Solaris 8and dhcpagent

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
I added dhcp to my solaris 8 system (Ultra 1 SPARC).

It works but is taking 90% cpu cycles!

Any ideas of what it is looking for?!

TIA
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
No, will look at top. Someone told me to use truss. Also start dhcpagent with diagnostic commands. BUT I never do start dhcpagent...I believe it is started from ifconfig.

Someone else suggested that I just do an upgrade and see if all gets fixed...and/or do a sys_unconfig so it will be reset. This was dns before and I just went to dhcp and a router. To change to dhcp I just made a 0 byte file (touch) of hostname.hme0 and dhcp.hme0.



Remember this does work...just that dhcpagent takes 90% of cycles!
 

legzakimbo

Junior Member
Sep 8, 2000
17
0
0
You don't need top.
Solaris 8 comes with it's own version in called prstat
/usr/bin/prstat

or you could use
/usr/ucb/ps -aux | head

is your /etc/resolv.conf file empty? DHCP likes to put stuff in there. I am running Sol8 on an Ultra 10 with no issues.

truss would be a good thing... run something like
# truss -p <PID of dhcp agent>
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
Thanks...also why do I even need any more than the process manager?

I will look in resolv.conf.

What, if anything should be there?

I assume it knows my dhcp is from my router and if there is anything anywhere its ip should be there.
 

legzakimbo

Junior Member
Sep 8, 2000
17
0
0
I'm not quite sure what you mean by the process manager.

If you're on a static IP, then resolv.conf should at least have a domain and a DNS server in the following format:

domain somedomain.com
nameserver 10.10.10.10

If you want to be a DHCP client, then leave resolv.conf empty (but make sure it exists) and the DHCP server should populate it.
I was wondering if that was where dhcpagent was getting confused.

Also, is dhcpagent running with any flags? Maybe it's trying to log somewhere.

Do you see the same behaviour all the time? What about if you unplumb the interface and try to reconnect?

# ifconfig le0 unplumb
# ifconfig le0 plumb
# ifconfig dhcp start

(I think the Ultra 1 has an le0 interface, it might be hme0)
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
Thanks legz...

If I right click cde desktop and choose support tools there is a process manager.

I was static, then @Home went to dhcp and I got a router.

The Ultra 1 is on the router as all the other machines. The SUN is fine...it DOES connect to the web, via the router and dhcp.

BUT, the cpu bar is way up and the process manager shows that dhcpagent is using 90% of cpu!!

Perhaps I should clear resolv.conf and reboot. If so, dhcp will repopulate it.

I also wondered if that was the problem. It works but perhaps dhcpagent keeps looking for nameserver and it can not find it.

And yes, I see this all the time.

P.S. Interface is eth0.
 

legzakimbo

Junior Member
Sep 8, 2000
17
0
0
the ultra1 is a Sparc system right? Not intel. Why is your ethernet called eth0? Isn't there an onboard ethernet card?

If you run

# grep hme /etc/path_to_inst

and

# grep le /etc/path_to_inst

it should say which it is (unless it's dead)

Can't say I've ever used a non hme or le on Sparc. Maybe thats the problem (I'm guessing though)
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
Legz of course I meant hme0. I did a sys-unconfig and DHCP freezes the system. I now know what to try tonight.

I will see if it works and will let this thread know!

Hint...after sys-unconfig I need to do a boot -s :Q
 

legzakimbo

Junior Member
Sep 8, 2000
17
0
0
after running sys-unconfig, you might want to select &quot;none&quot; for name-service when the boot-up asks you for your choice and then configure things by hand.

# cd /etc
# touch hostname.hme0
# touch dhcp.hme0
# touch resolv.conf
(make sure all three are empty files)

add &quot;dns&quot; to the &quot;hosts&quot; line on nsswitch.conf

# init 6



 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
I will try if the idea I had does not work.

As far as touch hostname.hme0 goes...you do not mean the actual hostname, do you...ie:

touch homework.hme0?

I believe that the hostname.hme0 is what you mean...that the hostname is an actual file name and not my actual host name. Come to think of it...there is no hostname in dhcp that I configure.

P.S. I did try to manually configure this before I did the sys-unconfig and it did not work!
You must work at Sun. :D
 

legzakimbo

Junior Member
Sep 8, 2000
17
0
0
you're correct - the file should be called hostname.hme0 not myhostnameiswhatever.hme0

I forgot, the /etc/inet/hosts file should also just have

127.0.0.1 localhost

to begin with. Once it's working as it should, then you can add whatever else you need


Trying to configure DHCP during installation or after sys-unconfig has *never* worked for me. It usually bombs out saying that no DHCP server could be found. I have always had to do it the way descibed in earlier posts.

BTW, if it still takes over the CPU, then run truss on the process and post the results (please do some trimming though - there will be tons of data)

# truss -p <dhcp PID>
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
OK, and if my method works from the sys-unconfig, it will answer why your (and my) dhcp never ran from an unconfigure!

P.S. I guess you don't work for Sun! :D
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
Well, Legz my idea has not worked.

I am starting to wonder if the problem is that I am using an SMC Barricade router? Although Win9x and Linux don't seem to mind. DHCP runs fine there.

I assume I use the ip of the router for my /etc/defaultrouter file.

You know, before I did the sys-unconfig, my only problem was that the dhcpagent was using 90% of cpu. Now, I can not get dhcp to come up at all!
 

legzakimbo

Junior Member
Sep 8, 2000
17
0
0
can you do the following at post the results of the /tmp/debugfile please? (Assuming dhcp is still not working)

# script /tmp/debugfile

# ifconfig hme0

# ifconfig hme0 dhcp start

# ifconfig hme0

# /usr/ucb/ps -aux | head

# ps -ef | grep dhcp

# /usr/proc/bin/ptree <pid of dhcp>

# exit

Change the IP addresses etc and I'm not quite sure if the ptree path is correct

Sorry your problems are getting worse but it was *your* idea to run sys-unconfig :)
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
Thanks. I started again and brought up fixed IP, dns, etc. At least I can get into the router and ping LAN...no WAN.

Then I made hostname.hme0 and dhcp.hme0 in /etc/
I brought the thing up by hand as ifconfig hme0 dhcp start

It is back to what it did before.

DHCP is fine BUT cpu is 90% usage.
I did truss -p <id> and get the following....forever....

sigprocmask(SIG_SETMASK, 0xFFBEF548, 0x00000000) = 0
sigprocmask(SIG_UNBLOCK, 0x0009B29C, 0xFFBEF548) = 0
poll(0x0009B510, 10, 0) = 0
sigprocmask(SIG_SETMASK, 0xFFBEF548, 0x00000000) = 0
sigprocmask(SIG_UNBLOCK, 0x0009B29C, 0xFFBEF548) = 0
poll(0x0009B510, 10, 0) = 0
sigprocmask(SIG_SETMASK, 0xFFBEF548, 0x00000000) = 0
sigprocmask(SIG_UNBLOCK, 0x0009B29C, 0xFFBEF548) = 0
poll(0x0009B510, 10, 0) = 0
sigprocmask(SIG_SETMASK, 0xFFBEF548, 0x00000000) = 0
sigprocmask(SIG_UNBLOCK, 0x0009B29C, 0xFFBEF548) = 0
poll(0x0009B510, 10, 0) = 0
sigprocmask(SIG_SETMASK, 0xFFBEF548, 0x00000000) = 0
sigprocmask(SIG_UNBLOCK, 0x0009B29C, 0xFFBEF548) = 0
poll(0x0009B510, 10, 0)
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
Well, I ran it...here is results...I don't have a dhcp process, it is dhcpagent.
Anyway, I AM sending this from the &quot;broke&quot; machine now!.

script started on Sun 18 Mar 2001 02:11:40 PM PST
# ifconfig hme0
hme0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 0.0.0.0 netmask 0
ether 8:0:20:93:28:c0
# ifconfig hme0 dhcp start
# ifconfig hme0
hme0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
inet 192.168.123.7 netmask ffffff00 broadcast 192.168.123.255
ether 8:0:20:93:28:c0
# /usr/ucb/ps -aux | head
USER PID %CPU %MEM SZ RSS TT S START TIME COMMAND
root 741 92.4 0.3 712 312 ? R 14:12:15 0:58 /sbin/dhcpagent
root 744 1.9 1.7 2328 2056 pts/5 O 14:13:27 0:00 /usr/ucb/ps -aux
root 622 0.1 10.312634412520 ? S 14:10:08 0:04 /usr/openwin/bin/X
root 743 0.1 0.6 952 672 pts/5 S 14:13:27 0:00 head
root 288 0.1 1.6 2384 1888 ? S 13:52:05 0:00 mibiisa -r -p 3279
root 3 0.0 0.0 0 0 ? S 13:51:11 0:00 fsflush
root 0 0.0 0.0 0 0 ? T 13:51:08 0:00 sched
root 1 0.0 0.3 776 304 ? S 13:51:11 0:00 /etc/init -
root 2 0.0 0.0 0 0 ? S 13:51:11 0:00 pageout
# ps -ef | grep dhcp
root 741 1 99 14:12:15 ? 1:49 /sbin/dhcpagent
root 745 735 0 14:14:18 pts/5 0:00 grep dhcp
# /usr/proc/bin/ptree 741
741 /sbin/dhcpagent
# /sbi .. .. ..usr/proc/bin/ptree 745
# exit
 

legzakimbo

Junior Member
Sep 8, 2000
17
0
0
ok... the truss info was good! There is a bug that causes the process to go wild if your DHCP lease is for longer than 48 days - the fix is to set the lease to less than that.

Let me get the info..

Bug ID: 4344914
Description: DHCP client hogs the CPU when leases are longer than roughly 48 days
Workaround: Set leases to smaller than 48 days, or to infinity.

Looks like a patch was released for this on Feb 28th - patchID: 110932-01 (200k)

You should be able to search on Sunsolve and d/l it.

If it's for contract customers only, let me know and I can email it to you
 

DaveR

Golden Member
Oct 9, 1999
1,490
0
76
GREAT! Just got the patch. Should I just do a patchadd or can I just put dhcpagent into /sbin/ and overwrite the dhcpagent there!

P.S. How did you find this? I searched using all kinds of words?
 

legzakimbo

Junior Member
Sep 8, 2000
17
0
0
you could probably get away with just adding the new binary but you should always use patchadd. That way there is a record of it being installed. Use:
# showrev -p
to list all your installed patches. This comes in helpful when adding jumbo patches or maintenance updates.

I think I just searched for dhcpagent filtered it down from there. Maybe the contract customers somehow get a better search.

I hope it fixes your problem