||[Feb. 20th, 2009|04:17 pm]
Unix/Opensolaris nerdage below the cut
Being a Sun fandrogyne you can be fairly sure that I like a lot of features on Opensolaris (unless they break, partially because if it's a problem with core solaris, it's more than probably the result of an oversight of myself or one of my co-workers). In fact, I don't understand half the features, but when I get to grips with one, I find myself absolutely loving it.
Case in point, until I got to understand SMF for system startup, I was happy with /etc/init.d stuff until someone explained what exactly was going on with it. It parallelises startup on multi-cpu processes, and doesn't hurt on single-cpu systems (although even in the x86 world you'd have to look hard to find a single-core system these days). So what SMF does is calculate dependency trees of the services to start, and don't make any guarantees on the order of startup beyond "I'll make sure that what you need to start up is running".
Now, the hardcore folk will say, "Yeah, big deal, it doesn't make sense to have init.d any more, most common linux distros don't do it. Ubuntu and its derivatives use upstart, which does the same thing, doesn't it? Gentoo has its own dependency-based non-serial startup bits as well." But that's only half the story of smf. The next part is pretty cool.
SMF also makes the guarantee that when something goes up, it does its best to stay up. It uses this concept called kernel contracts to monitor how the daemons are running. Basically, if the program fails, the contract can be arranged so that it's automatically restarted, or that it informs smf, just in case it's listed as a dependency of another service, so it'll restart the dependants, if you want it to. Of course, that can all be configured. Which gets into the mysterious svccfg command.
Pretty much everything is configurable through this command. You can determine how you start the server, and you can even keep different profiles of the same server. So if you REALLY wanted you could have a service called apache22:default, but then decide you want apache22:32bit.
So why do I mention all this? Well, I was looking through some AMP stuff today, and was reminded of how cool smf can be when I saw this section of the Opensolaris AMP Stack setup page. It just strikes me as incredibly elegant.
Maybe, I have an odd sense of technical elegance, but it appeals to how I think at the moment.
And now, I'm really glad there's a good desktop environment to go with the OS - Solaris has a lot of cool features, except that for ages it wasn't really that accessible even for linux users, and they know their stuff. Now, things are beginning to feel like this is a good solid system. All it needs is a little more userland IPS repositories, and this will start to really take off. Couple that with the fact that you can use BrandZ to emulate a linux environment (for instance: how to run linux skype on Opensolaris), the open-source world really is your oyster.
Now, I can't wait 'til the next Opensolaris release - it'll FINALLY have support for reading extended partitions.
Note - Any links I provide are to show that I'm using publicly available information and nothing of a nature that could be considered a trade secret. This is stuff that should be public knowledge, but I want to make more people to be MORE aware of it. This is good stuff people! Enjoy it!