1

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.

ciwol
  • 11
  • 1
  • 3

3 Answers3

0

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

ramruma
  • 2,730
  • 1
  • 14
  • 8
  • 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 08:17
  • ls -l in /users > drwxr-xr-x 5 adm0ardp gpm0ardp 512 mai 29 11:24 adm0ardp – ciwol May 29 '12 at 09:44
0

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.

mghocke
  • 796
  • 4
  • 5
0

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' />

belacqua
  • 583
  • 4
  • 10
ciwol
  • 11
  • 1
  • 3