Bug 727224

Summary: matahari service agent start/stop results in rc:198
Product: Red Hat Enterprise Linux 6 Reporter: Dave Johnson <dajohnso>
Component: matahariAssignee: Andrew Beekhof <abeekhof>
Status: CLOSED NOTABUG QA Contact: Dave Johnson <dajohnso>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.2CC: matahari-maint, whayutin
Target Milestone: rc   
Target Release: 6.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-15 06:27:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dave Johnson 2011-08-01 15:23:00 UTC
Description of problem:
Using the Matahari Services agent, starting and stopping services always seems to result in a return code of 198.  On top of that, stopping a service occasionally results in a '$service dead but subsys locked'. 

Version-Release number of selected component (if applicable):
matahari-service-0.4.2-2.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.  install matahari broker and service agent
2.  start broker and service agent
3.  use qmf-tool or python to connect to service agent
4.  use qmf-tool or python to stop/start a service
5.  run status against service in a different shell
  
Actual results:
rc:198, maybe '$service dead but subsys locked' mesg on /etc/init/$service status output

Expected results:
service stopped or running depending on the method called with a return code of 0

Additional info:

# stopped service results in dead 
>>> cmd.getoutput("service crond status")
'crond (pid  1636) is running...'
>>> service.stop("crond",20)
OK (0) - {u'rc': 198}
>>> cmd.getoutput("service crond status")
'crond dead but subsys locked'
>>> 
>>> cmd.getoutput("service httpd status")
'httpd (pid  15737) is running...'
>>> service.stop("httpd",20)
OK (0) - {u'rc': 198}
>>> cmd.getoutput("service httpd status")
'httpd dead but subsys locked'

# even start comes back with a rc: 198 but it does seem to work, service shows running
>>> cmd.getoutput("service httpd status")
'httpd is stopped'
>>> service.start("httpd",20)
OK (0) - {u'rc': 198}
>>> cmd.getoutput("service httpd status")
'httpd (pid  22354) is running...'
>>> 

# more rc:198 but this time, no dead service msg
>>> service.stop("httpd",20)
OK (0) - {u'rc': 198}
>>> cmd.getoutput("service httpd status")
'httpd is stopped'
>>> service.start("httpd",20)
OK (0) - {u'rc': 198}
>>> cmd.getoutput("service httpd status")
'httpd (pid  22414) is running...'
>>> service.stop("httpd",20)
OK (0) - {u'rc': 198}
>>> cmd.getoutput("service httpd status")
'httpd is stopped'

# same result through qmf-tool
qmf: call 1 stop iwhd 20
Output Parameters:
    Name  Value
    =============
    rc    198

Comment 1 Andrew Beekhof 2011-08-09 04:43:10 UTC
the timeout is actually in milliseconds, so really not enough time for the operation to complete ;-)
give 20000 a go and see if you still have a problem