1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to rebuild sockstat and netstat

Discussion in 'Installing and Upgrading FreeBSD' started by ivand58, May 18, 2009.

  1. ivand58

    ivand58 New Member

    Messages:
    34
    Thanks Received:
    1
    Hi list,

    after freebsd-update 7.0 -> 7.2 i have a problem with sockstat:
    Code:
    # sockstat
    sockstat: struct xtcpcb size mismatch
    sockstat: struct xinpcb size mismatch
    sockstat: struct xunpcb size mismatch
    sockstat: struct xunpcb size mismatch
    USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
    
    

    According
    HTML:
    http://lists.freebsd.org/pipermail/freebsd-current/2007-December/081112.html
    i have to rebuild sockstat and netstat:
    My question is: how to do this? Where are these Makefiles and what exactly i have to do ?
     
  2. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,765
    Thanks Received:
    1,870
    If you're using freebsd-update, I assume you have the GENERIC kernel, which does not contain the LOCK_PROFILING option. Is your kernel in sync with the world? Is uname -r actually the same as your world's OS version/patch level (in /var/db/freebsd-update/tag)?

    P.S.: comparing uname and the tag may not heed any results. The tag is only updated by the 'freebsd-update fetch' command. So if you don't install what you fetch, the tag file will be 'off-by-one', so to speak.
     
  3. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,621
    Thanks Received:
    2,383
    It looks like you only updated the kernel and forgot to update world.
     
  4. ivand58

    ivand58 New Member

    Messages:
    34
    Thanks Received:
    1
    Thanks,
    I just followed the instructions here: http://www.freebsd.org/releases/7.2R/announce.html
    Code:
    freebsd-update upgrade -r 7.2-RELEASE
    freebsd-update install
    shutdown -r now
    freebsd-update install
    shutdown -r now
    

    and my kernel is (was) untouched, GENERIC.
    Code:
     uname -a
    FreeBSD aux.hobbylab.org 7.2-RELEASE FreeBSD 7.2-RELEASE #0: Fri May  1 08:49:13 UTC 2009     root@walker.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
    
    #cat /var/db/freebsd-update/tag
    freebsd-update|i386|7.2-RELEASE|0|b6d6837d3363e50b4f04b250667e856227d40bfff6224698ac4591b12637de4f|1275350400
    


    Sorry but can you help me how to do this? In the Handbook, chapter 24 we can read
    but maybe this is something else?
     
  5. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,765
    Thanks Received:
    1,870
    Something else. The first freebsd-update install installs the new kernel, the second freebsd-update install installs the world and triggers a mergemaster-like config comparison tool.

    I have no idea how a binary only system can produce the error you're seeing. I've not heard of this issue anywhere. I could tell you to roll-back the update and wait a while before trying again (maybe it's something that needs patching), but that's up to you.

    I advise against 'polluting' the binary system with edited Makefiles and rebuilt/adjusted binaries (the sources are probably not even on your system -- I assume you have nothing in /usr/src/), because it will likely break the next run of freebsd-update.
     
  6. SirDice

    SirDice Moderator Staff Member Moderator

    Messages:
    17,621
    Thanks Received:
    2,383
    Sorry, old school bsd user :e Updating world actually consists of several steps these days.

    I never use freebsd-update. I build everything from source.

    Code:
    # make buildworld
    # make buildkernel
    # make installkernel
    # reboot # to single usermode
    # make installworld
    # mergemaster
    
     
    ivand58 thanks for this.
  7. ivand58

    ivand58 New Member

    Messages:
    34
    Thanks Received:
    1
    Edited by who? Do I have to modify some Makefiles (like in build custom kernel) or these Makefiles are modified by freebsd-update?
    No, /usr/src is not empty (i had to rebuild senmail with sasl).
     
  8. DutchDaemon

    DutchDaemon Administrator Staff Member Administrator Moderator

    Messages:
    10,765
    Thanks Received:
    1,870
    You'd have to edit the Makefiles, like you stated in the first post.

    The freebsd-update app doesn't use Makefiles, simply because it doesn't compile anything. That's the whole point of freebsd-update: installing already compiled binaries.

    You compiling your own and replacing the ones installed by freebsd-update will probably lead to the failure of the next freebsd-update run, because it doesn't recognise your binaries. However, I do not know how freebsd-update handles such a case, because I compile everything myself. You may get away with it.
     
    ivand58 thanks for this.
  9. vivek

    vivek New Member

    Messages:
    809
    Thanks Received:
    184
    Try as follows (it may or may not work). You need to have src distribution installed.
    Code:
    cd /usr/src/usr.bin/sockstat/
    vi Makefile 

    Add CFLAGS+=-DLOCK_PROFILING.
    Code:
    make install clean

    If this failed, just rebuild everything.
     
  10. ivand58

    ivand58 New Member

    Messages:
    34
    Thanks Received:
    1
    Thanks you guys,
    now i am back to freebsd 70 and everything looks fine. Is there some integration tests or some scripts that checks the integrity and functionality of the system? Because after these rebuilds, how can I be sure that everything is OK ?
     
  11. richardpl

    richardpl New Member

    Messages:
    841
    Thanks Received:
    68
    ident(1) is utility to check if version of files you have installed are same one as available from freebsd cvs repo.
     
    ivand58 thanks for this.