To help out with people trying to get the above working. I didn't know where
to 'put' this information, or how to submit it. However, I figured anyone
resourceful would come here. So, have fun!
Solaris 10 uses SMF to handle services. Traditional means of /etc/rc?.d
scripts still work, but in legacy means.
To take advantage of the SMF with Solaris 10 with JBoss do the following:
Create a service manifest file:
/var/svc/manifest/network/jboss.xml
That contains the following:
<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM
'/usr/share/lib/xml/dtd/service_bundle.dtd.1'>
<!--
William Pool (Puddle) 01/05
E-mail: [EMAIL PROTECTED]
Service manifest for JBoss
-->
<!-- This works for 4.0.0 as well, just change the name to 400 instead
-->
<service_bundle type='manifest' name='JBoss325:jboss'>
<create_default_instance enabled='false' />
<single_instance />
<dependency name='fs'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri
value='svc:/system/filesystem/local' />
<dependency name='net'
grouping='require_all'
restart_on='none'
type='service'>
<service_fmri value='svc:/network/loopback' />
<dependent
name='ssh_multi-user-server'
grouping='optional_all'
restart_on='none'>
<service_fmri
value='svc:/milestone/multi-user-server' />
<exec_method
type='method'
name='start'
exec='/lib/svc/method/svc-jboss start'
timeout_seconds='-1'>
<method_context>
<method_credential user='jboss' group='jboss' />
</method_context>
</exec_method>
<exec_method
type='method'
name='stop'
exec=':kill'
timeout_seconds='-1'>
</exec_method>
<exec_method
type='method'
name='restart'
exec='/lib/svc/method/svc-jboss restart'
timeout_seconds='-1'>
</exec_method>
<common_name>
<loctext xml:lang='C'>
JBoss
</common_name>
</service_bundle>
Now Create your "Service Method File" in /lib/svc/method/
# more svc-jboss
#! /bin/sh
# Solaris 2.x Init script
#
. /lib/svc/share/smf_include.sh
case $1 in
'start')
echo "starting jboss.."
su jboss -c '/opt/FlipMotion/JBoss/jboss-3.2.5/bin/run.sh & >
/dev/null 2> /dev/null'
;;
'stop')
echo "stopping jboss.."
su jboss -c '/opt/FlipMotion/JBoss/jboss-3.2.5 bin/shutdown.sh -S &'
su jboss -c 'pkill java'
;;
'restart')
stop
# give stuff some time to stop before we restart
sleep 60
# protect against any services that can't stop before we restart (warning
this kills all Java instances running as 'jboss' user)
su jboss -c 'pkill java'
start
;;
*)
echo "Usage: $0 { start | stop | restart }"
exit 1
;;
esac
#
Now fix the permissions for the two files created:
chown root:bin /lib/svc/method/svc-jboss
chmod 555 /lib/svc/method/svc-jboss
chown root:sys /var/svc/manifest/network/jboss.xml
chmod 444 /var/svc/manifest/network/jboss.xml
Import the Service into the service repository
# svccfg import /var/svc/manifest/network/jboss.xml
Enable the Service
# svcadm -v enable jboss
Reference for further information:
http://docs.sun.com/app/docs/coll/47.16?q=solaris+10
http://www.sun.com/bigadmin/content/selfheal/smf-quickstart.html
http://www.sun.com/bigadmin/content/selfheal/sdev_intro.html
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3860669#3860669
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3860669
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user