SMF is a new feature to handle services for Solaris 10.
Fault managed resource identifiers (FMRI) identifies services:
svc :/system/system- log:default
svc:(Service type)
/system/system-log(Name)
:default(Instance)
The repository is the source for all known services on the system, it imports the service manifest into the database and then never references the manifest again.
File location
SMF log files(/var/svc/log)
SMF log files(/etc/svc/volatile)
SMF manifests(/var/svc/manifest/*)
SMF method(/lib/svc/method/*)
Daemons
start svc daemon :svc.startd
svc configuration daemon :svc.configd
Service Commands
Show the state of all services:svcs –a
Show detailed information:svcs –l
Show the dependencies:svcs –d
Show the dependents:svcs –D
show the processes of a service:svcs –p
Explain why the service failed: svcs –x
verbose information:svcs –v
Disable a service (stop):svcadm disable
Enabled a service (start):svcadm enable
restart a service:svcadm restart
Reread the config file (HUP):svcadm refresh
Put service into maintenance/degrade mode:svcadm mark
Start a service to the desired milestone level: svcadm milestone
Show values for a given property:svcprop –p
show details from a snapshot:svcprop –s
INETD services commands
List all configured inetd services:inetadm
Detailed information on a inetd service:inetadm -l
enable a inetd service:inetadm -e
disable a inetd service:inetadm -d
Administration
If a service fails to start:
# svcs –xv
To modify the properties of an inetd service:
# inetadm –m spray bind_addr=”192.168.0.1”
# inetadm –l spray
Repair a corrupt repository using the default repository:
Script # /lib/svc/bin/restore_repository (follow the prompts)
Note: all old repositories are in /etc/svc you can use an old one in place of the global
Manually
# pstop “ pgrep svc.startd”
# kill svc.configd
# cp /etc/svc/repository.db /etc/svc/repository.bad
Global zone
# cp /lib/svc/seed/global.db /etc/svc/repository.db
# reboot
Non-Global zone
# cp /lib/svc/seed/nonglobal.db /etc/svc/repository.db
# reboot (only reboot zone)
Start service interactively during boot
Ok> boot –m milestone=none (login as root)
# svcadm milestone –t all (enable all services)
# svcs –l (look for hanging services and check log files /var/svc/log)
continue with normal boot procedures
Other boot commands are:
Ok> boot –m verbose (verbose output)
Ok> boot –m debug (very verbose output)
Manifests:
To check the integrity of a manifest xml file:
# /usr/bin/xmllint mysvc.xml
To import your service manifest:
# /usr/sbin/svccfg -v import /var/svc/manifest/site/mysvc.xml
No comments:
Post a Comment