20100128

SMF - Service Management Facility administration

Sun Solaris 10, Opensolaris and successors have a new mechanism to manage services: SMF. So the first thing you could notice is that there are no more /etc/rc?.d but only a daemon that you have to use to start all the services you need. Infact /etc/rc?.d and /etc/inetd.conf are empty! The first issue I found running Opensolaris was to start gdm daemon and login in text mode: I kill it from a gui terminal emulator but gdm has restarted soon soon! So, how to stop it?!?! It is necessary to use SMF administration commands(svcs | svcadm | svccfg):

  • svcs: print the state of all services and for each service it is possible to see its dependencies from other services, including reasons for failure.
    Examples:

    marco@IbmSolaris:~$ svcs -l hal
    fmri svc:/system/hal:default
    nome Hardware Abstraction Layer daemon
    abilitato vero
    stato online
    next_state none
    state_time 05 gennaio 2010 1:11:51 CET
    logfile /var/svc/log/system-hal:default.log
    programma di riavviosvc:/system/svc/restarter:
    default contract_id 62
    dependency require_all/none svc:/system/filesystem/local (online)
    dependency require_all/none svc:/system/device/local (online)
    dependency require_all/none svc:/system/dbus (online)

    marco@IbmSolaris:~$ svcs -x hal
    svc:/system/hal:default (Hardware Abstraction Layer daemon)
    Stato: online da 05 gennaio 2010 1:11:51 CET
    Vedere: hal(1M
    Vedere: /var/svc/log/system-hal:default.log
    Impatto: nessuno.

    marco@IbmSolaris:~$ svcs -d hal
    STATE STIME FMRI
    online gen_05 svc:/system/device/local:default
    online gen_05 svc:/system/filesystem/local:default
    online gen_05 svc:/system/dbus:default

    marco@IbmSolaris:~$ svcs -D hal
    STATE STIME FMRI
    disabled gen_05 svc:/network/device-discovery/printers:snmp
    online gen_05 svc:/system/filesystem/rmvolmgr:default
    online gen_05 svc:/application/graphical-login/gdm:default

    For more use svcs -? or see man page.
  • svcadm: to manipulate (enable/disable/restart/refresh/milestone/clear) services.
    marco@IbmSolaris:~$ svcadm restart apache2
  • Notice that for both commands it is possible to pass the name of the service in different name forms according to the service's FMRI (Fault Managed Resource Identifier).
  • svccfg: to import, export, and modify service configurations repository(with XML). It is possible to call it in interactive mode(for exmaple run it wihtout parameters).
That's a new and good way to manage services. Funny! No?!?

20100127

My shell doesn't get inputs!

It could happen that, after system upgrade or "hacking", your terminal emulator like gnome-terminal maybe presents a message like this:

readline: warning turning off output flushing

The solution may be the following: it is necessary to check the rights on pseudo terminal pseudo-device:

marco@IbmSolaris:~$ ls -lL /dev/ptmx

If the output you get is not the same like this

crw-rw-rw- 1 root sys 11, 8 2010-01-26 15:31 /dev/ptmx

you should be able to use xterm to change them. See man pty for more.