Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hi I'm trying to start a new service on server reboot and I got this error on start: "Method "start" exited with status 96". Also my service in on "Maintenance" state.

My service is working when I disable/enable it, but not when I restart (wich is the goal).

I've googled the following errors and couldn't figure out what the problem is:

The error log:

svc.startd could not set context for method: chdir: Ce fichier ou ce répertoire n'existe pas

Method "start" exited with status 96 

My .xml:

<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

<service_bundle type='manifest' name='broker2'>

<service
    name="application/broker2"
    type="service"
    version="1">
<instance name='default' enabled='true'>

    <exec_method
          type='method'
          name='start'
          exec='/lib/svc/method/svc-broker start'
          timeout_seconds='30' >

        <method_context working_directory='/users/adm0ardp'>
            <method_credential user='adm0ardp' group='gpm0ardp' />
        </method_context>
    </exec_method>

    <exec_method
           type='method'
           name='stop'
           exec='/lib/svc/method/svc-broker stop'
           timeout_seconds='3' >

        <method_context working_directory='/users/adm0ardp'>
            <method_credential user='adm0ardp' group='gpm0ardp' />
        </method_context>
     </exec_method>

</instance>             

</service>
</service_bundle>

and my script:

#!/usr/bin/sh

. /lib/svc/share/smf_include.sh

case "$1" in
  start) script_path.ksh 
;;
  stop) script_path.ksh   
;;

esac 
exit 0

Any help could be great.

share|improve this question
add comment

3 Answers

The error shows that cd/chdir failed. Is user adm0ardp correctly specified (and spelled) and able to cd into /users/adm0ardp?

share|improve this answer
    
Yes adm0ardp can access and write into this directory, which is his home directory. I don't know where to look else. –  ciwol May 29 '12 at 8:17
    
ls -l in /users > drwxr-xr-x 5 adm0ardp gpm0ardp 512 mai 29 11:24 adm0ardp –  ciwol May 29 '12 at 9:44
add comment

Is /users a symlink to somewhere else? Are the directories under /users automounted? Do permissions on /users itself prevent user adm0ardp to see /users/adm0ardp? The error message does say that the directory does not exist. I would use truss or dtrace and watch the svc.startd process and see what's happening when you execute svcadm enable.

share|improve this answer
add comment
up vote 0 down vote accepted

The problem turned out to be that my service was called too early and couldn't start before other services. To fix this, I added a dependency on one of the last services starting -- this could be, for example, rlogin, ssh, etc..

Here's the code I added in .xml:

<dependency name='login'
grouping='require_all' 
restart_on='none'      
type='service'>
<service_fmri value='svc:/network/login:rlogin' />

share|improve this answer
    
Thank you for the edit :) –  ciwol May 31 '12 at 12:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.