solaris tomcat开机启动

创建文件夹/var/svc/manifest/application/web/


创建文档/opt/tomcat7.0.42-solaris/conf/solaris.xml

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<!--
solaris.xml : Tomcat service manifest
-->

<service_bundle type='manifest' name='xxx.com'>
<!-- 服务说明 仅需修改 name属性的最后一个值/xxxx为所需的服务名 -->
<service name='application/web/xxxxx' type='service' version='1'>
<dependency name='filesystem' grouping='require_all' restart_on='none' type='service'>
<service_fmri value='svc:/system/filesystem/local:default'/>
</dependency>
<!--
服务启动脚本 需配置 name和 exec两个属性
name为实例名,名称需保证整个solaris服务器唯一,英文,与编程变量命令规则一致,例如此处为xxxx
exec 为启动脚本绝对路径
-->
<instance name='xxxx' enabled='true'>
<exec_method
type='method'
name='start'
exec='/opt/tomcat7.0.42-solaris/bin/startup.sh'
timeout_seconds='300' />

<!-- 服务停止脚本 需配置 exec属性 -->
<exec_method
type='method'
name='stop'
exec='/opt/tomcat7.0.42-solaris/bin/shutdown.sh'
timeout_seconds='300' />
</instance>

<stability value='Evolving' />

<template>
<common_name>
<loctext xml:lang='C'>xxx.com xxxx </loctext> <!-- 服务说明 -->
</common_name>
</template>
</service>



</service_bundle>



注册服务polearchive
svccfg import /opt/tomcat7.0.42-solaris/conf/solaris.xml

启用服务xxxx
svcadm enable xxxx

查看服务状态xxxx
svcs -lp xxxx

停用服务xxxx
svcadm disable xxxx

重启服务xxxx
svcadm restart xxxx

删除服务xxxx
svccfg delete xxxx
;