Hi Folks,

I have implemented the following manifest and method for the JES Messaging 
Server.

Question 1: the ./start-msg script ( which we use to start the Messaging 
Services ), starts a bunch of processes. eg. imap / pop / http / etc. as shown 
below. I would assume since my manifest uses start-msg. All the services ( 
processes ) started by start-msg should be monitored under SMF ?

# svcs -p svc:/network/messaging_server:default
STATE STIME FMRI
online 11:20:01 svc:/network/messaging_server:default
11:19:54 3245 watcher
11:19:54 3247 stored
11:19:56 3248 imapd
11:19:58 3252 mshttpd
11:19:59 3254 imsched
11:19:59 3256 dispatcher
11:20:00 3259 job_controller
11:20:00 3260 tcp_smtp_server
11:20:00 3262 tcp_smtp_server
11:20:01 3267 AService
11:55:00 3293 msprobe

Question 2: So I tried killing one of the processes Example : kill -9 this 
restarts the entire messaging server, Well and good, but say that we don't want 
this to happen. We want only the process that died should be restarted. In 
other words Is it possible for us to have a fine granularity, so that only imap 
gets restarted ?.

Question 3: seems like SMF doesn't recognize pkill, if i repeat the same 
experiment above with pkill imapd it doesn't seem to notify the SMF

Question 4: By looking at the svcadm usage below, my method (msg) has start / 
stop / refresh will this suffice ?.

svcadm enable [-rst] ... - enable and online service(s)
svcadm disable [-st] ... - disable and offline service(s)
svcadm restart ... - restart specified service(s)
svcadm refresh ... - re-read service configuration

Please look at the following for more detailed description:

# svcs -xv svc:/network/messaging_server:default
svc:/network/messaging_server:default (?)
State: online since Wed Feb 28 11:20:01 2007
See: /var/svc/log/network-messaging_server:default.log
Impact: None.

MANIFEST
- - - - - - - - - - - - - -

# cat /var/svc/manifest/network/messaging.xml
<?xml version="1.0"?>

<!--
Sun Java Enterprise System Messaging Server
-->

< service_bundle type='manifest' name='messaging_server'>

< service
name='network/messaging_server'
type='service'
version='1'>

< create_default_instance enabled='false' />

< single_instance />

< dependency
name='network-service'
grouping='require_all'
restart_on='none'
type='service'>

< /dependency>

< dependency
name='fs-local'
grouping='require_all'
restart_on='none'
type='service'>

< /dependency>

< dependency
name='name-services'
grouping='require_all'
restart_on='refresh'
type='service'>
< service_fmri value='svc:/milestone/name-services' />
< /dependency>

< dependency
name='identity'
grouping='optional_all'
restart_on='refresh'
type='service'>
< service_fmri value='svc:/system/identity:domain' />
< /dependency>

< exec_method
type='method'
name='start'
exec='/opt/SUNWmsgsr/lib/svc/method/msg start'
timeout_seconds='180' >
< /exec_method>

< exec_method
type='method'
name='stop'
exec='/opt/SUNWmsgsr/lib/svc/method/msg stop'
timeout_seconds='180' >
< /exec_method>

< exec_method
type='method'
name='refresh'
exec='/opt/SUNWmsgsr/lib/svc/method/msg refresh'
timeout_seconds='180' >
< /exec_method>

< property_group name='application' type='framework'>
< propval name='messaging_server_base' type='astring'
value='/opt/SUNWmsgsr' />
< /property_group>

< stability value='Unstable' />

< /service>

< /service_bundle>

METHOD
- - - - - - - - -
# cat /opt/SUNWmsgsr/lib/svc/method/msg
#!/sbin/sh -x

## Copy/Rename this script to /opt/csw/lib/svc/method/svnserve
## Please change $REPOS to the location of your SVN Repo

. /lib/svc/share/smf_include.sh

parser() {
PROPERTY=$1
#VALUE=`svcprop -p ${PROPERTY} ${SMF_FMRI}`
VALUE=`svcprop -p ${PROPERTY} test_server`
if [ "${VALUE}" = "\"\"" ] ; then
VALUE=
fi
echo $VALUE
}

MESSAGING_BASE=`parser application/messaging_server_base`

if [ -z "${MESSAGING_BASE}" ] ; then
exit $SMF_EXIT_ERR_CONFIG
fi

case $1 in

'start')
${MESSAGING_BASE}/sbin/start-msg
if [ $? -ne 0 ] ; then
exit $SMF_EXIT_ERR_FATAL
fi
exit $SMF_EXIT_OK
;;
'stop')
${MESSAGING_BASE}/sbin/stop-msg
if [ $? -ne 0 ] ; then
exit $SMF_EXIT_ERR_FATAL
fi
exit $SMF_EXIT_OK
;;
'refresh')
${MESSAGING_BASE}/lib/msstart -x
sleep 5
${MESSAGING_BASE}/sbin/start-msg
if [ $? -ne 0 ] ; then
exit $SMF_EXIT_ERR_FATAL
fi
exit $SMF_EXIT_OK
;;
*)
echo "Usage: $0 { start | stop | refresh }"
exit $SMF_EXIT_ERR_FATAL
;;
esac


Thanks in Advance
-dd
 
 
This message posted from opensolaris.org

Reply via email to