9

What are useful commands, tools, or tricks that one would find on Solaris or OpenSolaris that aren't available on a typical Linux distribution?

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208

15 Answers15

14

ZFS, DTrace and SMF are hardly hidden features since anyone who has ever heard of Solaris also has heard of them.

If you'd really like to get to know some hidden/less known features of Solaris, I recommend you read the Less known Solaris Features ebook by Jörg Möllenkamp.

joschi
  • 20,747
  • 3
  • 46
  • 50
  • 1
    The Less known Solaris Features ebook is one of the best books written on solaris, ever. – matt Nov 16 '10 at 11:51
13

Live Upgrade, which uses ZFS, creates writable snapshots of the operating system boot environment. With Live Upgrade, you can apply patches to a snapshot boot environment, then make that snapshot bootable. Upon the next reboot you get a patched OS environment. If you discover an issue with a patch, you can make the old snapshot bootable, reboot and you've backed out your changes. Its a pretty impressive solution to patching.

ZFS for the boot environment requires Solaris 10u6 or newer.

Also, Solaris Zones are pretty useful for application isolation. Obviously DTrace is very nice but RedHat is playing catchup with System Tap.

Matt
  • 436
  • 3
  • 8
7

Don't forget SMF (Service Management). I have yet to see something comparable for linux (any pointers gratefully accepted). It did save me (and colleagues) a lot of ticket handling :)

Vincent De Baere
  • 1,783
  • 9
  • 9
  • I believe apples framework is available os open source. http://developer.apple.com/MacOsX/launchd.html – Martin M. Jun 09 '09 at 19:33
  • nice read! I'll look into it, but at first sight, it does not offer all the functionality of SMF (eg. retries) – Vincent De Baere Jun 10 '09 at 08:32
  • As someone who recently switched to OpenSolaris, I'm loving SMF. I also happen to administer a bunch of OS X servers, and yes launchd supports retrying a service start if it fails, if that's what you mean. – Kamil Kisiel Jun 26 '09 at 06:36
  • Init scripts wrapped in xml controlled by a shite program that gives useless error messages? I hope that I never find anything like that in linux. – theotherreceive Jun 28 '09 at 06:27
  • upstart does about the same thing, at least the dependency based bit.. – Cian Sep 08 '09 at 09:14
6

There are a number of features that Solaris has that Linux people wish they had. These include:

  • ZFS: a filesystem that provides extreme flexibility, more than anything now available. Dynamic growth and reduction, snapshots, clones, and more - all available for free.
  • DTrace: a debugger that can present you with details on how the kernel is working. Because of the way the kernels are written, DTrace is inherently much more flexible than SystemTap.
  • SMF: yet another system to replace System V init scripts - but this one seems to have more people interested in it than any of the others.
  • Zones and Containers: these are very flexible and have a lot of people excited: they provide for very flexible virtualization.
Mei
  • 4,560
  • 8
  • 44
  • 53
  • I have yet to find a linux person who wises they have SMF. And OpenVX is a good zone/container replacement. – Cian Sep 08 '09 at 09:14
5

A few personal experiences...

I find Zones so easy and useful that I've simply created one for each service I am running at home - this way I can play and test things out without trashing it all. One of the zones is reverse proxy (Sun Web Java Proxy) so that I can play with different web servers easily.

Also I find the opencsw (previously known as Blastwave) packages hierarchy much better that anything yet seen - it always takes care of all the dependencies.

And - not to forget - binary compatibility. If an app is specified to need Linux with kernel 1.2.3_4 you better have it. On Solaris everything just works on future releases. For me this means upgrade when I want and no stress doing it.

Here are several interesting documents if you want to dig deeper: Less known Solaris features

Just for taste - Adminstration specials:

Live Upgrade Service Management Facility Resource Management pfiles fuser /export/home? /home? autofs? lockfs About cores and crashes CacheFS Jumpstart Enterprise Toolkit

(do I sound like an ad? sorry...)

slovon
  • 957
  • 5
  • 12
4

The two biggest, compelling reasons for Solaris seem to be DTrace and ZFS, neither of which is directly available for Linux.

jtimberman
  • 7,511
  • 2
  • 33
  • 42
4

kstat to get all kinds of awesome kernel statistics.

X-Istence
  • 752
  • 1
  • 8
  • 18
3

Not necessarily hidden, but not obvious to Linux people are the process observation utilities: pstack, pmap, pflags, pfiles, pcred, psig, and pldd. Also prstat, which is more or less equivalent to top, but can also aggregate resource usage by user, zone, project, and display microstate accounting.

Look at projects and tasks for managing lots of applications in one OS instance.

I don't know of an equivalent to coreadm in Linux, though it's probably scattered around /proc somewhere.

Logadm is a bit obtuse but a good replacement for logrotate, and generally more powerful/flexible.

The arrangement of multi-level security (roles, authorizations, profiles) is different from Linux (SELinux contexts, AppArmor).

THe Image Packaging System (IPS) in OpenSolaris is pretty neat, but still under heavy development.

Also, +1 for LiveUpgrade. It's great, especially with ZFS snapshots.

Most of the GNU userland stuff you're used to is available, and probably installed by default on a sufficiently new Solaris.

Rob Chanter
  • 487
  • 4
  • 8
2

Fast Reboot for OpenSolaris skips the normal HW Probing/BIOS POST/GRUB process on x86 hardware, allowing for reboots to occur in <10sec instead of ~2mins. Even supports booting alternate Boot Environments (e.g. reverting a botched upgrade).

notpeter
  • 3,505
  • 1
  • 24
  • 44
  • It even supports panic reboot! More info about how it works from a presentation Sherry Moore (project lead) gave to the NYC OpenSolaris users group: http://www.scribd.com/doc/16925842/DeveloperDayFastreboot – notpeter Jun 29 '09 at 16:57
  • However, Linux can do that, too. Look out for "kexec". – knweiss Jul 05 '09 at 22:04
1

ZFS and SMF are great, but a real pain with solaris is that package manager is ages behind its linux counterparts.

Also all utilities are different in subtle ways(killall anyone?), if you admin linux machines most of the time, switching to solaris means reading man pages again and again. A sucky "more" pager and always slightly misconfigured terminals make your life difficult.

hayalci
  • 3,611
  • 3
  • 25
  • 37
  • I dunno, "export PAGER=less" works well enough for me. And you're better off with pkill than killall on Solaris. You're right about the sucky termcap/terminfo stuff tho (no terminfo for screen? GTFO!). – Rob Chanter Jun 09 '09 at 07:30
  • regarding killall I moved to procps which provides: pkill, pgrep. Those should be avaible with the GNU tools under Solaris I find those to be much better than killall – Martin M. Jun 09 '09 at 19:35
  • pkill (and pgrep and the other p-utilities) are part of the core system package on (Open)Solaris. They're (at least pkill/pgrep/pmap) in procps on Linux. – Rob Chanter Jun 10 '09 at 02:19
  • 1
    Solaris package manager is getting a major overhaul in OpenSolaris/Solaris 11. – Toto Jun 12 '09 at 13:05
1

Solaris Crash Analysis Tool - best tool to assist the analysis of Solaris kernel crash dumps.

Aaron
  • 229
  • 3
  • 9
1

kssl, kernel SSL module. Quote from ksslcfg(1M)

ksslcfg manages smf(5) instances for the Kernel SSL proxy module. An SSL-enabled web server can use the services of its Kernel SSL proxy to improve the performance of the HTTPS packets processing.

philant
  • 109
  • 7
1

Unlike Linux, "lsof -o" (show file offsets) works. This can be useful for showing how far along a process is when it's reading or writing large amounts of data.

Gerald Combs
  • 6,331
  • 23
  • 35
0

Probably the biggest trap for new players, a typical Linux user might be tempted to run killall on a Solaris host;

System Administration Commands                        killall(1M)

NAME
     killall - kill all active processes

SYNOPSIS
     /usr/sbin/killall [signal]

DESCRIPTION
     killall is used by shutdown(1M) to kill all active processes
     not directly related to the shutdown procedure.

     killall terminates all processes with open files so that the
     mounted file systems will be unbusied and can be unmounted.

     killall sends signal (see kill(1)) to the active  processes.
     If no signal is specified, a default of 15 is used.

     The killall command can be run only by the super-user.

ATTRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:

     ____________________________________________________________
    |       ATTRIBUTE TYPE        |       ATTRIBUTE VALUE       |
    |_____________________________|_____________________________|
    | Availability                | SUNWcsu                     |
    |_____________________________|_____________________________|

SEE ALSO

     kill(1), ps(1), fuser(1M), shutdown(1M), signal(3C),  attri-
     butes(5)

SunOS 5.10          Last change: 14 Sep 1992                    1
realist
  • 23
  • 4
0

The consolidated "Less known Solaris Features" tutorials is helpful.

Brian Carlton
  • 161
  • 2
  • 12