See http://houst0n.net/blog for all your houst0n wares 😉
See http://houst0n.net/blog for all your houst0n wares 😉
My poor forgotten little blog. I will post something cool soon 🙂
After a bit of irc inspired digging, I’ve built a newer rev of LSOF and fortunately, it appears that the upcoming 4.83 release restores functionality on Solaris which has been broken for a while!
Will kick out some packages once it’s released.
(And yep, it supports ZFS)
If you juuuuuuust can’t wait, here are some simple instructions on building it:
Download and extract the 4.83K tar.bz2:
houston@charon:~/lsof > wget ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/NEW/lsof_4.83K.sun.tar.bz2
–2010-01-03 20:33:41– ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/NEW/lsof_4.83K.sun.tar.bz2
Resolving lsof.itap.purdue.edu… 18.104.22.168
Connecting to lsof.itap.purdue.edu|22.214.171.124|:21… connected.
Logging in as anonymous … Logged in!
==> SYST … done. ==> PWD … done.
==> TYPE I … done. ==> CWD /pub/tools/unix/lsof/NEW … done.
==> SIZE lsof_4.83K.sun.tar.bz2 … 560608
==> PASV … done. ==> RETR lsof_4.83K.sun.tar.bz2 … done.
Length: 560608 (547K)
100%[======================================>] 560,608 367K/s in 1.5s
2010-01-03 20:33:43 (367 KB/s) – `lsof_4.83K.sun.tar.bz2′ saved 
houston@charon:~/lsof > bzcat lsof_4.83K.sun.tar.bz2 | gtar -xf –
Be slightly baffled by the confgure script, but continue on as follows:
houston@charon:~/lsof/lsof_4.83K.sun > ./Configure solaris
Testing prdata.h for PR_GWINDOWS, using gcc
Testing prdata.h for PR_LDT, using gcc
Testing gcc for 64 bit support
* Configuring for 64 bit kernel *
Testing vnode.h for VSOCK, using gcc
This configuration step (the Inventory script) takes inventory of
the lsof distribution. The script runs for a minute or two while
it checks that all the subdirectories, information files, scripts,
header files and source files that should be present really are.
It’s not absolutely necessary that you take inventory, but it’s a
good idea to do it right after the lsof distribution has been
unpacked. Once the inventory has been taken, this script creates
the file ./.ck00MAN as a signal that the inventory step has been
You can call the Inventory script directly at any time to take
inventory. You can inhibit the inventory step permanently by
creating the file ./.neverInv, and you can tell the Configure script
to skip the inventory and customization steps with the -n option.
Do you want to take inventory (y|n) [y]? n
rm -f ddev.c dfile.c dlsof.h dmnt.c dnode*.c dproc.c dproto.h dsock.c dstore.c dzfs.h kernelbase.h machine.h machine.h.old new_machine.h __lseek.s Makefile Makefile.zfs ./tests/config.cflags
rm -f ./tests/config.cc ./tests/config.xobj ./tests/config.ldflags
Testing C library for localtime() and strftime(), using gcc … present
ln -s dialects/sun/ddev.c ddev.c
ln -s dialects/sun/dfile.c dfile.c
ln -s dialects/sun/dlsof.h dlsof.h
ln -s dialects/sun/dmnt.c dmnt.c
ln -s dialects/sun/dnode.c dnode.c
ln -s dialects/sun/dnode1.c dnode1.c
ln -s dialects/sun/dnode2.c dnode2.c
ln -s dialects/sun/dproc.c dproc.c
ln -s dialects/sun/dproto.h dproto.h
ln -s dialects/sun/dsock.c dsock.c
ln -s dialects/sun/dstore.c dstore.c
ln -s dialects/sun/machine.h machine.h
Makefile and lib/Makefile created.
You may now customize the machine.h header file for this UNIX
dialect. The customizations will take effect when you compile
lsof. You may also choose to skip customization and proceed to
the compilation of lsof.
If you don’t know if you need to customize or want to know more
about what you can customize, consult the 00DCACHE, 00FAQ, 00PORTING,
and 00README files of the lsof distribution. You might also find
it helpful to examine the machine.h header file for the dialect
You don’t need to use this procedure to customize lsof; you can
edit the machine.h header file directly. If you later decide you
want to use this procedure to customize machine.h, execute the
Do you want to customize (y|n) [y]? n
houston@charon:~/lsof/lsof_4.83K.sun > gcc -v
Using built-in specs.
Configured with: ../gcc-4.3.4/configure –with-gnu-as –with-as=/opt/csw/bin/gas –without-gnu-ld –with-ld=/usr/ccs/bin/ld –with-cpu=v7 –enable-threads=posix –enable-nls –prefix=/opt/csw/gcc4 –with-local-prefix=/opt/csw –enable-shared –enable-multilib –with-included-gettext –with-libiconv-prefix=/opt/csw –with-system-zlib –with-gmp=/opt/csw –with-mpfr=/opt/csw –enable-languages=c,c++,fortran,java,objc,ada –enable-bootstrap
Thread model: posix
gcc version 4.3.4 (GCC)
run gmake (output snipped):
houston@charon:~/lsof/lsof_4.83K.sun > gmake
Appears to have linked OK:
houston@charon:~/lsof/lsof_4.83K.sun > ldd lsof
libctf.so.1 => /lib/64/libctf.so.1
libkvm.so.1 => /usr/lib/64/libkvm.so.1
libelf.so.1 => /lib/64/libelf.so.1
libsocket.so.1 => /lib/64/libsocket.so.1
libnsl.so.1 => /lib/64/libnsl.so.1
libc.so.1 => /lib/64/libc.so.1
libmp.so.2 => /lib/64/libmp.so.2
libmd.so.1 => /lib/64/libmd.so.1
libscf.so.1 => /lib/64/libscf.so.1
libdoor.so.1 => /lib/64/libdoor.so.1
libuutil.so.1 => /lib/64/libuutil.so.1
libgen.so.1 => /lib/64/libgen.so.1
libm.so.2 => /lib/64/libm.so.2
Finally, we’ll copy it to a global zone and test it out:
root@snappy:~ > ./lsof_sparc -p 12151
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sshd 12151 root cwd VDIR 136,8 1024 2 /
sshd 12151 root txt VREG 136,8 359244 228943 /usr/lib/ssh/sshd
sshd 12151 root txt VREG 136,8 392036 22431 /usr/lib/security/pkcs11_softtoken_extra.so.1
sshd 12151 root txt VREG 136,8 41124 3067 /platform/sun4u/lib/libmd_psr.so.1
sshd 12151 root txt VREG 136,8 149428 2659 /usr/lib/security/pkcs11_kernel.so.1
sshd 12151 root txt VREG 136,8 20572 4091 /lib/libdoor.so.1
sshd 12151 root txt VREG 136,8 55312 2586 /usr/lib/libcryptoutil.so.1
sshd 12151 root txt VREG 136,8 155092 2612 /usr/lib/libpkcs11.so.1
sshd 12151 root txt VREG 136,8 135100 22434 /usr/sfw/lib/libcrypto_extra.so.0.9.7
sshd 12151 root txt VREG 136,8 42084 4110 /lib/libnvpair.so.1
sshd 12151 root txt VREG 136,8 100972 4105 /lib/libmd.so.1
sshd 12151 root txt VREG 136,8 1639032 4412 /lib/libc.so.1
sshd 12151 root txt VREG 136,8 37400 4123 /lib/libsecdb.so.1
sshd 12151 root txt VREG 136,8 33348 4080 /lib/libcontract.so.1
sshd 12151 root txt VREG 136,8 1444348 5037 /usr/sfw/lib/libcrypto.so.0.9.7
sshd 12151 root txt VREG 136,8 27100 4078 /lib/libcmd.so.1
sshd 12151 root txt VREG 136,8 77228 6346 /usr/lib/libgss.so.1
sshd 12151 root txt VREG 136,8 62504 2740 /usr/sfw/lib/libwrap.so.1.0
sshd 12151 root txt VREG 136,8 229232 4075 /lib/libbsm.so.1
sshd 12151 root txt VREG 136,8 52920 3101 /lib/libpam.so.1
sshd 12151 root txt VREG 136,8 870128 45032 /lib/libnsl.so.1
sshd 12151 root txt VREG 136,8 80200 3850 /usr/lib/libz.so.1
sshd 12151 root txt VREG 136,8 93924 4125 /lib/libsocket.so.1
sshd 12151 root txt VREG 136,8 16856 3066 /platform/sun4u/lib/libc_psr.so.1
sshd 12151 root txt VREG 136,8 280840 4071 /lib/ld.so.1
sshd 12151 root 0u VCHR 13,2 6815752 /devices/pseudo/mm@0:null
sshd 12151 root 1u VCHR 13,2 6815752 /devices/pseudo/mm@0:null
sshd 12151 root 2u VCHR 13,2 6815752 /devices/pseudo/mm@0:null
sshd 12151 root 3u IPv6 0x30005e8c980 0t47908 TCP snappy:ssh->insomnia.lan:43612 (ESTABLISHED)
sshd 12151 root 4r DOOR 0t0 58 /var/run/name_service_door (door to nscd) (FA:->0x3000236f580)
sshd 12151 root 5u FIFO 0x300016ca900 0t16 7062 (fifofs) PIPE->0x300016ca990
sshd 12151 root 6u FIFO 0x300016ca180 0t0 7067 (fifofs) PIPE->0x300016ca210
sshd 12151 root 7u FIFO 0x300016ca900 0t16 7062 (fifofs) PIPE->0x300016ca990
sshd 12151 root 8u FIFO 0x300016ca210 0t0 7067 (fifofs) PIPE->0x300016ca180
I finally reached melting point with the gnome which ships with Solaris 10, and so I decided to take a look at some other window managers.
A bit bored of Flux and Openbox, I finally settled on DWM.
For those of you who don’t know – DWM is an exceptionally lightweight window manager (weighing in at just over 2000 lines of C) which has no configuration outside of config.h, and should be pushed out with the next release over at blastwave (my sources tell me this will be today).
To get started:
# /opt/csw/bin/pkgutil -U
# /opt/csw/bin/pkgutil -i dwm-dtlogin
This will pull down DWM itself, the dtlogin integration files (/etc/dt/config), urxvt and the artwiz fonts. Select DWM from your sessions list in dtlogin, and press MOD4(Windows Key) + Shift + Enter to open a terminal.
I’ve added DMENU to the repo for those who want it, too.
Some obligatory screenies.
The patch for the zenburn-esque colour theme is here
Have fun! 🙂
Over at blastwave, we’ve been hard at work getting a new perl package togeather, and one of the things we like to do is have 64 bit binaries in the same package as the 32 bit binaries..
We achieve this with the help of a binary called isaexec; our packages install their binaries into (e.g for perl) /opt/csw/bin/sparcv9/perl and /opt/csw/bin/sparcv8/perl, and then a hard link is created as /opt/csw/bin/perl=isaexec in our package prototype.
When /opt/csw/bin/perl (which is actually isaexec) is run, it uses getexecname() and isaexec() to run the correct binary for that host.
On solaris 8 however, we noticed a bit of a strange problem. The /opt/csw/bin/perl link was working as expected, but when we use it in a script #!, we were seeing some unusl behaviour.
To demonstrate this, we’ll set up some isaexec links for bash:
root@mimas:/opt/csw/bin > cp bash sparcv8/bash_2
root@mimas:/opt/csw/bin > cp bash sparcv9/bash_2
root@mimas:/opt/csw/bin > ln isaexec bash_2
Next, a little script which calls the isaexec’d up /opt/csw/bin/bash_2:
houston@mimas:/tmp > cat test.sh
houston@mimas:/tmp > ./test.sh
/opt/csw/bin/bash_2: cannot find/execute “test.sh” in ISA subdirectories
To cut a very long story very short – there is no trivial way around this, the problem lies deep within exec on Solaris 8.
As a result, we’re making the sparcv8 binaries for perl (and anything else) the default for Solaris 8.
The v9 bins are still there, but if you want them you’ll need to use /opt/csw/bin/sparcv9/foo in your scripts.
Not a very interesting update, but I felt compelled to write something:
I’ve been back in the real world for a few weeks now, and of course the first thing I needed to do was set up a workstation.
Initially, my first choice was opensolaris-dev (in this instance, build 127) which turned out to be a rather painful experience. Besides the random crashes, 10 minute boot times and broken audio drivers, the real problem for me is that opensolaris has one of the worst packaging systems ever made.
Many people with much better prose than mine can explain the problems with IPS, if they weren’t painstakingly obvious from the moment you first used it – so I’ll leave that rant for another day.
So, I went off to sun.com and downloaded the latest Solaris 10 release and stuck it on my machine, and so far everything is working great – and compared to OpenSolaris it’s rock solid stable.
To make it more usable, the first thing I had to take care of was the lack of a decent terminal program, the gnome-terminal that ships with Solaris 10 is terribly dated, and when I’m inside vim and the cursor is over a comment, it disappears!
So I logged into the blastwave farm and made a package for urxvt, which should be available in the repo soon!
Some obligatory screenshots:
vim with a 256 color theme (zenburn)
Next up was to install the latest Firefox which you can download from their website.
My next task is to get a proper window manager on there, such as awesomewm – which’ll come when I find some free time! 🙂
That was a very long time without an update!
I shall be returning to the ‘real’ world soon; having found exactly how deep the rabbit hole goes, I’ve consumed the blue pill and am working on a return plan to the UK.
Bah! But, for the best 🙂
Expect some cool stuff soon, I will be returning to my old projects, finally!
Apologies for the lack of updates! (although, as of this moment hardly anyone is reading this, so I’m not sure exactly who I’m apologizing to!)
Things have been pretty crazy with quitting my job and getting prepared to relocate 10,081 miles from here in Scotland to Brisbane, Australia.
So, the gory details: I’m landing in Brisbane on the 13th if anyone wants to hook up for a beer, if not – I might catch you at the next QOSUG!
I’ll post some more Solaris related stuff as I get the chance.
In related news – we over at Blastwave have been rather busy, expect some cool new things (Including FreeNX!!!) soon!