Change in vdsm[master]: Adding check of os.access to vdsm log file during startup
ybronhei at redhat.com
ybronhei at redhat.com
Tue Dec 4 12:27:37 UTC 2012
Yaniv Bronhaim has uploaded a new change for review.
Change subject: Adding check of os.access to vdsm log file during startup
......................................................................
Adding check of os.access to vdsm log file during startup
If log file isn't accessible we'll report to syslog and exit
Change-Id: I578bdfaa199afc2d5f154a1de12241e02b1ca1a4
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
---
M vdsm/vdsm
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/9700/1
diff --git a/vdsm/vdsm b/vdsm/vdsm
index 035ea5d..94c795b 100755
--- a/vdsm/vdsm
+++ b/vdsm/vdsm
@@ -111,6 +111,11 @@
sys.exit(1)
+def __assertLogPermission():
+ logfile = constants.P_VDSM_LOG + "vdsm.log"
+ assert(os.access(logfile, os.W_OK), "error in accessing vdsm log file")
+
+
def __assertVdsmUser():
username = getpass.getuser()
assert username == constants.VDSM_USER, (
@@ -124,6 +129,7 @@
if __name__ == '__main__':
__assertVdsmUser()
+ __assertLogPermission()
os.setpgrp()
parse_args()
run()
--
To view, visit http://gerrit.ovirt.org/9700
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I578bdfaa199afc2d5f154a1de12241e02b1ca1a4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>
More information about the vdsm-patches
mailing list