Change in vdsm[master]: Checking syslog availability before starting vdsm

ybronhei at redhat.com ybronhei at redhat.com
Wed Apr 3 08:40:32 UTC 2013


Yaniv Bronhaim has uploaded a new change for review.

Change subject: Checking syslog availability before starting vdsm
......................................................................

Checking syslog availability before starting vdsm

If logger is not able to open /dev/log, it throws exception and vdsm
does not start. This path verifies that this file exist and fail vdsm
start if not.

Change-Id: I60d0537f67da3cf81477760ccb3760a103dc15ac
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=928861
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
---
M vdsm/vdsmd.init.in
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/13547/1

diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in
index c804ce8..a836991 100755
--- a/vdsm/vdsmd.init.in
+++ b/vdsm/vdsmd.init.in
@@ -30,6 +30,7 @@
 PIDFILE=@VDSMRUNDIR@/vdsmd.pid
 RESPAWNPIDFILE=@VDSMRUNDIR@/respawn.pid
 CORE_DUMP_PATH=/var/log/core/core.%p.%t.dump
+SYS_LOG_PATH=/dev/log
 DOM_METADATA_BACKUP_DIR=/var/log/vdsm/backup
 CORE_PATTERN=/proc/sys/kernel/core_pattern
 QEMU_DUMP_PATH="/var/log/core"
@@ -133,6 +134,10 @@
         fi
     done
     return 0
+}
+
+syslog_available() {
+    [[ -x "$SYS_LOG_PATH" ]]
 }
 
 libvirt_should_use_upstart() {
@@ -439,6 +444,12 @@
 
 start() {
     local ret_val
+
+    if ! syslog_available; then
+	log_failure_msg "Cannot communicate with see log. Check rsyslog.conf"
+	return 1
+    fi
+
     python @VDSMDIR@/hooks.pyc before_vdsm_start
 
     shutdown_conflicting_srv && stop_libvirtd_sysv


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60d0537f67da3cf81477760ccb3760a103dc15ac
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