[node-patches] Change in ovirt-node[master]: journal: Persist journal files

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue Apr 9 15:23:44 UTC 2013


Fabian Deutsch has uploaded a new change for review.

Change subject: journal: Persist journal files
......................................................................

journal: Persist journal files

Journald flushes jorunal entries to disk (by default) if
/var/log/journal exists. Previously this path did not exists.
Now this path is created on boot and the SELinux permissions are
restored.

rhbz#917523

Change-Id: If6ac14e520437785c8fa1174d5ede25e65226f80
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/ovirt-functions.in
M scripts/ovirt-init-functions.sh
M scripts/ovirtnode/ovirtfunctions.py
3 files changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/53/13753/1

diff --git a/scripts/ovirt-functions.in b/scripts/ovirt-functions.in
index 37fe92e..55a92f0 100644
--- a/scripts/ovirt-functions.in
+++ b/scripts/ovirt-functions.in
@@ -534,6 +534,9 @@
         fi
         restorecon -rv /var/lib/libvirt/images
 
+        mkdir -p /var/log/journal
+        restorecon -rv /var/log/journal
+
         mkdir -p /data/core
         mkdir -p /var/log/core
         if ! grep -q "/var/log/core ext[234]" /proc/mounts; then
diff --git a/scripts/ovirt-init-functions.sh b/scripts/ovirt-init-functions.sh
index 9c24ef7..6e50885 100644
--- a/scripts/ovirt-init-functions.sh
+++ b/scripts/ovirt-init-functions.sh
@@ -1244,6 +1244,9 @@
         # Create a minimalistic /etc/hosts if it's empty, rhbz#829753
         create_minimal_etc_hosts_file
 
+        # Restart jorunald to pick up /var/log/journal
+        service systemd-journald restart
+
         BACKUP=$(mktemp)
         ISSUE=/etc/issue
         ISSUE_NET=/etc/issue.net
diff --git a/scripts/ovirtnode/ovirtfunctions.py b/scripts/ovirtnode/ovirtfunctions.py
index 299108d..bc41cd9 100644
--- a/scripts/ovirtnode/ovirtfunctions.py
+++ b/scripts/ovirtnode/ovirtfunctions.py
@@ -690,6 +690,8 @@
         system_closefds("mkdir -p /var/log/core")
         system_closefds("mount /var/log/core")
         system_closefds("restorecon -rv /var/log/core &>/dev/null")
+        system_closefds("mkdir -p /var/log/journal")
+        system_closefds("restorecon -rv /var/log/journal &>/dev/null")
         return
     else:
         # /data is not available


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6ac14e520437785c8fa1174d5ede25e65226f80
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list