LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 07-11-2013, 03:48 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
Can not start/enable the service


I created and imported a service in the SMF. It works fine since days. But today I can't get it start. I delete this service and re-imprt it. But fail to start it. In the log I can see fowllings:

Code:
...
[ Jul 11 10:39:41 Executing start method ("/lib/svc/method/wsvws start") ]
Starting jboss-as ... cleaning the cache ...
/opt/jboss-apps/wsvws/tmp not exist
/opt/jboss-apps/wsvws/data not exist
skipping       31 lines of /var/log/jboss-apps/wsvws/server.log
[OK]
[ Jul 11 10:39:43 Method "start" exited with status 0 ]
su: Sorry
[ Jul 11 10:39:45 Stopping because all processes in service exited. ]
[ Jul 11 10:39:45 Executing stop method ("/lib/svc/method/wsvws stop") ]
Stopping jboss-as... Jboss is stopped.
[ Jul 11 10:39:45 Method "stop" exited with status 0 ]
[ Jul 11 10:39:45 Restarting too quickly, changing state to maintenance ]
...
I wonder why.
 
Old 07-11-2013, 03:22 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by thomas2004ch View Post
I created and imported a service in the SMF. It works fine since days. But today I can't get it start. I delete this service and re-imprt it. But fail to start it. In the log I can see fowllings:
Code:
...
[ Jul 11 10:39:41 Executing start method ("/lib/svc/method/wsvws start") ]
Starting jboss-as ... cleaning the cache ...
/opt/jboss-apps/wsvws/tmp not exist
/opt/jboss-apps/wsvws/data not exist
skipping       31 lines of /var/log/jboss-apps/wsvws/server.log   [OK]
[ Jul 11 10:39:43 Method "start" exited with status 0 ]   su: Sorry
[ Jul 11 10:39:45 Stopping because all processes in service exited. ]
[ Jul 11 10:39:45 Executing stop method ("/lib/svc/method/wsvws stop") ]
Stopping jboss-as... Jboss is stopped.
[ Jul 11 10:39:45 Method "stop" exited with status 0 ]
[ Jul 11 10:39:45 Restarting too quickly, changing state to maintenance ]
I wonder why.
Well, we can't tell you, since you don't provide any useful details. All you've told us is that you created 'a service in the SMF'. It was working "since days", and now it's not.

Short answer: something changed, so change it back to the working state. Otherwise, post details, and we can try to help you.
 
Old 07-11-2013, 05:02 PM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
"su: Sorry" is dubious here:
Code:
[ Jul 11 10:39:43 Method "start" exited with status 0 ]
su: Sorry
 
Old 07-12-2013, 12:38 AM   #4
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by TB0ne View Post
Short answer: something changed, so change it back to the working state. Otherwise, post details, and we can try to help you.
I haven't changed anything. But I am not sure if someone else changed something on the server machine or not.

I remember what I did yesterday is: I set the 'svcadm -t disable service-name' because I want to test if the service can be started by rebooting. But since I can't reboot the machine at this moment - the other colleague are working at the machine. I try to enable it again with 'svcadm enable service-name'. Since here the service can't be started.

What details do you want? I will attach the svcs -x and svcs -l here.
Code:
root@S001AP61-TEST (vws-tst1) # svcs -xv wsvws:default
svc:/application/jboss/wsvws:default (wsvws service)
 State: maintenance since Fri Jul 12 07:33:01 2013
Reason: Restarting too quickly.
   See: http://sun.com/msg/SMF-8000-L5
   See: /var/svc/log/application-jboss-wsvws:default.log
Impact: This service is not running.
Code:
root@S001AP61-TEST (vws-tst1) # svcs -l wsvws:default
fmri         svc:/application/jboss/wsvws:default
name         wsvws service
enabled      true
state        maintenance
next_state   none
state_time   Fri Jul 12 07:33:01 2013
logfile      /var/svc/log/application-jboss-wsvws:default.log
restarter    svc:/system/svc/restarter:default
contract_id
root@S001AP61-TEST (vws-tst1) #
From the error id in svcs -x 'http://sun.com/msg/SMF-8000-L5', the description is: The service terminated and was restarted more frequently than normal. The Solaris Service Manager placed the service into maintaenance mode instead of restarting it again.

I don't understand what here "restarted more frequently than normal" means.

Last edited by thomas2004ch; 07-12-2013 at 12:51 AM.
 
Old 07-12-2013, 12:57 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
And here is the manifest to the service:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='wsvws'>
	<service name='application/jboss/wsvws' type='service' version='1'>
		<create_default_instance enabled='false' />
		<single_instance />
		<method_context>
			<method_credential user='wsvws' group='jboss' />
		</method_context>
		<exec_method type='method' name='start' exec='/lib/svc/method/wsvws start'
			timeout_seconds='60' />
		<exec_method type='method' name='stop' exec='/lib/svc/method/wsvws stop'
			timeout_seconds='60' />
		<exec_method type='method' name='restart'
			exec='/lib/svc/method/wsvws restart' timeout_seconds='60' />
		<stability value='Evolving' />
		<template>
			<common_name>
				<loctext xml:lang='C'>wsvws service</loctext>
			</common_name>
		</template>
		
	</service>
</service_bundle>

Last edited by thomas2004ch; 07-12-2013 at 04:44 AM.
 
Old 07-12-2013, 04:46 AM   #6
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by jlliagre View Post
"su: Sorry" is dubious here:
Code:
[ Jul 11 10:39:43 Method "start" exited with status 0 ]
su: Sorry
There is embeded command 'su' in the init-script. I've taken out this and there is no any message of "su: Sorry". But the other error message are the same as before. This means, the 'su' is not the reason.
 
Old 07-12-2013, 04:54 AM   #7
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
I do further research and find interessting thing.

First here i smy init-script. I taked out a lot of codes and left the simple codes as follow:
Code:
#!/usr/bin/sh
#

start() {
	echo Starting...
}

stop() {
	echo stopping...
}

case "$1" in
  start)
      start
      sleep 2
      ;;
  stop)
      stop
      sleep 2
      ;;
  restart)
      $0 stop
      $0 start
      ;;
  status)
      status
      ;;
  cleanup)
      cleanup
      ;;
  *)
      ## If no parameters are given, print which are avaiable.
      echo "Usage: $0 {start|stop|status|restart|reload|cleanup}"
      exit 1
      ;;
esac
If I run this init-script manuelly there is no any problem.

But when I use the SMF to controll this script and want to start it with svcadm enable service-name, I can see in the log file that the service will be started and stopped 5 times and at last it changed to maintenance mode. This means, there is a loop in the SMF. This is why I got the error message "http://sun.com/msg/SMF-8000-L5".

But why?
 
Old 07-18-2013, 04:29 AM   #8
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
The problem is solved. See here:
https://forums.oracle.com/thread/2560145
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
puppet needs to stop a service, do something, then start the service edwardcode Programming 1 12-03-2012 01:58 PM
ssh service start & enable ? bjh SUSE / openSUSE 3 02-16-2009 01:43 PM
Telnet service enable? mehmet_yuce Linux - Networking 1 06-30-2008 05:03 PM
Enable daemon to run with service daemon start,etc baddah Programming 6 12-02-2007 05:51 PM
when i try to start samba pdc's smb service nmbd failed to start . sandeepchau123 Linux - Newbie 2 10-20-2007 01:59 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration