Change in vdsm[ovirt-3.4]: pre-start: touch/configure vdsm logs
dougsland at redhat.com
dougsland at redhat.com
Tue Mar 25 19:15:04 UTC 2014
Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/26095
to review the following change.
Change subject: pre-start: touch/configure vdsm logs
......................................................................
pre-start: touch/configure vdsm logs
During pre-start of vdsm we must create vdsm logs files
with proper perms/user/group/ if they doesn't exist.
This situation happens currently because during
ovirt node build it cleans /var/log dir so it will
remove all vdsm logs created during rpm install.
Change-Id: I6ca927cb447eeb24195cff6a1174e0f9a7295214
Signed-off-by: Douglas Schilling Landgraf <dougsland at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/25912
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M configure.ac
M init/vdsmd_init_common.sh.in
2 files changed, 18 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/95/26095/1
diff --git a/configure.ac b/configure.ac
index e845475..71f91bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -241,6 +241,7 @@
AC_PATH_PROG([SYSTEMCTL_PATH], [systemctl], [/bin/systemctl])
AC_PATH_PROG([TAR_PATH], [tar], [/bin/tar])
AC_PATH_PROG([TC_PATH], [tc], [/sbin/tc])
+AC_PATH_PROG([TOUCH_PATH], [touch], [/bin/touch])
AC_PATH_PROG([TUNE2FS_PATH], [tune2fs], [/sbin/tune2fs])
AC_PATH_PROG([UDEVADM_PATH], [udevadm], [/sbin/udevadm])
AC_PATH_PROG([UMOUNT_PATH], [umount], [/bin/umount])
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 00a33db..47b147c 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -32,6 +32,22 @@
fi
}
+task_configure_vdsm_logs() {
+ local vdsm_logs="
+ @VDSMLOGDIR@/metadata.log
+ @VDSMLOGDIR@/mom.log
+ @VDSMLOGDIR@/vdsm.log
+ "
+
+ for logfile in ${vdsm_logs}; do
+ if [ ! -e "${logfile}" ]; then
+ @TOUCH_PATH@ "${logfile}"
+ @CHMOD_PATH@ 0644 "${logfile}"
+ @CHOWN_PATH@ @VDSMUSER@:@VDSMGROUP@ "${logfile}"
+ fi
+ done
+}
+
task_run_init_hooks(){
"@PYTHON@" "@VDSMDIR@/hooks.pyc" before_vdsm_start
}
@@ -221,6 +237,7 @@
run_tasks " \
mkdirs \
configure_coredump \
+ configure_vdsm_logs \
run_init_hooks \
gencerts \
check_is_configured \
--
To view, visit http://gerrit.ovirt.org/26095
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ca927cb447eeb24195cff6a1174e0f9a7295214
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
More information about the vdsm-patches
mailing list