I've used Linux as my main OS for over ten years. I also have some experience with other Unix systems - Solaris included - but I'm far from the level of familiarity I have with Linux. There are some notable, sometimes annoying differences in location of files, command parameters and underlying concepts, I need to use man or other docs way more often than with Linux. I decided to write down what I learned to piece together my knowledge and to create a handy reference for myself. If you'll find it useful too, that's an added bonus.
Filesystem layout
At a first glance, filesystem in Solaris looks like a mess. After a full install there are about 50 directories or symlinks in /usr, some of which clearly shouldn't be there (e.g. /usr/spool), /var and / are not much better. The reason is Solaris users really value backwards compatibility. Directories in Linux conform to Filesystem Hierarchy Standard. Whenever it is updated, there are backward compability symlinks for a year or two, then they get dropped. In Solaris you can use the same paths as in 1985 BSD od 1993 SunOS - or 2010 Linux, for that matter.
One other difference is that software is often divided by vendor, technology or usage. On Linux, almost all executables land in /usr/bin, their libraries in /usr/lib and other files in /usr/share. In Solaris, you have:
- /usr/ for the usual stuff
- /usr/css for Sun's development tools
- /usr/dt, /usr/gnome, /usr/openwin for desktop environments (/usr/dt is for CDE - no idea why)
- /usr/jdk, /usr/java, /usr/perl5 for Java and Perl
- /usr/ucb* for BSD utils (ucb stands for University of California Berkeley)
- /usr/sfw for GNU apps (sfw stands for Sun Freeware, I think there's a company policy for using misleading directory names)
Some claim it's more tidy. Others think it's a pain in the ass and I'm one of them:
- You have to put dozen directories in your $PATH.
- Often you end up with 2 or 3 versions of the same tool (eg. one from Sun, other from BSD or GNU and another from Blastwave). Sun's remedy? Most GNU tools have names starting with "g" (e.g. grep is from Sun, ggrep is GNU).
There's also no /root directory. Superuser's home is /. That's because you're not supposed to login as root. If you really want to, you can create it and modify /etc/passwd.
See more details in this entry. The whole Ben Rockwood's blog is worth a read.
Init system - SMF
System startup, on the other hand, is an area that Sun's got right. Some Linux distros, lead by Ubuntu, are migrating to a new init system called upstart. Others still use SystemV scripts. And don't even get me started on Slackware. Solaris has already converted to a new model called SMF - Service Management Facility. It has all the features planned for upstart and much more:
- parallel startup,
- dependencies - e.g. service A will always start after service B
- failed daemons are automatically restarted
- ability to control a specific service can be delegated to a non-root user
- snapshots of service configurations
- debugging and logging features
Quick intro:
Enabling/disabling the service: svcadm [enable|disable] [service name]
Service status: svcs [service name]
List of services (both running and disabled): svcs -a
More details at Sun Bigadmin website
Shell
Another annoying weakness for me and praised historical compatibilty for others. Default shell on Solaris is the old-style Bourne shell with no command history, no tab completion, no nothing. First thing I do on Solaris is
usermod -s /usr/bin/bash rootYou may find warnings on the web not to do it. Some people say it'd break scripts, others think /bin/sh is safer, because it's statically linked. Feel free to mock them:
- scripts have a #!/bin/sh line and don't care about login shell,
- Solaris 10 is smart enough to fall back to /bin/sh if bash doesn't work. And sh is not even static anymore:


0 komentarze:
Post a Comment