[NEW PATCH] BZ#731750 - handle missing libvirt lograte config (via gerrit-bot)

Saggi Mizrahi smizrahi at redhat.com
Sun Aug 28 07:47:19 UTC 2011


New patch submitted by Saggi Mizrahi (smizrahi at redhat.com)

You can review this change at: http://gerrit.usersys.redhat.com/856

commit b1d3bc49f78237b0b7d5e71700090e4ad43359d6
Author: Saggi Mizrahi <smizrahi at redhat.com>
Date:   Sun Aug 28 10:28:42 2011 +0300

    BZ#731750 - handle missing libvirt lograte config
    
    * I also added restorecon in case there is a configuration where
      logrotate conf file should have a special context.
    
    VDSM failed to start if it couldn't find the original libvirt logrotate
    configurations. Because we just replace the configuration there is no
    need to actually make sure the old one existed. If it didn't we can just
    create a new config with default permissions.
    
    Change-Id: If909667a96a75df9070baca4054406a465cb11e0

diff --git a/vdsm/vdsmd.in b/vdsm/vdsmd.in
index 60a5afd..d05603a 100755
--- a/vdsm/vdsmd.in
+++ b/vdsm/vdsmd.in
@@ -339,7 +339,10 @@ EOF
     /bin/cat "$llogr" >> "$stanza"
     local oldmod=`/usr/bin/stat --format=%a "$llogr"`
     /bin/mv "$stanza" "$llogr"
-    /bin/chmod "$oldmod" "$llogr"
+    if [ -n "$oldmod" ]; then
+       /bin/chmod "$oldmod" "$llogr"
+    fi
+    restorecon "$llogr"
 
     ovirt_store_config "$lconf" "$qconf" "$ldconf" "$llogr"
 




More information about the vdsm-patches mailing list