Yeela Kaplan has uploaded a new change for review.

Change subject: [WIP]ABRT integration
......................................................................

[WIP]ABRT integration

Change-Id: I1ca5e66c9f029be75483b86414e328d074c7e454
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=917062
Signed-off-by: Yeela Kaplan <[email protected]>
---
M init/systemd/vdsmd.service.in
M init/vdsmd_init_common.sh.in
M lib/vdsm/tool/configurators/Makefile.am
A lib/vdsm/tool/configurators/abrt.py
M vdsm.spec.in
M vdsm/vdsm-logrotate
6 files changed, 138 insertions(+), 28 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/87/44287/1

diff --git a/init/systemd/vdsmd.service.in b/init/systemd/vdsmd.service.in
index d7d025f..ccacb2e 100644
--- a/init/systemd/vdsmd.service.in
+++ b/init/systemd/vdsmd.service.in
@@ -2,9 +2,10 @@
 Description=Virtual Desktop Server Manager
 Requires=multipathd.service libvirtd.service time-sync.target \
          iscsid.service rpcbind.service supervdsmd.service sanlock.service \
-         vdsm-network.service
+         vdsm-network.service abrtd.service
 After=multipathd.service libvirtd.service iscsid.service rpcbind.service \
-      supervdsmd.service sanlock.service vdsm-network.service
+      supervdsmd.service sanlock.service vdsm-network.service \
+      abrtd.service
 Conflicts=libvirt-guests.service
 Wants=mom-vdsm.service
 
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 00e4054..df2878c 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -83,16 +83,6 @@
     return 0
 }
 
-task_configure_coredump() {
-    local conf_file="@CONFDIR@/vdsm.conf"
-    local getconfitem="@VDSMDIR@/get-conf-item"
-
-    if "${getconfitem}" "${conf_file}" vars core_dump_enable false |
-      tr A-Z a-z | grep -q true; then
-        echo "/var/log/core/core.%p.%t.dump" > /proc/sys/kernel/core_pattern
-    fi
-}
-
 task_configure_vdsm_logs() {
     local vdsm_logs="
         @VDSMLOGDIR@/connectivity.log
@@ -296,7 +286,6 @@
     --pre-start)
         run_tasks " \
             mkdirs \
-            configure_coredump \
             configure_vdsm_logs \
             wait_for_network \
             run_init_hooks \
diff --git a/lib/vdsm/tool/configurators/Makefile.am 
b/lib/vdsm/tool/configurators/Makefile.am
index 9fc7e57..f70b4bb 100644
--- a/lib/vdsm/tool/configurators/Makefile.am
+++ b/lib/vdsm/tool/configurators/Makefile.am
@@ -21,6 +21,7 @@
 
 dist_configurators_PYTHON = \
        __init__.py \
+       abrt.py \
        certificates.py \
        libvirt.py \
        multipath.py \
diff --git a/lib/vdsm/tool/configurators/abrt.py 
b/lib/vdsm/tool/configurators/abrt.py
new file mode 100644
index 0000000..778f505
--- /dev/null
+++ b/lib/vdsm/tool/configurators/abrt.py
@@ -0,0 +1,132 @@
+# Copyright 2015 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+import sys
+import os
+
+from .import \
+    MAYBE, \
+    NO
+from .. import service
+from ... import utils
+from ... import constants
+
+from .. import conf_utils
+
+CONF_VERSION = '4.17.0'
+
+
+services = ("abrtd",)
+
+
+def configure():
+
+    conf_utils.remove_conf(FILES, CONF_VERSION)
+
+    for conf_file, content in FILES.items():
+        content['configure'](content, CONF_VERSION)
+
+
+def isconfigured():
+    """
+    Check if abrt is already configured for vdsm
+    """
+    ret = MAYBE
+
+    for path in (conf_utils.get_persisted_files(FILES)):
+        if not conf_utils.open_config(path, CONF_VERSION).hasConf():
+            ret = NO
+
+    if ret == MAYBE:
+        sys.stdout.write("abrt is already configured for vdsm\n")
+    else:
+        sys.stdout.write("abrt is not configured for vdsm\n")
+    return ret
+
+
+FILES = {
+    'ABRT_CONF': {
+        'path': os.path.join(
+            constants.SYSCONF_PATH,
+            'abrt/abrt.conf'
+        ),
+        'configure': conf_utils.add_section,
+        'removeConf': conf_utils.remove_section,
+        'persisted': True,
+        'fragments': [
+            {
+                'conditions': {},
+                'content': {
+                    'DumpLocation': '/var/tmp/abrt'
+                },
+            },
+        ]
+    },
+    'CCPP_CONF': {
+        'path': os.path.join(
+            constants.SYSCONF_PATH,
+            'abrt/plugins/CCpp.conf'
+        ),
+        'configure': conf_utils.add_section,
+        'removeConf': conf_utils.remove_section,
+        'persisted': True,
+        'fragments': [
+            {
+                'conditions': {},
+                'content': {
+                    'Backtrace': 'yes'
+                },
+            },
+        ]
+    },
+    'PYTHON_CONF': {
+        'path': os.path.join(
+            constants.SYSCONF_PATH,
+            'abrt/plugins/python.conf'
+        ),
+        'configure': conf_utils.add_section,
+        'removeConf': conf_utils.remove_section,
+        'persisted': True,
+        'fragments': [
+            {
+                'conditions': {},
+                'content': {
+                    'Backtrace': 'yes'
+                },
+            },
+        ]
+    },
+    'PKG_CONF': {
+        'path': os.path.join(
+            constants.SYSCONF_PATH,
+            'abrt/abrt-action-save-package-data.conf'
+        ),
+        'configure': conf_utils.add_section,
+        'removeConf': conf_utils.remove_section,
+        'persisted': True,
+        'fragments': [
+            {
+                'conditions': {},
+                'content': {
+                    'openGPGCheck': 'no'
+                },
+            },
+        ]
+    }
+}
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 21e1b50..6e524c5 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -132,6 +132,7 @@
 Requires: nfs-utils
 Requires: m2crypto
 Requires: libnl3
+Requires: abrt-desktop
 Requires: curl
 Requires: %{name}-xmlrpc = %{version}-%{release}
 Requires: %{name}-jsonrpc = %{version}-%{release}
@@ -709,13 +710,6 @@
         /etc/sysctl.conf
 fi
 
-# hack until we replace core dump with abrt
-if /usr/sbin/selinuxenabled; then
-    /usr/sbin/semanage fcontext -a -t virt_cache_t '/var/log/core(/.*)?'
-fi
-/sbin/restorecon -R /var/log/core >/dev/null 2>&1
-# hack until we replace core dump with abrt
-
 # VDSM installs vdsm-modules-load.d.conf file - the following command will
 # refresh vdsm kernel modules requirements to start on boot
 /bin/systemctl restart systemd-modules-load.service >/dev/null 2>&1 || :
@@ -1097,6 +1091,7 @@
 %{python_sitelib}/%{vdsm_name}/tool/conf_utils.py*
 %{python_sitelib}/%{vdsm_name}/tool/configurator.py*
 %{python_sitelib}/%{vdsm_name}/tool/configurators/__init__*
+%{python_sitelib}/%{vdsm_name}/tool/configurators/abrt.py*
 %{python_sitelib}/%{vdsm_name}/tool/configurators/certificates.py*
 %{python_sitelib}/%{vdsm_name}/tool/configurators/libvirt.py*
 %{python_sitelib}/%{vdsm_name}/tool/configurators/passwd.py*
diff --git a/vdsm/vdsm-logrotate b/vdsm/vdsm-logrotate
index e2027ac..17d26ab 100755
--- a/vdsm/vdsm-logrotate
+++ b/vdsm/vdsm-logrotate
@@ -7,12 +7,4 @@
     /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
 fi
 
-if [ -d /var/log/core ] ; then
-    /usr/bin/find /var/log/core -type f -name '*xz' -mtime +7 -exec /bin/rm -f 
'{}' \;
-    EXITVALUE=$?
-    if [ $EXITVALUE != 0 ]; then
-        /usr/bin/logger -t logrotate "ALERT clean old core files exited 
abnormally with [$EXITVALUE]"
-    fi
-fi
-
 exit $EXITVALUE


-- 
To view, visit https://gerrit.ovirt.org/44287
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ca5e66c9f029be75483b86414e328d074c7e454
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to