Service Management Facility (SMF) - Service Won't Go Online
807559Jul 24 2007 — edited Jul 24 2007Hello All,
I am new to this forum, but getting rather frustrated and thought I'd see if any of you could point me in the right direction.
I have just loaded Solaris 10 on my local workstation and I'm trying to get it set up. I have a simple script that I did have set up in my Solaris 9 inittab file to respawn. This script essentially kept track of my filesystem size and sent me an email if any specified filesystem went over a defined limit. It worked great for me in my Sol9 environment.
I have been trying to create a service (manifest?) for this same script, and I am clearly doing something wrong because when I import/enable the xml file, the service runs (I can see the process consistantly running, exiting, restarting), but the service state is offline.
I confess, this is my first attempt at a service script...and I can't seem to find much on-line info about the values - I have essentially just copied bits and pieces from other service xml files.
Please take a look and let me know if you see anything obviously wrong.
# svccfg import fscheck.xml
# svcs -a |grep fscheck
offline* 12:53:25 svc:/site/fscheck:default
# svcs -xv fscheck
svc:/site/fscheck:default (?)
State: offline since Tue Jul 24 12:53:25 2007
Reason: Start method is running.
See: http://sun.com/msg/SMF-8000-C4
See: /var/svc/log/site-fscheck:default.log
Impact: This service is not running.
# ps -ef |grep fscheck
root 3184 818 0 11:12:01 pts/4 0:00 tail -f site-fscheck:default.log
root 3484 7 0 13:08:26 ? 0:00 /bin/ksh /lib/svc/method/fscheck
Output of log file.
[ Jul 24 12:56:25 Method "start" exited with status 0 ]
[ Jul 24 12:56:25 Stopping because all processes in service exited. ]
[ Jul 24 12:56:25 Executing stop method (null) ]
[ Jul 24 12:56:25 Executing start method ("/lib/svc/method/fscheck") ]
# svcs -l fscheck
fmri svc:/site/fscheck:default
enabled true
state offline
next_state online
state_time Tue Jul 24 13:08:26 2007
logfile /var/svc/log/site-fscheck:default.log
restarter svc:/system/svc/restarter:default
contract_id 214
dependency require_all/none svc:/milestone/multi-user-server (online)
# more fscheck.xml
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='manifest:fscheck'>
<service
name='site/fscheck'
type='service'
version='1'>
<create_default_instance enabled='true' />
<single_instance />
<dependency
name='foo_opt'
type='service'
grouping='require_all'
restart_on='none'>
<service_fmri value='svc:/milestone/multi-user-server' />
</dependency>
<exec_method
type='method'
name='start'
exec='/lib/svc/method/fscheck'
timeout_seconds='0' >
</exec_method>
<exec_method
type='method'
name='stop'
exec=':true'
timeout_seconds='0' >
</exec_method>
<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='wait' />
</property_group>
<stability value='Unstable' />
</service>
</service_bundle>