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 usesvcs -?
or see man page.
- svcadm: to manipulate (enable/disable/restart/refresh/milestone/clear) services.
marco@IbmSolaris:~$ svcadm restart apache2
- 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).
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).