Zhou Zheng Sheng has uploaded a new change for review.
Change subject: fix crash when sync with libvirt network ......................................................................
fix crash when sync with libvirt network
When sync with libvirt network, vdsm finds out networks in libvirt whose corresponding bridge is not existed, then vdsm deletes those networks. vdsm creates a dir for storing the deleted network config as backups. It chown the dir to vdsm:root, but the process runs as vdsm:kvm, so this leads to an Exception. The sync is run in clientIF.__init__, so the Exception causes vdsmd crashing on start.
So this patch chown the dir to vdsm:kvm, then vdsmd starts OK.
Change-Id: I4a3ea0303656cba87bf17b14929fe59bf0d46337 Signed-off-by: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com --- M vdsm/configNetwork.py 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/56/7156/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py index 9dffcdd..5ce3cf6 100755 --- a/vdsm/configNetwork.py +++ b/vdsm/configNetwork.py @@ -212,12 +212,14 @@ # original copy already backed up return
- vdsm_uid = pwd.getpwnam('vdsm').pw_uid + pwdEntry = pwd.getpwnam('vdsm') + vdsm_uid = pwdEntry.pw_uid + vdsm_gid = pwdEntry.pw_gid
# make directory (if it doesn't exist) and assign it to vdsm if not os.path.exists(dirName): os.makedirs(dirName) - os.chown(dirName, vdsm_uid, 0) + os.chown(dirName, vdsm_uid, vdsm_gid)
open(backup, 'w').write(content) os.chown(backup, vdsm_uid, 0)
-- To view, visit http://gerrit.ovirt.org/7156 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I4a3ea0303656cba87bf17b14929fe59bf0d46337 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng zhshzhou@linux.vnet.ibm.com