517 | | * In fact `sockstat -lL46` is my goto on FreeBSD. Get a full list of all binaries of processes which are listening on IPv4 or IPv6 sockets from non-localhost addresses: |
518 | | {{{ |
519 | | boss,[~],09:05(0)$ for pid in $(sockstat -lL46 | awk '{print $3}' | grep -v PID | sort -u); do procstat -b $pid; done | awk '{print $3}' | sort -u |
520 | | procstat: sysctl: kern.proc.pathname: 1340: No such file or directory |
521 | | procstat: sysctl: kern.proc.pathname: 1341: No such file or directory |
522 | | procstat: sysctl: kern.proc.pathname: 1342: No such file or directory |
523 | | procstat: sysctl: kern.proc.pathname: 1343: No such file or directory |
524 | | procstat: sysctl: kern.proc.pathname: 1344: No such file or directory |
525 | | procstat: sysctl: kern.proc.pathname: 1345: No such file or directory |
526 | | procstat: sysctl: kern.proc.pathname: 1346: No such file or directory |
527 | | procstat: sysctl: kern.proc.pathname: 1347: No such file or directory |
528 | | procstat: sysctl: kern.proc.pathname: 1348: No such file or directory |
529 | | procstat: sysctl: kern.proc.pathname: 1349: No such file or directory |
530 | | procstat: sysctl: kern.proc.pathname: 1350: No such file or directory |
531 | | procstat: sysctl: kern.proc.pathname: 1351: No such file or directory |
532 | | procstat: sysctl: kern.proc.pathname: 1352: No such file or directory |
533 | | procstat: sysctl: kern.proc.pathname: 1353: No such file or directory |
| 517 | Testing on `boss.instageni.gpolab.bbn.com`: |
| 518 | |
| 519 | * `sockstat -lL46` is my goto on FreeBSD. Get a full list of all binaries of processes which are listening on IPv4 or IPv6 sockets from non-localhost addresses: |
| 520 | {{{ |
| 521 | boss,[~],17:07(0)$ for pid in $(sockstat -lL46 | awk '{print $3}' | grep -v PID | sort -u); do procstat -b $pid; done | awk '{print $3}' | sort -u |
| 522 | usage: procstat [-h] [-C] [-M core] [-N system] [-w interval] |
| 523 | [-b | -c | -e | -f | -i | -j | -k | -l | -s | -t | -v | -x] [-a | pid ...] |
553 | | * Huh, well, that's weird. All the PIDs procstat choked on seem to be tmcd and its children. So we can call the list: |
554 | | {{{ |
555 | | /usr/testbed/sbin/tmcd |
| 545 | * The errors were a couple of pids which get reported as `?`: |
| 546 | {{{ |
| 547 | boss,[~],17:14(0)$ sockstat -lL46 |
| 548 | USER COMMAND PID FD PROTO LOCAL ADDRESS FOREIGN ADDRESS |
| 549 | ... |
| 550 | ? ? ? ? udp4 *:2049 *:* |
| 551 | ? ? ? ? udp6 *:2049 *:* |
| 552 | }}} |
| 553 | * Hmm, that's pretty strange, since nfsd is also represented: |
| 554 | {{{ |
| 555 | boss,[~],17:18(0)$ sockstat -lL46 | grep 2049 |
| 556 | root nfsd 1441 5 tcp4 *:2049 *:* |
| 557 | root nfsd 1441 6 tcp6 *:2049 *:* |
| 558 | ? ? ? ? udp4 *:2049 *:* |
| 559 | ? ? ? ? udp6 *:2049 *:* |
| 560 | }}} |
| 561 | The Utah rack shows the same thing, though, so i'm going to guess it's normal, and just has to do with the strange kernel dependencies of NFS. |
| 562 | * So, the list of listeners is: |
| 563 | {{{ |
648 | | * That finds that the following items are indeed from Emulab: |
649 | | {{{ |
650 | | /usr/testbed/sbin/bootinfo: ./pxe/bootinfo |
651 | | /usr/testbed/sbin/mfrisbeed: ./clientside/os/frisbee.redux/mfrisbeed |
652 | | /usr/testbed/sbin/sdcollectd: ./clientside/sensors/slothd/sdcollectd |
653 | | /usr/testbed/sbin/tmcd: ./tmcd/tmcd |
654 | | }}} |
655 | | * Note that, in instaticket:24, we found that on a non-development rack, source and object files will be found in `/usr/testbed/{src,obj}/emulab-stable`. |
656 | | * So the following items are not from Emulab, and we assume they would be part of the base install: |
657 | | {{{ |
658 | | /usr/libexec/sendmail/sendmail |
659 | | /usr/sbin/inetd |
660 | | /usr/sbin/lwresd # hard link from /usr/sbin/named |
661 | | /usr/sbin/mountd |
662 | | /usr/sbin/nfsd |
663 | | /usr/sbin/ntpd |
664 | | /usr/sbin/rpcbind |
665 | | /usr/sbin/sshd |
666 | | /usr/sbin/syslogd |
667 | | }}} |
668 | | * If the OS had been compiled recently, i could look in /usr/obj for binaries which were identical to things on the system. Since it's running the base install, find out what version that is: |
669 | | {{{ |
670 | | $ uname -r |
671 | | 8.3-RC1 |
672 | | }}} |
673 | | * Hmm, so it looks like [http://lists.freebsd.org/pipermail/freebsd-stable/2012-March/066722.html 8.3-RC1] is not exactly the version which became [http://lists.freebsd.org/pipermail/freebsd-announce/2012-April/001417.html 8.3-RELEASE]. I did a bit of poking around to find the i386 install disc for 8.3-RC1, eventually locating a copy at [http://ftp.at.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/8.3/FreeBSD-8.3-RC1-i386-disc1.iso] |
674 | | * Loopback-mounted that on my desktop: |
675 | | {{{ |
676 | | sudo mount -o loop FreeBSD-8.3-RC1-i386-disc1.iso /mnt/iso |
677 | | mkdir -p ~/tmp/8.3-RC1/{base,src} |
678 | | cd ~/tmp/8.3-RC1/base |
679 | | cat /mnt/iso/8.3-RC1/base/base.?? | tar xvzf - |
680 | | cd ~/tmp/8.3-RC1/src |
681 | | dists="base bin cddl contrib crypto etc games gnu include krb5 lib libexec release rescue sbin secure share sys tools ubin usbin" |
682 | | for dist in $dists; do |
683 | | cat /mnt/iso/8.3-RC1/src/s${dist}.?? | tar xvzf - |
684 | | done |
685 | | }}} |
686 | | * So, this isn't perfect, in that at a glance, the object checksums don't match between what is on boss and what i found in this iso. However: |
687 | | * It definitely would tell someone which items are part of the freebsd base distribution (if i find `~/tmp/8.3-RC1/base/usr/sbin/inetd`, then `boss:/usr/sbin/inetd` has been verified to come from FreeBSD) |
688 | | * I can look at the source code from which the object was presumably taken, even if i can't verify that the object is unmodified. |
689 | | * Using this, i verified that all the non-Emulab-sourced, non-packaged listeners on boss are indeed from the FreeBSD base distribution. |
690 | | |
691 | | All that remains is to retest on the BBN rack once it arrives, and verify that the Emulab source distribution lands in a reasonable place. |
| 669 | * Hmm, the first thing i tried that on, bootinfo, did not match: |
| 670 | {{{ |
| 671 | boss,[~],15:32(0)$ md5 /usr/testbed/sbin/bootinfo /usr/testbed/obj/testbed/pxe/bootinfo |
| 672 | MD5 (/usr/testbed/sbin/bootinfo) = 131c06c10ca3b7438c85aafa93ccc93b |
| 673 | MD5 (/usr/testbed/obj/testbed/pxe/bootinfo) = a98b23f4598f9c2d268b614cbdbc8e30 |
| 674 | |
| 675 | boss,[~],15:32(0)$ ls -l /usr/testbed/sbin/bootinfo /usr/testbed/obj/testbed/pxe/ |
| 676 | bootinfo |
| 677 | -rwxr-xr-x 1 root wheel 136499 Mar 8 2012 /usr/testbed/obj/testbed/pxe/bootinfo* |
| 678 | -rwxr-xr-x 1 root tbadmin 140415 Oct 29 16:39 /usr/testbed/sbin/bootinfo* |
| 679 | }}} |
| 680 | Note that, [instaticket:24] claimed that, on a non-development rack, source and object files will be found in `/usr/testbed/{src,obj}/emulab-stable`. |
| 681 | * I'm not going to bother retesting the things from the FreeBSD base install --- as mentioned when i tested at Utah, the MD5 sums don't match, so i'd just be using the FreeBSD base install ISO to verify the identities of the binaries. Since the listed binaries are the same this time as last time, i'm going to assume they are still reflected in the FreeBSD base distro. |
| 682 | |
| 683 | [instaticket:80] covers the question of the locations of the Emulab src/obj trees on the BBN boss node. |