LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Can not start/enable the service (https://www.linuxquestions.org/questions/solaris-opensolaris-20/can-not-start-enable-the-service-4175469250/)

thomas2004ch 07-11-2013 03:48 AM

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.

TB0ne 07-11-2013 03:22 PM

Quote:

Originally Posted by thomas2004ch (Post 4988278)
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.

jlliagre 07-11-2013 05:02 PM

"su: Sorry" is dubious here:
Code:

[ Jul 11 10:39:43 Method "start" exited with status 0 ]
su: Sorry


thomas2004ch 07-12-2013 12:38 AM

Quote:

Originally Posted by TB0ne (Post 4988629)
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.

thomas2004ch 07-12-2013 12:57 AM

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>


thomas2004ch 07-12-2013 04:46 AM

Quote:

Originally Posted by jlliagre (Post 4988686)
"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.

thomas2004ch 07-12-2013 04:54 AM

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?

thomas2004ch 07-18-2013 04:29 AM

The problem is solved. See here:
https://forums.oracle.com/thread/2560145


All times are GMT -5. The time now is 01:06 AM.