Change in vdsm[master]: service: make service compatible with systemctl reload rc

nsoffer at redhat.com nsoffer at redhat.com
Sun Jan 11 09:35:40 UTC 2015


Nir Soffer has posted comments on this change.

Change subject: service: make service compatible with systemctl reload rc
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.ovirt.org/#/c/36491/4/lib/vdsm/tool/service.py
File lib/vdsm/tool/service.py:

Line 297:         rc, out, err = _execSysvEnv(cmd)
Line 298:         status = service_status(srvName, False)
Line 299:         if (rc == 0) and (status != 0):
Line 300:             rc = 1
Line 301:             err = 'reload failed because service was not running'
> its quite the same.. you hide other return values and the race still exist 
If you want to support both systemctl and services transparently, you must behave like systemctl, so you should hide return value. The caller cannot use this value anyway since systemctl hides it.

If you want to make it easier to debug, you can log the actual return code.

The race cannot be eliminated since systemctl does not provide a way to detect reload failure and service not running failure.
Line 302:         return (rc, out, err)
Line 303: 
Line 304:     @_sysvNative
Line 305:     def _serviceIsManaged(srvName):


-- 
To view, visit http://gerrit.ovirt.org/36491
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I878fb898204f7a8a564941b43b12c024ef208765
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list