80 Pages

smf_workshop

Course: CIS 361, Fall 2009
School: Delaware
Rating:
 
 
 
 
 

Word Count: 5154

Document Preview

Management Solaris Facility (SMF) - Workshop Ganesh Hiregoudar Renaud Manus OP/N1 RPE Approachability Sun Microsystems Thanks! We would like to thanks the following engineers who participated in writing and delivering this SMF workshop. > Jarod Nash, > Jason Banham, > Lee Brooks, > Rhodri Davies, > Phill Hughes Terminology Service > Object (application, software state...

Register Now

Unformatted Document Excerpt

Coursehero >> Delaware >> Delaware >> CIS 361

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Management Solaris Facility (SMF) - Workshop Ganesh Hiregoudar Renaud Manus OP/N1 RPE Approachability Sun Microsystems Thanks! We would like to thanks the following engineers who participated in writing and delivering this SMF workshop. > Jarod Nash, > Jason Banham, > Lee Brooks, > Rhodri Davies, > Phill Hughes Terminology Service > Object (application, software state of a device, set of other services) that can be managed and observed. Instance > Child of service object. FMRI (Fault Managed Resource Identifier) > 3 components: svc: /system/system-log :default Restarter Service Type Name Instance > Service responsible for restarting service(s) Terminology (cont.) Dependency > Formal description of the other services that are required to start a service Milestone > Predefined set of capabilities for a set of services. Contract > Mechanism within the kernel for restarters to stay informed about the service instances they start. Terminology (cont.) Manifest > Description and initial configuration file for a service. Delivered with the product in the form of an XML file. Repository > Configuration database for all services. Allows setting to remain persistent across reboots. Snapshot > Historical data about each service instance in the repository for administrative inspection and rollback. Key files and directories /var/svc/manifest/* /lib/svc/method/* /var/svc/log/* /var/svc/profile/* /etc/svc/repository.db > Global configuration database /lib/svc/see/global.db > Minimal configuration database New filesystems /etc/svc/volatile > Contains transient data, eg. lock files, init state and some log files. Allocated from swap. /system/contracts > Primary interface into contract subsystem, to allow service instances to be restarted. Indirectly related to SMF. SMF commands svcs : report the status of service instances svcadm : manipulate services instances > eg. enable, disable, restart, ... svccfg : manipulate the repository > eg. import, export, configure, ... services svcprop : display properties for a given service instance inetadm : report and configure inetd based services inetconv : convert and import services from inetd.conf Commands: svcs(1) List enabled or all (-a) instances, sorted by state, time Explanations for errors/states (-x) Show dependencies (-d) and dependents (-D) Show member processes (-p), additional details (-v/-l) $ svcs STATE STIME .... online 18:18:30 online 18:18:29 .... $ svcs -p sendmail STATE STIME online 18:18:29 18:18:29 18:18:29 FMRI svc:/network/http:apache2 svc:/network/smtp:sendmail FMRI svc:/network/smtp:sendmail 100180 sendmail 100181 sendmail $ svcs -d sendmail STATE STIME FMRI online 18:17:44 svc:/system/identity:domain online 18:17:52 svc:/network/service:default .... Commands: svcs(1) You can use a pattern which uses globbing rules to build regular expressions svc:/ is automatically added to the pattern if omitted Examples: $ svcs '*print*' $ svcs cron $ svcs dns/client Commands: svcadm(1M) Enable, disable, refresh, restart service instances Mark in special states (maintenance) Synchronously wait for changes (-s) $ grep lianep /etc/user_attr lianep::::auths=solaris.smf.modify,solaris.smf.manage $ svcs apache2 STATE STIME FMRI ? svc:/network/http:apache2 $ # create /etc/apache2/httpd.conf $ svcadm enable apache2 STATE STIME FMRI online 19:19:01 svc:/network/http:apache2 $ # edit /etc/apache2/httpd.conf $ svcadm refresh apache2 $ svcs apache2 STATE STIME FMRI online 19:19:33 svc:/network/http:apache2 $ svcadm disable apache2 $ svcs apache2 STATE STIME FMRI disabled 19:20:07 svc:/network/http:apache2 See also http://blogs.sun.com/roller/page/sch/20040923 Commands: svcadm(1M) actions enable: allow start once dependencies are satisfied disable: stop service and do not allow it to start again > -t: enable/disable until the system is rebooted > -s: enable/disable synchronously (wait for it...) refresh: reload service configuration and run the refresh method (if any) restart: stop the service, then allow it to start once its dependencies are satisfied (no configuration change made) clear: mark service as repaired Commands: svcadm(1M) milestone Milestone: A service which specifies a collection of dependencies which declare a specific state of system-readiness > init S, boot -s and friends still work Major milestones, which are analogous to system runlevels can be reached directly > from boot (-m milestone=), > the standard init invocations, > or via svcadm: milestone/single-user, milestone/multi-user, milestone/multi-user-server See also http://blogs.sun.com/roller/page/lianep/20050204 Commands: svcprop(1) List properties of services and instances Fetch in convenient forms for scripting View running or current props (-c), uncomposed (-C) $ svcprop network/http:apache2 ... physical/entities fmri svc:/network/physical:default physical/grouping astring optional_all physical/restart_on astring error physical/type astring service start/exec astring /lib/svc/method/http-apache2\ start start/timeout_seconds count 60 start/type astring method stop/exec astring /lib/svc/method/http-apache2\ stop stop/timeout_seconds count 60 stop/type astring method restarter/auxiliary_state astring none restarter/next_state astring none restarter/state astring disabled restarter/state_timestamp time 1102030556.737590000 $ svcprop -p enabled network/http:apache2 false Administration exercise Write a script which: > > > > prints the start/exec property for sendmail enables sendmail waits for the service to start prints the service state Administration exercise Write a script which: > > > > prints the start/exec property for sendmail enables sendmail waits for the service to start prints the service state #!/bin/ksh /usr/bin/svcprop -p start/exec svc:/network/smtp:sendmail /usr/sbin/svcadm enable -s svc:/network/smtp:sendmail if [ $? -ne 0 ]; then echo sendmail failed to start fi /usr/bin/svcprop -p restarter/state svc:/network/smtp:sendmail Commands: inetadm(1M) List services managed by inetd View (-l) and modify (-m) inetd-specific properties $ inetadm ... enabled enabled disabled disabled enabled disabled enabled online online disabled disabled online disabled online svc:/network/ftp:default svc:/network/finger:default svc:/network/login:eklogin svc:/network/login:klogin svc:/network/login:rlogin svc:/network/rexec:default svc:/network/shell:default $ inetadm -l ftp SCOPE NAME=VALUE name="ftp" endpoint_type="stream" proto="tcp6" isrpc=FALSE wait=FALSE exec="/usr/sbin/in.ftpd -a" user="root" ... default tcp_wrappers=FALSE svccfg(1M) svccfg manipulates the repository Uses sub-commands to perform actions Common sub-commands select <fmri> list listprop setprop delete validate <file> import <file> unselect : select a service / instance : show children of the selected service : display the properties for a service : change a property value for a service : delete a service / instance : validate an XML manifest file : import a manifest file into repository : navigate to parent of current selection Commands: svccfg(1M) Import, export manifests; apply, extract profiles Interactive mode for modifying properties $ svccfg -v import /var/svc/manifest/network/http-apache2.xml svccfg: Refreshed network/http:/apache2 svccfg: Successful import. $ svccfg svc:> select network/http:apache2 svc:/network/http:apache2> listprop ... general framework general/enabled boolean false ... start method start/exec astring "/lib/svc/method/http-apache2 start" start/timeout_seconds count 60 start/type astring method svc:/network/http:apache> editprop [$EDITOR launches, allows direct editing of properties] svc:/network/http:apache2> exit $ svcadm refresh apache2 $ svcadm restart apache2 # read changed config # restart with changed config svccfg(1M): example (cont.) To change a property value: > Use the listprop sub-command to view properties > Use the setprop sub-command to set values Example: Increase the file descriptor limit for lpsched # svccfg svc:> select application/print/server svc:/...> listprop svc:/...> setprop lpsched/fd_limit = 8192 svc:/...> quit # svcadm refresh print/server:default # svcadm restart print/server:default svcs - example Checking dependencies (NFS server) # svcs -d svc:/network/nfs/server:default STATE STIME FMRI online Nov_15 svc:/network/loopback:default online Nov_15 svc:/network/physical:default online Nov_15 svc:/network/rpc/bind:default online Nov_15 svc:/network/rpc/keyserv:default online Nov_15 svc:/system/filesystem/local:default online Nov_15 svc:/network/rpc/gss:ticotsord online Nov_15 svc:/network/nfs/mapid:default online 10:32:25 svc:/network/nfs/nlockmgr:default inetadm - examples Changing properties of an inetd service (in.ftpd) # inetadm -l svc:/network/ftp:default SCOPE NAME=VALUE name="ftp" endpoint_type="stream" proto="tcp6" isrpc=FALSE wait=FALSE exec="/usr/sbin/in.ftpd -a" user="root" . . . # inetadm -m svc:/network/ftp:default exec="/usr/sbin/in.ftpd -a -l" # inetadm -l svc:/network/ftp:default | grep exec exec="/usr/sbin/in.ftpd -a -l" Misc - examples Milestone transition: None to Single User ok boot -m milestone=none ... # svcs '*milestone*' STATE STIME disabled 13:12:49 disabled 13:12:49 disabled 13:13:04 [edited for brevity] FMRI svc:/milestone/multi-user:default svc:/milestone/multi-user-server:default svc:/milestone/single-user:default # svcadm milestone svc:/milestone/single-user:default # svcs | grep '\*' offline* 13:32:26 svc:/milestone/single-user:default offline* 13:32:28 svc:/system/device/local:default Advanced concepts Service instance states Repository Manifest Snapshots Profiles Demo Service instance states Uninitialised The service instance is not running and the configuration data has not been read. Usually seen if you have booted to milestone=none OfflineThe service instance is not running although the configuration data has been read. This is usually the result of a dependency that has not been met, or if there is an error in the start method. Online Disabled The service instance is running. All of its dependencies have been met. A service instance is not running. This may be the default state for a service when it is first imported into the repository, or an administrator may have marked the service as disabled. It will require operator assistance to move out of this state. A limited set of failures (usually dependencies) may cause the service instance to function in a limited capacity, eg: if an inetd service can work with IPv4 and IPv6 but the latter is not configured, then only IPv4 will be in use and thus the service may be in a degraded state. Degraded Maintenance The service instance is unavailable due to an error. There are many reasons why, ranging from unsatisfied dependencies and failed start methods, to more complicated reasons. Repository The repository is THE source for all known services on the system Modifications to service configuration and state are stored in the repository Services live in the repository! The repository is an SQLite database Manifest DTD is the reference to write manifest > /usr/share/lib/xml/dtd/service_bundle.dtd.1 Explore /var/svc/manifest for similar services > system/utmp is a simple standalone deamon > system/coreadm is a simple configuration service > network/telnet is an inet-managed deamon Initial inet service manifests can be created easily by invoking inetconv -i <file> Manifest (order is important) Service bundle Service name Default instance Single instance Dependencies Exec. Methods Property groups Stability level Template Manifest (cont.) Basic elements > > > > > > > > Name of the service Number of instances Start, stop, [refresh] methods Dependencies Property groups Service model Fault handling section Documentation template Advanced elements Service relationships Milestone multi-user-server DEPENDENT DEPENDENCY svc:/network/nfs/server Dependency The other services that a service relies upon in order to start A mechanism for a service to declare itself as a dependency of another service Dependent DEPENDENCIES svc:/system/filesystem/local Colour Key: Implicit Relationship Explicit Relationship svc:/network/rpc/gss svc:/network/rpc/keyserv svc:/network/rpc/bind Fig.1: Relationship diagram for svc:/network/nfs/server Service relationships > Restart relationships defined by dependency groups > grouping require_all : all services are running require_any: at least one service is running optional_all: all services running, disabled or maintenance exclude_all : all services disabled, maint. or absent > restart_on none : required only for startup error : restart if dependency fails due to hw or sw error restart : restart if dependency restart to any reason refresh : restart if dependency restarts or is refreshed Manifest: dependents A service manifest can specify which services are dependent upon it. It is forbidden to modify the manifest of other services For predictable startup behaviour, the service manifest should specify one of the major milestones as a dependent. <dependent name='nfs-client_multi-user' grouping='optional_all' restart_on='none'> <service_fmri value='svc:/milestone/multi-user' /> </dependent> Development: utmpd(1M) example <service name='system/utmp' type='service' version='1'> <create_default_instance enabled='true' /> <single_instance /> <dependency name='milestone' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/milestone/sysconfig'/> </dependency> <dependent name='utmpd_multi-user' grouping='optional_all' restart_on='none'> <service_fmri value='svc:/milestone/multi-user'/> </dependent> <exec_method type='method' name='start' exec='/lib/svc/method/svc-utmpd' timeout='60' /> <exec_method type='method' name='stop' exec=':kill' timeout='60' /> <stability value='Unstable' /> <template> <common_name><loctext xml:lang='C'> utmpx monitoring </loctext></common_name> <documentation> <manpage title='utmpd' section='1M' manpath='/usr/share/man' /> </documentation> </template> </service> Snapshots A snapshot is a copy of the configuration information for a service instance Can't be used for 'cloning' Up to 5 levels of snapshot > initial : initial conf. delivered by a package > last-import: conf. of an instance when last imported by svccfg(1M) > running : the running conf. of the instance > start : conf. captured during a successful transition to online state > previous : conf. captured when an undo operation is performed Snapshots (cont.) Snapshots taken at the instance level Most configuration settings at service level Use svccfg(1M) to select an instance > listsnap : list available snapshots > selectsnap : select one of the snapshots > revert [snap] : revert back to a given snapshot The changed property values can be made active via 'svcadm refresh' Snapshots: example [...] svc:/network/smtp:sendmail> listsnap initial running start svc:/network/smtp:sendmail> selectsnap running [running]svc:/network/smtp:sendmail> listprop config-file/* config-file/entities fmri file://localhost/etc/mial/sendmail.cf config-file/grouping astring require_all config-file/restart_on astring refresh config-file/type astring path [running]svc:/network/smtp:sendmail> selectsnap start [start]svc:/network/smtp:sendmail> listprop config-file/* config-file/entities fmri file://localhost/etc/mail/sendmail.cf config-file/grouping astring require_all config-file/restart_on astring refresh config-file/type astring path [start]svc:/network/smtp:sendmail> revert svc:/network/smtp:sendmail> listsnap initial running start previous # svcadm refresh svc:/network/smtp:sendmail Profiles A profile is a description of the services that are to be used on a system > Applied in order : generic, platform, site > Profiles may include sub-profiles Enable/Disable services for your site > eg. jumpstart, JASS JumpStart Architecture and Security Scripts Profile location : /var/svc/profile/* Never modify existing profiles The site.xml file is for local customizations, which you must create Profiles (cont.) To create your own site.xml file: svccfg:> extract > /var/tmp/site.xml (modify file with your changes) # cp /var/tmp/site.xml /var/svc/profile # init 6 You can also svccfg apply the site.xml for immediate effect Be aware, profiles are only processed once Debug & Lab Troubleshooting techniques Lab : Writing your own service Lab exercises Troubleshooting Service failures printed to console, syslog Always start with svcs -x; http://sun.com/msg > svcs -x will display the service logfile, if it exists: > /var/svc/log > /etc/svc/volatile See service start messages with boot For a system that hangs during boot: > boot -m verbose,milestone=none -m verbose > log in at prompt > svcadm milestone all > Watch system progress with svcs Troubleshooting (cont.) To truss a service starting up > Truss the restarter (svc.startd/inetd) Or > Make a note of the start method > Use svccfg to modify the start method > When complete, restore the original start method # svccfg svc:> select application/print/rfc1179 svc:...1179> listprop inetd_start/exec inetd_start/exec astring /usr/lib/print/in.lpd svc:...1179> setprop inetd_start/exec = /usr/bin/truss -ealfo /tmp/in.lpd.truss /usr/lib/print/in.lpd svc:...1179> end # svcadm refresh svc:/application/print/rfc1179:default Troubleshooting (cont.) Maintenance mode > svcs -xv or svcs -l to see why the service failed > svcadm refresh <fmri> if repository has been changed > svcadm clear <fmri> once fault rectified Have changes been made to repository? > How services many are affected? > What snapshots do exist? > Can you revert back to a previous snapshot? Troubleshooting (cont.) If the current repository is beyond repair, try to restore from an earlier repository or reseed: /lib/svc/bin/restore_repository Will the system boot in verbose mode? > ok boot -m verbose Will the system boot with no service? > ok boot -m milestone=none Lab Unable to resolve webcache Ru n th e te s t1 .b re a km e s crip t # nslookup webcache ;; connection timed out; no servers could be reached # svcs svc:/network/dns/client:default offline 17:34:25 svc:/network/dns/client:default Lab Unable to resolve webcache # svcs -xv svc:/network/dns/client:default svc:/network/dns/client:default (DNS resolver) State: offline since Fri Feb 04 18:10:24 2005 Reason: Dependency file://localhost/etc/resolv.conf is absent. See: http://sun.com/msg/SMF-8000-E2 See: man -M /usr/share/man -s 3RESOLV resolver See: /var/svc/log/network-dns-client:default.log Impact: This service is not running. In this case it clearly tells us that /etc/resolv.conf is missing # svcadm refresh svc:/network/dns/client:default Lab sendmail won't start Ru n t h e t e s t 2 .b re a k m e s c rip t svc.startd[7]: network/smtp:sendmail failed # svcs svc:/network/smtp:sendmail STATE STIME FMRI maintenance 16:18:03 svc:/network/smtp:sendmail Lab sendmail won't start # svcs -xv svc:/network/smtp:sendmail svc:/network/smtp:sendmail (sendmail SMTP mail transfer agent) State: maintenance since Mon Nov 22 16:18:03 2004 Reason: Start method failed repeatedly, last died on Killed (9). See: http://sun.com/msg/SMF-8000-KS See: man -M /usr/man -s 1M sendmail See: /var/svc/log/network-smtp:sendmail.log Impact: This service is not running. # tail /var/svc/log/network-smtp:sendmail.log [ Nov 22 16:17:53 executing start method ("/lib/svc/method/smtp-sendmail start") ] [ Nov 22 16:18:03 Method or service exit timed out. Killing contract 122 ] [ Nov 22 16:18:03 Method "start" failed due to signal Killed ] Lab sendmail won't start Knowing the start method timed out we can examine the repository for this service: # svcprop -p start svc:/network/smtp:sendmail start/exec astring /lib/svc/method/smtp-sendmail\ start start/type astring method start/timeout_seconds count 5 Having extracted this value we can compare it with the value in the manifest: # cd /var/svc/manifest/network # more smtp-sendmail.xml <?xml version="1.0"?> ... <exec_method type='method' name='start' exec='/lib/svc/method/smtp-sendmail start' timeout_seconds='120' /> Lab sendmail won't start 1) Use svccfg to set the correct start method timeout: # svccfg svc:> select svc:/network/smtp:sendmail svc:/network/smtp:sendmail> setprop start/timeout_seconds = 120 svc:/network/smtp:sendmail> quit # svcadm refresh svc:/network/smtp:sendmail # svcadm clear svc:/network/smtp:sendmail # svcs svc:/network/smtp:sendmail STATE online STIME FMRI 17:03:48 svc:/network/smtp:sendmail Lab sendmail won't start 2) Use snapshots to set the correct start method timeout: # svccfg svc:> select svc:/network/smtp:sendmail svc:/network/smtp:sendmail> selectsnap initial [initial]svc:/network/smtp:sendmail> revert svc:/network/smtp:sendmail> quit # svcadm refresh svc:/network/smtp:sendmail # svcadm clear svc:/network/smtp:sendmail # svcs svc:/network/smtp:sendmail STATE online STIME FMRI 17:03:48 svc:/network/smtp:sendmail Lab keyserv won't start Ru n th e te s t3 .b re a km e s crip t svc.startd[7]: svc:/network/nis/client:default: Method "/lib/svc/method/yp" failed with exit status 96. svc.startd[7]: svc:/network/rpc/keyserv:default: Method "/usr/sbin/keyserv" failed with exit status 96. # svcs svc:/network/nis/client:default STATE STIME FMRI maintenance 10:52:40 svc:/network/nis/client:default # svcs svc:/network/rpc/keyserv:default STATE STIME FMRI maintenance 10:52:40 svc:/network/rpc/keyserv:default Lab keyserv won't start # svcs -xv network/rpc/keyserv:default svc:/network/rpc/keyserv:default (RPC encryption key storage) State: maintenance since Wed Feb 09 17:20:46 2005 Reason: Start method exited with SMF_EXIT_ERR_CONFIG. See: http://sun.com/msg/SMF-8000-KS See: keyserv(1M) See: /var/svc/log/network-rpc-keyserv:default.log Impact: This service is not running. # svcs -xv network/nis/client:default svc:/network/nis/client:default (NIS (YP) client) State: maintenance since Wed Feb 09 17:20:46 2005 Reason: Start method exited with $SMF_EXIT_ERR_CONFIG. See: http://sun.com/msg/SMF-8000-KS See: ypstart(1M) See: /var/svc/log/network-nis-client:default.log Impact: This service is not running. Lab keyserv won't start # cd /var/svc/log # tail network-rpc-keyserv:default.log [ Feb [ Feb [ Feb [ Feb 9 17:17:19 Stopping because service disabled. ] 9 17:17:20 Executing stop method (:kill) ] 9 17:20:45 Executing start method (/usr/sbin/keyserv) ] 9 17:20:46 Method start exited with status 96 ] # tail network-nis-client:default.log [ Feb [ Feb [ Feb [ Feb 9 17:17:19 Stopping because service disabled. ] 9 17:17:20 Executing stop method (:kill) ] 9 17:20:45 Executing start method (/lib/svc/method/yp) ] 9 17:20:46 Method start exited with status 96 ] /lib/svc/method/yp: domainname not set # ls -l /etc/defaultdomain /etc/defaultdomain: No such file or directory Lab keyserv won't start # cat > /etc/defaultdomain louvre.France.Sun.COM ^D # domainname `cat /etc/defaultdomain` # svcadm clear nis/client:default # svcs nis/client:default STATE online STIME FMRI 9:59:21 svc:/network/nis/client:default # svcadm clear network/rpc/keyserv:default # svcs network/rpc/keyserv:default STATE online STIME FMRI 10:01:46 svc:/network/rpc/keyserv:default Lab customer ndd script Ru n th e te s t4 .b re a km e s crip t Feb 10 12:25:21 labhost svc.startd[7]: network/ndd-nettune:default failed repeatedly # svcs svc:/network/ndd-nettune:default STATE STIME FMRI maintenance 16:02:26 svc:/network/ndd-nettune:default Lab customer ndd script # svcs -xv network/ndd-nettune:default svc:/network/ndd-nettune:default (ndd network tuning) State: maintenance since Thu Feb 10 12:25:21 2005 Reason: Restarting too quickly. See: http://sun.com/msg/SMF-8000-L5 See: man -M /usr/share/man -s 1M ndd See: /var/svc/log/network-ndd-nettune:default.log Impact: This service is not running. # tail /var/svc/log/network-ndd-nettune:default.log [ Feb 11 15:12:14 Executing start method ("/lib/svc/method/ndd-nettune") ] /sbin/sh: /lib/svc/method/ndd-nettune: cannot execute [ Feb 11 15:12:14 Stopping because all processes in service exited. ] [ Feb 11 15:12:14 Executing start method ("/lib/svc/method/ndd-nettune") ] /sbin/sh: /lib/svc/method/ndd-nettune: cannot execute [ Feb 11 15:12:14 Stopping because all processes in service exited. ] [ Feb 11 15:12:14 Executing start method ("/lib/svc/method/ndd-nettune") ] /sbin/sh: /lib/svc/method/ndd-nettune: cannot execute [ Feb 11 15:12:14 Stopping because all processes in service exited. ] [ Feb 11 15:12:14 Restarting too quickly, changing state to maintenance ] Lab customer ndd script # ls -l /lib/svc/method/ndd-nettune -rw-r--r-1 root root 477 Feb 11 15:12 /lib/svc/method/ndd-nettune # chmod 755 /lib/svc/method/ndd-nettune # svcadm clear network/ndd-nettune:default Feb 11 15:19:51 labhost svc.startd[7]: network/ndd-nettune:default failed repeatedly # more /var/svc/log/network-ndd-nettune:default.log [ Feb 11 15:19:48 Leaving maintenance because clear requested. ] [ Feb 11 15:19:49 Enabled. ] [ Feb 11 15:19:49 Executing start method ("/lib/svc/method/ndd-nettune") ] [ Feb 11 15:19:49 Stopping because all processes in service exited. ] [ Feb 11 15:19:49 Executing start method ("/lib/svc/method/ndd-nettune") ] [ Feb 11 15:19:49 Stopping because all processes in service exited. ] [ Feb 11 15:19:49 Executing start method ("/lib/svc/method/ndd-nettune") ] [ Feb 11 15:19:49 Stopping because all processes in service exited. ] [ Feb 11 15:19:51 Restarting too quickly, changing state to maintenance ] Lab customer ndd script # cd /lib/svc/method # file ndd-nettune ndd-nettune: executable /sbin/sh script # more /lib/svc/method/ndd-nettune #!/sbin/sh # # ident "@(#)ndd-nettune.xml 1.0 04/09/21 SMI" . /lib/svc/share/smf_include.sh . /lib/svc/share/net_include.sh # Make sure that the libraries essential to this stage of booting can be found. LD_LIBRARY_PATH=/lib; export LD_LIBRARY_PATH echo "ndd ran" >> /tmp/smf.out /usr/sbin/ndd -set /dev/tcp tcp_recv_hiwat 16384 /usr/sbin/ndd -set /dev/tcp tcp_xmit_hiwat 16384 # Reset the library path now that we are past the critical stage unset LD_LIBRARY_PATH Lab customer ndd script A transient script should run once then exit and never be restarted. In the log file you can see that the start method is being run repeatedly. This suggests the service has been configured incorrectly, so you should look at the repository: # svccfg svc:> select network/ndd-nettune svc:/network/ndd-nettune> listprop startd/* startd/duration astring child Here you see this service has been mis-configured as a child service, so when the process died svc.startd attempted to restart it. transient so: svc:/network/ndd-nettune> setprop startd/duration = transient svc:/network/ndd-nettune> quit # svcadm refresh svc:/network/ndd-nettune:default # svcadm clear svc:/network/ndd-nettune:default STATE online STIME FMRI 15:20:18 svc:/network/ndd-nettune:default We know it should be Service Lifecycle Determine service suitability Write service methods Write service manifest Import manifest Test/modify Package manifest and methods Install service Service startup/runtime Configure/modify service Remove service Method creation Start with /etc/init.d script Include /lib/svc/share/smf_include.sh > SMF_EXIT_OK > SMF_EXIT_ERR_FATAL > SMF_EXIT_ERR_CONFIG Fail with a non-0 exit code, and emit a message to stdout or stderr start and stop required, refresh optional :kill [signal] and :true Don't exit until service is completely started remove script from /etc/rc?.d locations and /etc/init.d Write your own service Tip : How to check the manifest? > Use xmllint(1) or Mozilla to parse the manifest and check for errors > Example: # xmllint mysvc.xml mysvc.xml:71: parser error : Opening and ending tag mismatch: exec_method line 36 and service </service> ^ mysvc.xml:73: parser error : expected '>' </service_bundle> ^ mysvc.xml:74: parser error : Premature end of data in tag service_bundle line 10 Write your own service little d : A simple daemon that listens on port 13567 > Requires a configuration file: /var/tmp/littled.conf You can interact with littled thus: $ telnet localhost 13567 SMF TOI littled daemon/server version=0.8 Daemon Started: Wed Feb 09 11:07:44 2005 littled> help SMF TOI littled daemon/server version=0.8 Available commands: ...

Textbooks related to the document above:
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Delaware - CIS - 361
Memory ManagementOne of the most important OS jobs.Review memory hierarchy sizes, speed, costGrowing memories -&gt; growing programs need for swapping and paging The simplest way to use memory is to have one program in memory sharing it with the OS
Delaware - CIS - 361
ZFSNew filesystem and volume manager from Sun Open source after 5 years development First appeared in OpenSolaris, later in Solaris 10 6/06 (u2). Has been ported to FreeBSD. Also being including on Macs (Leopard*) Linux FUSE port Jeff Bonwick is a U
Delaware - CIS - 361
Process SynchronizationConsider two threads using and modifying a shared global variable. What problems could occur? Example: a bank account balance (a shared global variable) Balance $200 A: Deposit $10 B: Deposit $10,000Process SynchronizationA
Delaware - CIS - 361
ThreadsTraditional processes have one thread of control sequential program. Multiple threads of control are possible to get parallelism. Processes - own resources (resource grouping) - are scheduled for running (have states (Running, Ready, Blocked
Delaware - CIS - 361
CPU SchedulingScheduling processes (or kernel-level threads) onto the cpu is one of the most important OS functions. The cpu is an expensive resource so utilize it well. May have more than 1. With multiprogramming will have many processes (threads)
Delaware - CIS - 361
Solaris Zones: Operating System Support for Consolidating Commercial WorkloadsDaniel Price and Andrew Tucker Sun Microsystems, Inc. ABSTRACTServer consolidation, which allows multiple workloads to run on the same system, has become increasingly im
Delaware - CIS - 361
DeadlocksLots of resources can only be used by one process at a time. Exclusive access is needed. Suppose process A needs R1 + R2 and B needs R1 + R2. A gets R1, B gets R2 A waits for R2, B waits for R1 A and B can't continue without second resource
Delaware - CIS - 361
Zones - ContainersServer Consolidation Run multiple workloads on system Improve utilization of resources Reduce costs Run workloads in isolation Cannot observe others Security Isolation Running apps as different user not enough - privilege escalatio
Delaware - CIS - 361
Dining PhilosophersFive philosophers sit around a table with five forks and spaghetti to eat. Philosophers think for a while and they want to eat, only spaghetti, for a while. To eat a philosopher requires two forks, one from the left and one from r
Delaware - CIS - 361
The ShellWhat does a shell do? - execute commands, programs - but how? For built in commands run some code to do the command For other commands find program executable and . run it. Other features: wildcards, pipes, redirection.ProcessesThe shell
Delaware - CIS - 361
Architecture BackgroundVon Neumann architecture - cpu = ALU + control unit - memory - devices Above connected with buses ALU carry out instruction, may have more than one execution unit Program counter memory address of next instruction to fetch.
Delaware - CIS - 361
Chapter 2 Process, Thread and Scheduling Soloris IPC1Outline Generic System V IPC Support Shared Memory System V Semaphores System V Message Queues POSIX IPC Signal Door2Generic System V IPC SupportModule TheCreationSystem V IPC
Delaware - CIS - 361
Chapter 2 Process, Thread and Scheduling - Scheduler Class and PriorityXIANG Yong xyong@tsinghua.edu.cnOutline Scheduling Class and Priority Dispatch Queues &amp; Dispatch Tables Thread Priorities &amp; Scheduling Turnstiles &amp; Priority Inheritance2
Delaware - CIS - 361
Operating Systems Update: Solaris, OpenSolaris, LinuxHarry J Foxwell, PhD OS AmbassadorSun Microsystems Federal, IncSolaris 10 Introduced in Jan 05, included:&gt; Containers: OS virtualization for isolation &gt; &gt; &gt; &gt; &gt;consolidation/utilization Obs
Delaware - CIS - 361
Name:UDel CISC361-010 Midterm, March 24, 2005Be sure that you read each question and understand what it is asking. No calculators permitted. 1. (10 pts) True/False (circle T for True, F for False) (a) T F - The C shell (csh) is derived from the Bo
Delaware - CIS - 361
Chapter 2 Process, thread, and scheduling - Solaris Multithreaded ProcessZhao Xia zhaoxia@os.pku.edu.cnOutline Introduction to Solaris Processes Multithreaded Process Model Proc tools2The Process ModelSolarisKernel is Multi-threadedK
Delaware - CIS - 361
Name:Show your work! Partial credit will be given, but only if you show your work!. Be sure that you read each question and understand what it is asking.UDel CISC361-010 Final, December 13, 20011. 10 pts True False a T F - Segmentation is just a
Delaware - CIS - 361
ZFSNew filesystem and volume manager from Sun Open source after 5 years development First appeared in OpenSolaris, later in Solaris 10 6/06 (u2). Has been ported to FreeBSD. Also being including on Macs in the works (Leopard*) Linux FUSE port Jeff B
Delaware - CIS - 361
UDel CISC361Study Operating System principles - processes, threads - scheduling - mutual exclusion - synchronization - deadlocks - memory management - file systems - security - networking (if time allows)Operating SystemsUse of Solaris - advanced
Delaware - CIS - 361
Zones - ContainersServer Consolidation Run multiple workloads on system Improve utilization of resources Reduce costs Run workloads in isolation Cannot observe others Security Isolation Running apps as different user not enough - privilege escalatio
Delaware - CIS - 361
Architecture BackgroundVon Neumann architecture - cpu = ALU + control unit - memory - devices Above connected with buses ALU carry out instruction, may have more than one execution unit Program counter memory address of next instruction to fetch.
Delaware - CIS - 361
UDel CISC361-010 Midterm, October 24, 2001Show your work. Partial credit will be given, but only if you show your work. Be sure that you read each question and understand what it is asking.Name:1.10 ptsa b c d e f g h i j 2.True False T F
Delaware - CIS - 105
CISC 105 Fall 2005Name Circle section: 18 19 20 21Midterm 110/07/05TAGeneral Instructions DO NOT PUT YOUR SSN ON ANYTHING! DO NOT WRITE YOUR NAME ON ANY PAGE EXCEPT THIS ONE! Turn off any noise making device, especially CELL PHONES. You m
Delaware - CIS - 105
CISC105 Spring 2007 Lab11 This lab is designed to help with your project. Youll write small programs that demonstrate things you are supposed to do in the project. In general, writing small test programs that demonstrate the concepts you want to emp
Delaware - CIS - 105
CISC105 Spring 2007 Lab06 CODE! If you are having difficulty writing programs, consider programming more often. Working on C every day makes a big difference, and leaving it alone, even just for a weekend, can result in backsliding. You are learning
Delaware - CIS - 181
CISC181 Spring 2008 Lab02 If you did not use the SunRays in CISC105 or 106, then see Lab00 from this directory. Lab00 also reviews compiling and running C+ programs on Unix. This lab should be a review of programming concepts you have seen before.
Delaware - CIS - 181
Project 2, CISC181 Spring 08Domain choice due by email (see below) April 14th Testing and makefile due Thursday April 24th midnight, paper Friday in class Due Sunday April 27th midnight, paper Monday in class AssignmentPlease read the online FAQ fo
Delaware - CIS - 181
CISC181 Fall 2008 Lab01 See Lab00 if you would like to review compiling and running C+ programs on Unix. Be sure to change your disk quota as I described in an email to you last week. Remember, never delete an email from your professor or TA. Thi
Delaware - CIS - 181
Every problem starts with the same picture. Given the code, modify the picture to show what happens. Be sure to struct Node { 1) cross out pointers that go away; int data; 2) add any new pointers, structs, or data; Node * next; 3) follow the code, no
Delaware - CIS - 181
CISC181 Fall 2006 Lab02 Write a program for each of the following problems. Be sure to save every separate program. All programs must be properly commented and indented (see Assignment Standards on the class website). Ask your TA for guidance. Read
Delaware - CIS - 181
CISC181 Fall 2006 Lab09 Write a program for each of the following problems. Be sure to save every separate program. All programs must be properly commented and indented (see Assignment Standards on the class website). Ask your TA for guidance. Feel
Delaware - CIS - 181
181 Quiz 4/11/08 10 pts. Name Section TA1. Show an expression that puts a pseudo-random number into x: int x;2. The C+ language builds on C by adding three features, according to our discussion in class: inheritance, polymorphism, and 1 2 3 4 5 6
Delaware - CIS - 181
181 Quiz 5/9/08 10 pts. Name Section TA Consider the class below which has functions for addition and multiplication. class Rat{ int num; int denom; public: Rat(int n = 0, int d = 1):num(n),denom(d){} Rat operator+(const Rat&amp; rhs); friend Rat operato
Delaware - CIS - 181
Every problem starts with the same picture. Given the code, modify the picture to show what happens. Be sure to struct Node { 1) cross out pointers that go away; int data; 2) add any new pointers, structs, or data; Node * next; 3) follow the code, no
Delaware - CIS - 181
CISC 181 Fall 2006First Midterm Learning Experience10/9/06NameLogin nameSection:TAGeneral Instructions DO NOT PUT YOUR SSN ON ANYTHING! DO NOT WRITE YOUR NAME ON ANY PAGE EXCEPT THIS ONE! Turn off any noise making device, especially
Delaware - CIS - 181
CISC181 Spring 2008 Lab01 If you did not use the SunRays in CISC105 or 106, then see Lab00 from this directory. Lab00 also reviews compiling and running C+ programs on Unix. During lab, your TA will explain how to check your disk quota, and what to
Delaware - CIS - 181
CISC181 Spring 2008 Lab03 If your SunRay sessions are behaving oddly, please check your disk usage (see lab00). If your quota is ok, then you may need to check your dot les (.login, .localenv, .cshrc, etc). This information is also available from th
Delaware - CIS - 181
CISC181 Spring 2008 Lab07 Debugging? INSERT PRINT STATEMENTS. Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program file. Your answers will be graded. Name each program lab07.n.cc
Delaware - CIS - 181
CISC181 Spring 2008 Lab06 Debugging? INSERT PRINT STATEMENTS. Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program le. Your answers will be graded. Name each program lab06.n.cc,
Delaware - CIS - 181
CISC181 Spring 2008 Lab05 Debugging? INSERT PRINT STATEMENTS. Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program le. Your answers will be graded. EVERY program you write in thi
Delaware - CIS - 181
CISC181 Spring 2008 Lab08 Debugging? INSERT PRINT STATEMENTS. Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program file. Your answers will be graded. Most of this lab will help y
Delaware - CIS - 181
CISC181 Spring 2008 Lab09 Debugging? INSERT PRINT STATEMENTS. Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program le. Your answers will be graded. Most of this lab will help you
Delaware - CIS - 181
CISC181 Spring 2008 Lab11 Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program file. Your answers will be graded. Name each program lab11.n.cc, where n is the number in the list b
Delaware - CIS - 181
CISC181 Spring 2008 Lab04 If your loop or recursion doesn't stop, then insert a print statement showing the values of your control variables before, during, and after the loop. Information is free! And it beats staring at code when you are tired. S
Delaware - CIS - 181
CISC181 Spring 2008 Lab12 Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program file. Your answers will be graded. Name each program lab12.n.cc, where n is the number in the list b
Delaware - CIS - 181
181 Leap Day Quiz 2/29/08 10 pts. Name Section TA1. Suppose you call a binary search function on an array of size 128. What is the maximum number of comparisons the code will have to make, according to our discussion in class? 2. Fill in the two bl
Delaware - CIS - 181
181 Quiz 3/28/08 10 pts. Name Section TA1. 4 Dene a struct type that will hold a student name and id number.2. 3 Declare one student and ll with data.3. 3 Declare a second student, and give it the same values as the rst without restating those
Delaware - CIS - 181
181 Quiz 5/9/08 12 pts. Name Section TAclass Flour{ private: int weight; int getWeight(){return weight;} public: Flour():weight(5){} int getWeight2(){return weight;} void say(){cout &lt; &quot;I am a Flour object\n&quot;;} virtual void say2(){cout &lt; &quot;I am a Flo
Delaware - CIS - 181
181 Quiz 3/11/08 10 pts. Name Use only the names provided! Section TAOn the four lines provided, write four single C+ statements to: 1. Declare an integer named i and initialize it to 272. Declare a pointer ip and initialize it to point to i3.
Delaware - CIS - 181
181 Quiz 2/22/08 10 pts. Name Lab Section TA1. In C+ the operators &amp; and | both evaluate their second arguments only if it is necessary. This is called: 2. Write what this code fragment, a C+ if statement, will print, or write &quot;error&quot; if it won't c
Delaware - CIS - 181
181 Quiz 2/22/08 10 pts. Name Lab Section TA1. According to the Structured Programming model, there are three ways to control program flow. What are they? 2. Write what this code fragment, a C+ if statement, will print, or write &quot;error&quot; if it won't
Delaware - CIS - 181
CISC181 Fall 2008 Lab04 If you have not read the project document online, stop reading this and READ THE PROJECT RIGHT NOW. There are important deadlines tomorrow (Friday). Your book is an excellent resource. I nd the table of contents very good, a
Delaware - CIS - 181
CISC181 Fall 2008 Lab10 Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program le. Your answers will be graded. Dont answer questions in parentheses. Name each program lab10.n.cc, w
Delaware - CIS - 181
Project 3, CISC181 Fall 08Dec 1, 5, 6Submission dates. Submit any code you (an individual) have written as of the deadline, just to prove you are doing something.Due Sunday Dec 7th midnight, paper code copy in class MondayYou must execute the sp
Delaware - CIS - 181
CISC 181 Spring 2008Second Midterm Learning Experience4/28/08Name Section: TALogin nameGeneral Instructions DO NOT PUT YOUR SSN ON ANYTHING! DO NOT WRITE YOUR NAME ON ANY PAGE EXCEPT THIS ONE! Turn off any noise making device, especially
Delaware - CIS - 181
CISC181 Fall 2008 Lab09 Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program le. Your answers will be graded. Dont answer questions in parentheses. Name each program lab09.n.cc, w
Delaware - CIS - 181
Project 2, CISC181 Fall 08All testing code, stubs and makefile due Friday Nov 7 midnight, paper in class Due Sunday Nov 16th midnight, paper code copy in class Monday AssignmentPlease read the online FAQ for this project, which I will add to as I r
Delaware - CIS - 181
CISC181 Fall 2008 Lab06 Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program file. Your answers will be graded. Don't answer questions in parentheses. Name each program lab06.n.cc
Delaware - CIS - 181
CISC 181 Practice Fall 2008Concluding Learning Experience5/27/08NameLogin nameLecture Section:TAGeneral Instructions DO NOT PUT YOUR SSN ON ANYTHING! DO NOT WRITE YOUR NAME ON ANY PAGE EXCEPT THIS ONE! Turn off any noise making devic
Delaware - CIS - 181
CISC181 Fall 2008 Lab07 Some programs below are associated with a question. Answer the questions using C+ comments below your code in the program file. Your answers will be graded. Don't answer questions in parentheses. Name each program lab07.n.cc
Delaware - CIS - 181
CISC181 Fall 2008 Project 3 Script Steps Names: Create a script file with each one of these actions completed. Do not print the script file, but submit it with your code on Sakai. Check each box as you do the action in your script, and submit the com