banner

[Rule] Rules  [Home] Main Forum  [Portal] Portal  
[Members] Member Listing  [Statistics] Statistics  [Search] Search  [Reading Room] Reading Room 
[Register] Register  
[Login] Loginhttp  | https  ]
 
Forum Index Thảo luận hệ điều hành *nix Cấu hình automatic start apache tomcat 7 on Solaris 10  XML
  [Question]   Cấu hình automatic start apache tomcat 7 on Solaris 10 29/06/2012 13:11:23 (+0700) | #1 | 265767
anhtuank7c
Member

[Minus]    0    [Plus]
Joined: 19/10/2008 17:36:10
Messages: 7
Offline
[Profile] [PM]
Chào moị người.
Mình cấu hình tự động khởi động tomcat 7 lúc hệ thống solaris 10 khởi động nhưng k thành công.
Mọi ng check giúp mình xem mình sai đoạn nào nhé.
Mình có 2 file: tomcat.xml và tomcat.sh
Nội dung file xml:
Code:
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='tomcat'>
	<service name='application/servers/tomcat' type='service' version='1'>
		<create_default_instance enabled='false' />
		<single_instance/>

		<dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
			<service_fmri value='svc:/system/filesystem/local'/>
		</dependency>
		<dependency name='network-service' grouping='require_all' restart_on='none' type='service'>
			<service_fmri value='svc:/network/service'/>
		</dependency>
		<dependency name='name-services' grouping='require_all' restart_on='none' type='service'>
			<service_fmri value='svc:/milestone/name-services'/>
		</dependency>
		<dependency name='identity' grouping='optional_all' restart_on='none' type='service'>
			<service_fmri value='svc:/system/identity:domain'/>
		</dependency>
		<dependency name='system-log' grouping='optional_all' restart_on='none' type='service'>
			<service_fmri value='svc:/system/system-log'/>
		</dependency>
		<dependency name='autofs' grouping='optional_all' restart_on='none' type='service'>
			<service_fmri value='svc:/system/filesystem/autofs'/>
		</dependency>

		<exec_method type='method' name='start' exec='/app/ftl/smf/tomcat.sh start' timeout_seconds='500' >
			<method_context working_directory='/app/ftl/smf'>
				<method_credential user='root' group='root' privileges='all' />
			</method_context>
		</exec_method>
		<exec_method type='method' name='stop' exec='/app/ftl/smf/tomcat.sh stop' timeout_seconds='500' >
			<method_context working_directory='/app/ftl/smf'>
				<method_credential user='root' group='root' />
			</method_context>
		</exec_method>
		<stability value='Unstable' />
		<template>
			<common_name>
				<loctext xml:lang='C'>Tomcat</loctext>
			</common_name>
		</template>
	</service>
</service_bundle>

Còn đây là nội dung file sh.
Code:
#!/bin/bash
CATALINA_HOME=/app/tomcat; export CATALINA_HOME

case "$1" in
	'start')
	#"$CATALINA_HOME/bin/startup.sh"
;;
	'stop')
	#"$CATALINA_HOME/bin/stop_all_tomcat.sh"
;;
	'restart')
	#"$CATALINA_HOME/bin/stop_all_tomcat.sh"
	#"$CATALINA_HOME/bin/startup.sh"
;;
esac


Mình tạo ra 2 file này và dùng lệnh: svccfg -v import tomcat.xml để thêm mới service.
sau đó mình enable dịch vụ lên: svcadm enable tomcat
sau đó mình xem status của nó: svcs tomcat
nhưng service luôn bị báo là : maintaince.
Code:
bash-3.00# svcs tomcat
STATE          STIME    FMRI
maintenance    13:27:47 svc:/application/servers/tomcat:default


Các bạn check giúp mình xem mình sai chỗ nào với.
Tomcat mình để ở thư mục: /app/tomcat
Cảm ơn đã đọc bài.
[Up] [Print Copy]
  [Question]   Cấu hình automatic start apache tomcat 7 on Solaris 10 30/06/2012 09:02:35 (+0700) | #2 | 265807
[Avatar]
quanta
Moderator

Joined: 28/07/2006 14:44:21
Messages: 7265
Location: $ locate `whoami`
Offline
[Profile] [PM]

http://www.princeton.edu/~unix/Solaris/troubleshoot/smf.html wrote:

Maintenance

If a service is in the maintenance state, first make sure that all associated processes have died:
Code:
svcs -p FMRI

Next, (for all processes displayed by the above):
Code:
pkill -9 PID

Consult the appropriate logs in `/var/svc/log` to check any errors; perform any needed maintenance.
Restore the service:
Code:
svcadm clear FMRI
 
Let's build on a great foundation!
[Up] [Print Copy]
[digg] [delicious] [google] [yahoo] [technorati] [reddit] [stumbleupon]
Go to: 
 Users currently in here 
1 Anonymous

Powered by JForum - Extended by HVAOnline
 hvaonline.net  |  hvaforum.net  |  hvazone.net  |  hvanews.net  |  vnhacker.org
1999 - 2013 © v2012|0504|218|