I've put some distro-const scripts to the github repo at https://github.com/alhazred/firefly for anyone who wants to build their own illumos-based failsafe image. Current stuff was tested on OmniOS but also should work on OpenIndiana. Anyway the code can be simplified, so any pull-requests and customization are welcome.
Monday, July 27, 2015
Thursday, January 15, 2015
Get pid, user and command for the particular port in illumos
While the Solaris has the updated netstat with -u flag, illumos requires certain improvements in sockinfo, and possibly, rpcbind (tcpConnCreationProcess shows the old PID for rpcbind, until it did not become a demon). With help of pfiles is possible to obtain the desired information about pid for particular port, so I wrote a small pfiles-based utility which allows to determine the PID, user and command for the particular port:
# ./ptcpstat PROTO IP PORT PID USER COMMAND -------- ------------------- ----- ------ -------- ------------------ AF_INET 127.0.0.1 25 692 root /usr/lib/smtp/sendmail/sendmail -bl -q15m AF_INET6 ::1 25 692 root /usr/lib/smtp/sendmail/sendmail -bl -q15m AF_INET 127.0.0.1 587 692 root /usr/lib/smtp/sendmail/sendmail -bl -q15m AF_INET6 :: 22 605 root /usr/lib/ssh/sshd AF_INET6 :: 0 495 root /usr/lib/inet/in.ndpd AF_INET 0.0.0.0 520 637 root /usr/sbin/in.routed AF_INET 0.0.0.0 0 637 root /usr/sbin/in.routed AF_INET 0.0.0.0 10004 685 root /usr/bin/python2.6 /usr/lib/pkg.depotd --cfg svc:/application/pkg/server:test AF_INET 0.0.0.0 10000 9354 root /usr/bin/python2.6 /usr/lib/pkg.depotd --cfg svc:/application/pkg/server:zfs AF_INET6 ::ffff:198.168.1.1 22 2315 root /usr/lib/ssh/sshd AF_INET6 ::ffff:10.8.0.30 56027 2315 root /usr/lib/ssh/sshd AF_INET 0.0.0.0 80 1402 root /usr/bin/python2.6 /usr/lib/pkg.depotd --cfg svc:/application/pkg/server:defaul AF_INET6 ::ffff:198.168.1.1 22 2314 root /usr/lib/ssh/sshd AF_INET6 ::ffff:10.8.0.30 56027 2314 root /usr/lib/ssh/sshd
Monday, May 19, 2014
How to prevent an IPS package from being upgraded
Recently I had a situation where some incorporating package depends on
a package, say foo, version 3.1 and I had to wait for the update
exactly to 3.2 and do not allow 3.1.1, 3.1.2, ...
"Freeze" option doesn't help here (may be should?) but it's a possible to use some versioning tricks in incorporating manifest.
First option is to ensure that required version of 'foo' is published with trailing zero:
foo@3.1.0
foo@3.1.1
foo@3.1.2
Then we can use "depend fmri=foo@3.1.0 type=incorporate" line in incorporating manifest and only upgrade to this version will be allowed.
More reliable option (and you don't need trailing zeros) is to use the timestamp in incorporate dependency:
depend type=incorporate fmri=foo@3.1:20140507T021327Z
Only upgrade to version 3.1 with specific timestamp will be allowed here.
If foo@3.2 will be published and we want to wait until 3.3, then we can publish a new version of the incorporating package using next dependencies:
depend type=require fmri=foo@3.2
depend type=incorporate fmri=foo@3.2.0
P.S. Many thanks to @binarycrusader
"Freeze" option doesn't help here (may be should?) but it's a possible to use some versioning tricks in incorporating manifest.
First option is to ensure that required version of 'foo' is published with trailing zero:
foo@3.1.0
foo@3.1.1
foo@3.1.2
Then we can use "depend fmri=foo@3.1.0 type=incorporate" line in incorporating manifest and only upgrade to this version will be allowed.
More reliable option (and you don't need trailing zeros) is to use the timestamp in incorporate dependency:
depend type=incorporate fmri=foo@3.1:20140507T021327Z
Only upgrade to version 3.1 with specific timestamp will be allowed here.
If foo@3.2 will be published and we want to wait until 3.3, then we can publish a new version of the incorporating package using next dependencies:
depend type=require fmri=foo@3.2
depend type=incorporate fmri=foo@3.2.0
P.S. Many thanks to @binarycrusader
Thursday, May 30, 2013
Firefly: failsafe image for illumos-based distros
If somebody is looking for illumos-based filesafe image, I've created small iso (usb image is available also) at sourceforge. This image provides the same method as old Solaris iso's: looks for bootable root pool, imports it to /a and mounts bootfs:
I hope someone will find this image useful for recovery purposes on any illumos-based distributions.
I hope someone will find this image useful for recovery purposes on any illumos-based distributions.
Friday, September 21, 2012
illumos grep(1) now able to traverse directories
This week I updated illumos grep(1), having added support for recursive searching:
$ man -M /usr/share/man grep
...
... $ man -M /usr/share/man grep
...
-r Read all files under each directory, recursively. Fol- low symbolic links on the command line, but skip sym- links that are encountered recursively. If file is a device, FIFO, or socket, skip it. -R Read all files under each directory, recursively, fol- lowing all symbolic links.
Enjoy!
Tuesday, September 4, 2012
Sunday, February 26, 2012
illumian, a new illumos based distro
This iso has become a rarity: as you know, NCP4 never saw the light:

Nevertheless illumos has now the second distribution - illumian, where the packaging system is the main difference from the OpenIndiana and the first iso has a very simple text-mode installer developed by Nexenta for the NCP distribution.
I hope illumian will continue to grow and improve, and for people who like Solaris but feel it could use a more practical "apt-get", illumian is exceptional.
If you're interesred in joining, feel free to talk in #illumian, or subscribe and make a post to the illumian-dev mailing list.
Nevertheless illumos has now the second distribution - illumian, where the packaging system is the main difference from the OpenIndiana and the first iso has a very simple text-mode installer developed by Nexenta for the NCP distribution.
I hope illumian will continue to grow and improve, and for people who like Solaris but feel it could use a more practical "apt-get", illumian is exceptional.
If you're interesred in joining, feel free to talk in #illumian, or subscribe and make a post to the illumian-dev mailing list.
Thursday, June 30, 2011
Bring back lx brand?
It is hard to say why the BrandZ code was removed from the OpenSolaris. However this can be corrected. With small fixes I've now got CentOS running in a zone on Illumos:
The Illumos Project SunOS 5.11 illumos-gate June 2011
root@indy:~# zoneadm -z centos boot; zlogin -C centos
[Connected to zone 'centos' console]
Welcome to CentOS
Press 'I' to enter interactive startup.
Configuring kernel parameters: [ OK ]
Setting hostname centos: [ OK ]
Checking root filesystem: [ OK ]
Activating swap partitions: [ OK ]
...
CentOS release 3.7 (Final)
Kernel 2.4.21 on an i686
centos login: root
Password:
Welcome to your shiny new Linux zone.
- The root password is 'root'. Please change it immediately.
- To enable networking goodness, see /etc/sysconfig/network.example.
- This message is in /etc/motd. Feel free to change it.
For anything more complicated, see:
http://opensolaris.org/os/community/brandz/
You have mail.
-bash-2.05b# cat /proc/cpuinfo
processor : 3
vendor_id : GenuineIntel
cpu family : 6
model : 30
model name : Intel(r) Core(tm) i7 CPU Q 720 @ 1.60GHz
stepping : 5
cpu MHz : 1596.146
cache size : 0 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 11
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm pni monitor ds_cpl est tm2 cx16 xtpr
...
Tuesday, July 13, 2010
Sample client for istatd
IPhone owners can use a great app for servers monitoring - istat. On the server you must install the istatd daemon. More information can be read here: http://blogs.sun.com/karim/entry/monitoring_opensolaris_from_an_itouch.
Here an example of a console client for istatd, you can use this data for plotting, etc:
$ gcc -o istatd_client istatd_client.c -lsocket -lnsl
$ ./istatd_client
Usage: istatd_client <server_ip> <server_port> <server_code>
Example output from OpenSolaris server:
Looking through istatd code, you can easily recognize what's mean all these variables (for example "u" in <CPU> denotes cpu_user usage).
Here an example of a console client for istatd, you can use this data for plotting, etc:
$ gcc -o istatd_client istatd_client.c -lsocket -lnsl
$ ./istatd_client
Usage: istatd_client <server_ip> <server_port> <server_code>
Example output from OpenSolaris server:
/istatd_client XX.XXX.XX.X 5109 12345
Connected to XX.XXX.XX.X on port 5109
<?xml version="1.0" encoding="UTF-8"?><isr ready="1"></isr>
<?xml version="1.0" encoding="UTF-8"?><isr pl="2" ath="0" ss="6" c="7788968" n="7788967"></isr>
<?xml version="1.0" encoding="UTF-8"?><isr ds="8" ts="8" fs="8" rid="1"><CPU><c id="-1" u="1" s="3" n="0"></c></CPU><NET if="1"><n id="-1" d="12545352948" u="276928235931" t="1279010768"></n></NET><MEM w="1568" a="326" i="0" f="190" t="2086" su="51" st="1043" pi="79363" po="17312"></MEM><LOAD one="0.230469" fv="0.238281" ff="0.234375"></LOAD><UPT u="7788967"></UPT><DISKS><d n="/" uuid="rpool/ROOT/opensolaris-1" f="43352" p="21.1999"></d><d n="/hosting" uuid="hosting" f="134024" p="4.63293"></d></DISKS></isr>
...
Looking through istatd code, you can easily recognize what's mean all these variables (for example "u" in <CPU> denotes cpu_user usage).
Wednesday, June 16, 2010
Osstat 0.3
Osstat Gnome applet now reaches version 0.3 - minor fixes, new graphs and some features.

Feel free to optimize code or change parts to use better ways.
Download here.

Feel free to optimize code or change parts to use better ways.
Download here.
Thursday, April 15, 2010
Using ddu scripts
Have you ever looked in the "/usr/ddu" directory? Console-lovers can use some of these scripts and get the almost same output as from the "ddu" graphic utility. For example, I changed the probe.sh script a bit and now I can get ddu-like info from console:
(root@elvis)# ./ddu.sh
AUDIO
Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller : audio810
CPU
1 X Intel(R) Celeron(R) CPU 2.26GHz, 1-core : ---
CD_DVD
Intel Corporation 82801DB (ICH4) IDE Controller : pci-ide
Optiarc DVD RW AD-5200A : 0
MEMORY
1G (512M + 512M) ; 2G maximum : ---
NETWORK
Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ : rtls
STORAGE
Intel Corporation 82801DB (ICH4) IDE Controller : pci-ide
USB
Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 : uhci
Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 : uhci
Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 : uhci
Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller : ehci
VIDEO
Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device : i915
OTHERS
PC standard floppy disk controller : fdc
16550A-compatible COM port : asy
ECP printer port : ecpp
PS/2 Port for PS/2-style Mice : mouse8042
System keyboard : kb8042
(root@elvis)#
Subscribe to:
Posts (Atom)
How to determine PXE mac address when booting illumos via PXELinux/iPXE
In illumos, if you need to determine the interface which was used for booting via PXE then it's possible to use "boot-mac" pro...
-
I've tried to compile the last Conky 1.7.2 version with Lua Cairo bindings on OpenSolaris and should say it impress me. It was necessary...
-
This summer I decided то build something compact and modern for my two SunFire servers using IPS. Meet v9os - minimalist illumos-based ...

