# broken 'w' and 'sockstat'



## chrcol (May 9, 2012)

I have just upgraded a server to 9.0 and have already noticed two core problems on the base system.

The first is *w* doesn*'*t show logged in users.


```
~ # w
 8:04AM  up 4 mins, 0 users, load averages: 0.41, 0.35, 0.18
USER       TTY      FROM                      LOGIN@  IDLE WHAT
```

The second is *sockstat* shows some connections with the ? symbol like as follows (IP edited out):


```
?        ?          ?     ?  tcp4   1.1.1.1:80      194.224.185.244:19748
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:19771
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:19772
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:19773
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:19774
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:27684
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:55981
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:44908
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:35056
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  stream -> ??
?        ?          ?     ?  tcp4   1.1.1.1:80      1.1.1.1:9933
```

however only the bottom part of *sockstat* is like this, the top bit looks normal.


----------



## SirDice (May 9, 2012)

How did you do the upgrade?


----------



## chrcol (May 9, 2012)

*T*he broken w as it turns out is related to the wtmp to utx change and when I switched to the base sshd that was resolved, after the openssh port was recompiled that*'*s also fine.

I am assuming when everything is recompiled sockstat will be fixed, or at least hoping so.

I did the upgrade the way I always do OS upgrades.


```
buildworld
buildkernel
installkernel
reboot
mergemaster -p
installworld
mergemaster -iF
reboot
```


----------



## SirDice (May 9, 2012)

chrcol said:
			
		

> I am assuming when everything is recompiled sockstat will be fixed, or at least hoping so.


sockstat(1) is part of the base so it should be working.



> ```
> buildworld
> buildkernel
> installkernel
> ...


Ok, good. Just wanted to make sure your kernel and world are in sync.


----------



## chrcol (May 10, 2012)

Ok, I have recompiled apache now (that seems to be what*'*s affected only in sockstat, as only port 80 has the "???"). But the problem hasn*'*t gone away, I will do another reboot after I recompiled the last few apps.

..

All apps recompiled now, and rebooted again on GENERIC kernel and still the same problem and after stopping apache it turns out it*'*s not just apache but it is always only the last set of lines on sockstat.


----------



## chrcol (May 10, 2012)

SirDice I found this.

http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/164081

Seems relevant but I am confused as I think he had the issue in 8.x as well but I don*'*t.  It seems to indicate it*'*s intentional behaviour tho*ugh* and just a doc issue?

I also now have some streams with the "???".


----------

