Changes to 'refs/tags/spacewalk-monitoring-1.9.4-1'
by Michael Mraka
Tag 'spacewalk-monitoring-1.9.4-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2013-02-26 10:47 +0000
Tagging package [spacewalk-monitoring] version [1.9.4-1] in directory [monitoring/spacewalk-monitoring/].
Changes since spacewalk-schema-1.9.35-1:
Michael Mraka (4):
let's enable & start rhnsd properly in systemd
enable monitoring services in systemd by default
corrected monitoring service type
Automatic commit of package [spacewalk-monitoring] release [1.9.4-1].
Milan Zazrivec (1):
abrt: check the allowed filesize limit is >= 0
---
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 33 ++++++----
monitoring/spacewalk-monitoring/Monitoring.service | 2
monitoring/spacewalk-monitoring/MonitoringScout.service | 2
monitoring/spacewalk-monitoring/spacewalk-monitoring.spec | 22 ++++--
rel-eng/packages/spacewalk-monitoring | 2
schema/spacewalk/common/tables/web_customer.sql | 4 -
schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.oracle | 3
schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.postgresql | 5 -
8 files changed, 50 insertions(+), 23 deletions(-)
---
11 years, 2 months
4 commits - client/rhel monitoring/spacewalk-monitoring rel-eng/packages
by Michael Mraka
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 33 ++++++++------
monitoring/spacewalk-monitoring/Monitoring.service | 2
monitoring/spacewalk-monitoring/MonitoringScout.service | 2
monitoring/spacewalk-monitoring/spacewalk-monitoring.spec | 22 ++++++---
rel-eng/packages/spacewalk-monitoring | 2
5 files changed, 42 insertions(+), 19 deletions(-)
New commits:
commit d87a448790538585e93709054cf9ba23a2db3876
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 26 11:47:23 2013 +0100
Automatic commit of package [spacewalk-monitoring] release [1.9.4-1].
diff --git a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec
index 95bf31c..b3665af 100644
--- a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec
+++ b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec
@@ -1,7 +1,7 @@
Summary: Spacewalk monitoring
Name: spacewalk-monitoring
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 1.9.3
+Version: 1.9.4
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
License: GPLv2
@@ -139,6 +139,10 @@ rm -rf $RPM_BUILD_ROOT
%doc LICENSE
%changelog
+* Tue Feb 26 2013 Michael Mraka <michael.mraka(a)redhat.com> 1.9.4-1
+- corrected monitoring service type
+- enable monitoring services in systemd by default
+
* Wed Feb 13 2013 Michael Mraka <michael.mraka(a)redhat.com> 1.9.3-1
- fixing rpm build failure
diff --git a/rel-eng/packages/spacewalk-monitoring b/rel-eng/packages/spacewalk-monitoring
index faa7fd4..47f07ec 100644
--- a/rel-eng/packages/spacewalk-monitoring
+++ b/rel-eng/packages/spacewalk-monitoring
@@ -1 +1 @@
-1.9.3-1 monitoring/spacewalk-monitoring/
+1.9.4-1 monitoring/spacewalk-monitoring/
commit 1a8872b85d012ea3b494622ef066671b0c766bbc
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 26 11:42:10 2013 +0100
corrected monitoring service type
fixing service status reporting under systemctl
systemctl status Monitoring
Monitoring.service - Spacewalk Monitoring service
Loaded: loaded (/usr/lib/systemd/system/Monitoring.service; enabled)
Active: inactive (dead) since Tue 2013-02-26 05:36:39 EST; 8s ago
diff --git a/monitoring/spacewalk-monitoring/Monitoring.service b/monitoring/spacewalk-monitoring/Monitoring.service
index e08e66b..c8d13f4 100644
--- a/monitoring/spacewalk-monitoring/Monitoring.service
+++ b/monitoring/spacewalk-monitoring/Monitoring.service
@@ -5,6 +5,8 @@ After=syslog.target network.target
[Service]
ExecStart=/usr/sbin/Monitoring start
ExecStop=/usr/sbin/Monitoring stop
+Type=oneshot
+RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
diff --git a/monitoring/spacewalk-monitoring/MonitoringScout.service b/monitoring/spacewalk-monitoring/MonitoringScout.service
index 012c3e9..cfa49c0 100644
--- a/monitoring/spacewalk-monitoring/MonitoringScout.service
+++ b/monitoring/spacewalk-monitoring/MonitoringScout.service
@@ -5,6 +5,8 @@ After=syslog.target network.target
[Service]
ExecStart=/usr/sbin/MonitoringScout start
ExecStop=/usr/sbin/MonitoringScout stop
+Type=oneshot
+RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
commit 53074447864e69bef60e4e66a6b4f2fefeb58088
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 26 10:16:11 2013 +0100
enable monitoring services in systemd by default
diff --git a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec
index b568a09..95bf31c 100644
--- a/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec
+++ b/monitoring/spacewalk-monitoring/spacewalk-monitoring.spec
@@ -49,7 +49,7 @@ Requires: tsdb
Requires: spacewalk-monitoring-selinux
%if 0%{?fedora}
-Requires(preun): systemd
+%systemd_requires
%else
Requires(post): chkconfig
Requires(preun): chkconfig
@@ -100,6 +100,12 @@ fi
if [ -x /etc/init.d/MonitoringScout ] ; then
/sbin/chkconfig --add MonitoringScout
fi
+if [ -r %{_unitdir}/Monitoring.service ] ; then
+ /usr/bin/systemctl enable Monitoring.service
+fi
+if [ -r %{_unitdir}/MonitoringScout.service ] ; then
+ /usr/bin/systemctl enable MonitoringScout.service
+fi
%preun
if [ $1 = 0 ] ; then
@@ -111,11 +117,11 @@ if [ $1 = 0 ] ; then
/sbin/service Monitoring stop >/dev/null 2>&1
/sbin/chkconfig --del Monitoring
fi
- if [ -f %{_unitdir}/MonitoringScout ] ; then
- /usr/bin/systemctl stop MonitoringScout
+ if [ -f %{_unitdir}/MonitoringScout.service ] ; then
+ %systemd_preun MonitoringScout.service
fi
- if [ -f %{_unitdir}/Monitoring ] ; then
- /usr/bin/systemctl stop Monitoring
+ if [ -f %{_unitdir}/Monitoring.service ] ; then
+ %systemd_preun Monitoring.service
fi
fi
commit 529a11006a8c2424333bfe471fd71883c90231e0
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Tue Feb 26 09:44:15 2013 +0100
let's enable & start rhnsd properly in systemd
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index fbdb0d9..a17b3d9 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -50,19 +50,28 @@ log = up2dateLog.initLog()
def startRhnsd():
# successful registration. Try to start rhnsd if it isn't running.
if os.access("/usr/sbin/rhnsd", os.R_OK|os.X_OK):
- if os.access("/sbin/chkconfig", os.R_OK|os.X_OK):
- os.system("/sbin/chkconfig rhnsd on > /dev/null");
+ if os.access("/usr/lib/systemd/system/rhnsd.service", os.R_OK):
+ # systemd
+ if os.access("/usr/bin/systemctl", os.R_OK|os.X_OK):
+ os.system("/usr/bin/systemctl enable rhnsd > /dev/null");
+ os.system("/usr/bin/systemctl start rhnsd > /dev/null");
+ else:
+ print _("Warning: unable to enable rhnsd with systemd")
else:
- print _("Warning: unable to enable rhnsd with chkconfig")
-
- service_path = "/sbin/service"
- if not os.access(service_path, os.R_OK|os.X_OK):
- if os.access("/usr/sbin/service", os.R_OK|os.X_OK):
- service_path = "/usr/sbin/service"
-
- rc = os.system("%s rhnsd status > /dev/null" % service_path)
- if rc:
- os.system("%s rhnsd start > /dev/null" % service_path)
+ # SysV init scripts
+ if os.access("/sbin/chkconfig", os.R_OK|os.X_OK):
+ os.system("/sbin/chkconfig rhnsd on > /dev/null");
+ else:
+ print _("Warning: unable to enable rhnsd with chkconfig")
+
+ service_path = "/sbin/service"
+ if not os.access(service_path, os.R_OK|os.X_OK):
+ if os.access("/usr/sbin/service", os.R_OK|os.X_OK):
+ service_path = "/usr/sbin/service"
+
+ rc = os.system("%s rhnsd status > /dev/null" % service_path)
+ if rc:
+ os.system("%s rhnsd start > /dev/null" % service_path)
def getOemInfo():
configFile = cfg["oemInfoFile"] or "/etc/sysconfig/rhn/oeminfo"
11 years, 2 months
schema/spacewalk
by Milan Zazrivec
schema/spacewalk/common/tables/web_customer.sql | 4 +++-
schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.oracle | 3 ++-
schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.postgresql | 5 +++--
3 files changed, 8 insertions(+), 4 deletions(-)
New commits:
commit 06954f718dcfcd8891f7177486e2cfedb1910b27
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Tue Feb 26 11:07:16 2013 +0100
abrt: check the allowed filesize limit is >= 0
diff --git a/schema/spacewalk/common/tables/web_customer.sql b/schema/spacewalk/common/tables/web_customer.sql
index 945eeef..4319c14 100644
--- a/schema/spacewalk/common/tables/web_customer.sql
+++ b/schema/spacewalk/common/tables/web_customer.sql
@@ -25,7 +25,9 @@ CREATE TABLE web_customer
CONSTRAINT web_customer_stage_content_chk
CHECK (staging_content_enabled in ( 'Y' , 'N' )),
crash_file_sizelimit number
- default(2048) not null,
+ default(2048) not null
+ constraint web_customer_sizelimit_chk
+ check (crash_file_sizelimit >= 0),
created timestamp with local time zone
DEFAULT (current_timestamp) NOT NULL,
modified timestamp with local time zone
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.oracle
index 9c8671d..66f6eea 100644
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.oracle
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.oracle
@@ -1,3 +1,4 @@
alter table web_customer
add crash_file_sizelimit
- number default(2048) not null;
+ number default(2048) not null
+ constraint web_customer_sizelimit_chk check (crash_file_sizelimit >= 0);
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.postgresql
index e835afd..1b482ed 100644
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.postgresql
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/019-web_customer.sql.postgresql
@@ -1,5 +1,6 @@
--- oracle equivalent source sha1 98e82b03e86d16d0b335f306e17344e97383223c
+-- oracle equivalent source sha1 bd2fd82dec1fb797dd7aede1a0f6e8884d68c01d
alter table web_customer
add crash_file_sizelimit
- numeric default(2048) not null;
+ numeric default(2048) not null
+ constraint web_customer_sizelimit_chk check (crash_file_sizelimit >= 0);
11 years, 2 months
Changes to 'refs/tags/spacewalk-schema-1.9.35-1'
by StephenHerr
Tag 'spacewalk-schema-1.9.35-1' created by Stephen Herr <sherr(a)redhat.com> at 2013-02-25 14:15 +0000
Tagging package [spacewalk-schema] version [1.9.35-1] in directory [schema/spacewalk/].
Changes since spacewalk-java-1.9.75-1:
Milan Zazrivec (2):
abrt: delete crash: remove content from filer
add sha1 sum
Stephen Herr (2):
915158 - correcting copyright dates
Automatic commit of package [spacewalk-schema] release [1.9.35-1].
Tomas Kasparek (1):
Comment fix
---
0 files changed
---
11 years, 2 months
rel-eng/packages schema/spacewalk
by StephenHerr
rel-eng/packages/spacewalk-schema | 2 +-
schema/spacewalk/spacewalk-schema.spec | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit 6f408f12764a7c0c7e00346d5f63a6dc76f28b0c
Author: Stephen Herr <sherr(a)redhat.com>
Date: Mon Feb 25 09:15:04 2013 -0500
Automatic commit of package [spacewalk-schema] release [1.9.35-1].
diff --git a/rel-eng/packages/spacewalk-schema b/rel-eng/packages/spacewalk-schema
index 78f13bb..9cd9391 100644
--- a/rel-eng/packages/spacewalk-schema
+++ b/rel-eng/packages/spacewalk-schema
@@ -1 +1 @@
-1.9.34-1 schema/spacewalk/
+1.9.35-1 schema/spacewalk/
diff --git a/schema/spacewalk/spacewalk-schema.spec b/schema/spacewalk/spacewalk-schema.spec
index 447f714..0e1e589 100644
--- a/schema/spacewalk/spacewalk-schema.spec
+++ b/schema/spacewalk/spacewalk-schema.spec
@@ -2,7 +2,7 @@ Name: spacewalk-schema
Group: Applications/Internet
Summary: Oracle SQL schema for Spacewalk server
-Version: 1.9.34
+Version: 1.9.35
Release: 1%{?dist}
Source0: %{name}-%{version}.tar.gz
@@ -69,6 +69,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/spacewalk-sql*
%changelog
+* Mon Feb 25 2013 Stephen Herr <sherr(a)redhat.com> 1.9.35-1
+- add sha1 sum
+- abrt: delete crash: remove content from filer
+
* Mon Feb 25 2013 Stephen Herr <sherr(a)redhat.com> 1.9.34-1
- 915158 - need oracle specific schema upgrade script
11 years, 2 months
java/code
by StephenHerr
java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartTreeUpdateType.java | 2 +-
java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndKickstartTreeException.java | 2 +-
java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndNoBaseTreeException.java | 2 +-
java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeException.java | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 5e861200d958b9e33b46fa0093de886590377f99
Author: Stephen Herr <sherr(a)redhat.com>
Date: Mon Feb 25 08:44:59 2013 -0500
915158 - correcting copyright dates
diff --git a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartTreeUpdateType.java b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartTreeUpdateType.java
index f3fcea8..38c084a 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartTreeUpdateType.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/kickstart/KickstartTreeUpdateType.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2009--2012 Red Hat, Inc.
+ * Copyright (c) 2013 Red Hat, Inc.
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndKickstartTreeException.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndKickstartTreeException.java
index 1bab37a..8d83f64 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndKickstartTreeException.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndKickstartTreeException.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
+ * Copyright (c) 2013 Red Hat, Inc.
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndNoBaseTreeException.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndNoBaseTreeException.java
index d703c9f..f4af44e 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndNoBaseTreeException.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeAndNoBaseTreeException.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
+ * Copyright (c) 2013 Red Hat, Inc.
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeException.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeException.java
index eb739c7..a496715 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeException.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/kickstart/InvalidUpdateTypeException.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2009--2010 Red Hat, Inc.
+ * Copyright (c) 2013 Red Hat, Inc.
*
* This software is licensed to you under the GNU General Public License,
* version 2 (GPLv2). There is NO WARRANTY for this software, express or
11 years, 2 months
java/code
by Tomáš Kašpárek
java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchNetworkInterfaceException.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 8bb063c25757fc8eef04855f778768037a29c5cf
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Mon Feb 25 14:33:14 2013 +0100
Comment fix
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchNetworkInterfaceException.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchNetworkInterfaceException.java
index b7fee95..1c83264 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchNetworkInterfaceException.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchNetworkInterfaceException.java
@@ -19,7 +19,7 @@ import com.redhat.rhn.FaultException;
import com.redhat.rhn.common.localization.LocalizationService;
/**
- * No Crashes Exception
+ * No Such Network Interface Exception
*
* @version $Rev$
*/
11 years, 2 months
schema/spacewalk
by Milan Zazrivec
schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/023-rhnKsData.sql.postgresql | 2 ++
1 file changed, 2 insertions(+)
New commits:
commit b6b8d9dc3b00ce9695747c3ac072921c1d32de47
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Feb 25 14:31:21 2013 +0100
add sha1 sum
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/023-rhnKsData.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/023-rhnKsData.sql.postgresql
index a4cf2da..1df3943 100644
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/023-rhnKsData.sql.postgresql
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/023-rhnKsData.sql.postgresql
@@ -1,2 +1,4 @@
+-- oracle equivalent source sha1 de551efb669051f052dd456e1fc84271437622da
+
alter table rhnksdata add update_type varchar(7) not null default 'none';
alter table rhnksdata add constraint rhn_ks_update_type check (update_type in ('all', 'red_hat', 'none'));
11 years, 2 months
backend/server java/code schema/spacewalk
by Milan Zazrivec
backend/server/handlers/xmlrpc/abrt.py | 19 ++++++++--
java/code/src/com/redhat/rhn/domain/server/Crash.hbm.xml | 1
java/code/src/com/redhat/rhn/domain/server/Crash.java | 17 ++++++++
java/code/src/com/redhat/rhn/manager/system/CrashManager.java | 19 +++++++++-
schema/spacewalk/common/tables/rhnServerCrash.sql | 1
schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.oracle | 1
schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.postgresql | 3 +
7 files changed, 56 insertions(+), 5 deletions(-)
New commits:
commit 276ffd44a667bceb23cfc6d961ec61a01ca5e566
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Mon Feb 25 14:27:46 2013 +0100
abrt: delete crash: remove content from filer
diff --git a/backend/server/handlers/xmlrpc/abrt.py b/backend/server/handlers/xmlrpc/abrt.py
index 76ceee5..591bc47 100644
--- a/backend/server/handlers/xmlrpc/abrt.py
+++ b/backend/server/handlers/xmlrpc/abrt.py
@@ -15,6 +15,7 @@
import base64
import os
+import stat
from spacewalk.common.rhnException import rhnFault
from spacewalk.common.rhnConfig import CFG
@@ -36,13 +37,15 @@ insert into rhnServerCrash (
server_id,
crash,
path,
- count)
+ count,
+ storage_path)
values (
sequence_nextval('rhn_server_crash_id_seq'),
:server_id,
:crash,
:path,
- :crash_count)
+ :crash_count,
+ :storage_path)
""")
_query_update_pkg_data = rhnSQL.Statement("""
@@ -135,6 +138,12 @@ class Abrt(rhnHandler):
log_debug(1, self.server_id, "The crash information is invalid or incomplete: %s" % str(crash_data))
raise rhnFault(5000)
+ server_org_id = self.server.server['org_id']
+ server_crash_dir = get_crash_path(str(server_org_id), str(self.server_id), crash_data['crash'])
+ if not server_crash_dir:
+ log_debug(1, self.server_id, "Error composing crash directory path")
+ raise rhnFault(5002)
+
crash_id = self._get_crash_id(self.server_id, crash_data['crash'])
log_debug(1, "crash_id: %s" % crash_id)
@@ -147,7 +156,8 @@ class Abrt(rhnHandler):
server_id = self.server_id,
crash = crash_data['crash'],
path = crash_data['path'],
- crash_count = crash_data['count'])
+ crash_count = crash_data['count'],
+ storage_path = server_crash_dir)
rhnSQL.commit()
self._update_package_data(self._get_crash_id(self.server_id, crash_data['crash']), pkg_data)
return 1
@@ -207,6 +217,9 @@ class Abrt(rhnHandler):
if not os.path.exists(absolute_dir):
log_debug(1, self.server_id, "Creating crash directory: %s" % absolute_dir)
os.makedirs(absolute_dir)
+ mode = stat.S_IRWXU | stat.S_IRWXG | stat.S_IROTH | stat.S_IXOTH
+ os.chmod(absolute_dir, mode)
+ os.chmod(os.path.dirname(os.path.normpath(absolute_dir)), mode)
log_debug(1, self.server_id, "Creating crash file: %s" % absolute_file)
f = open(absolute_file, 'w+')
diff --git a/java/code/src/com/redhat/rhn/domain/server/Crash.hbm.xml b/java/code/src/com/redhat/rhn/domain/server/Crash.hbm.xml
index 4e98522..26b4412 100644
--- a/java/code/src/com/redhat/rhn/domain/server/Crash.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/server/Crash.hbm.xml
@@ -30,6 +30,7 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<property name="packageNameId" column="package_name_id" type="long"/>
<property name="packageEvrId" column="package_evr_id" type="long"/>
<property name="packageArchId" column="package_arch_id" type="long"/>
+ <property name="storagePath" column="storage_path" type="string"/>
<property name="created" type="timestamp" column="created" />
<property name="modified" type="timestamp" column="modified" />
</class>
diff --git a/java/code/src/com/redhat/rhn/domain/server/Crash.java b/java/code/src/com/redhat/rhn/domain/server/Crash.java
index 0b10d6f..732bd34 100644
--- a/java/code/src/com/redhat/rhn/domain/server/Crash.java
+++ b/java/code/src/com/redhat/rhn/domain/server/Crash.java
@@ -42,6 +42,7 @@ public class Crash extends BaseDomainHelper {
private Long packageNameId;
private Long packageEvrId;
private Long packageArchId;
+ private String storagePath;
private Date created;
private Date modified;
private Set<CrashFile> crashFiles;
@@ -310,6 +311,22 @@ public class Crash extends BaseDomainHelper {
}
/**
+ * Get the crash storage path.
+ * @return Returns the crash storage path.
+ */
+ public String getStoragePath() {
+ return storagePath;
+ }
+
+ /**
+ * Set the crash storage path.
+ * @param storagePathIn The storage path to set.
+ */
+ public void setStoragePath(String storagePathIn) {
+ storagePath = storagePathIn;
+ }
+
+ /**
* Returns the created date.
* @return the created date.
*/
diff --git a/java/code/src/com/redhat/rhn/manager/system/CrashManager.java b/java/code/src/com/redhat/rhn/manager/system/CrashManager.java
index c63aaeb..d426d23 100644
--- a/java/code/src/com/redhat/rhn/manager/system/CrashManager.java
+++ b/java/code/src/com/redhat/rhn/manager/system/CrashManager.java
@@ -15,15 +15,19 @@
package com.redhat.rhn.manager.system;
+import com.redhat.rhn.common.conf.Config;
import com.redhat.rhn.common.hibernate.LookupException;
import com.redhat.rhn.domain.server.Crash;
import com.redhat.rhn.domain.server.CrashFactory;
+import com.redhat.rhn.domain.server.CrashFile;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.xmlrpc.NoSuchCrashException;
import com.redhat.rhn.frontend.xmlrpc.NoSuchSystemException;
import com.redhat.rhn.manager.BaseManager;
+import java.io.File;
+
import org.apache.log4j.Logger;
/**
@@ -60,12 +64,25 @@ public class CrashManager extends BaseManager {
}
/**
- * Delete a crash
+ * Delete a crash from database and filer.
* @param user User to check the permissions for.
* @param crashId The id of the crash to delete.
*/
public static void deleteCrash(User user, Long crashId) {
Crash crash = lookupCrashByUserAndId(user, crashId);
+
+ // FIXME: async deletion via taskomatic?
+ File storageDir = new File(Config.get().getString("web.mount_point"),
+ crash.getStoragePath());
+
+ for (CrashFile cf : crash.getCrashFiles()) {
+ File crashFile = new File(storageDir, cf.getFilename());
+ if (crashFile.exists() && crashFile.isFile()) {
+ crashFile.delete();
+ }
+ }
+ storageDir.delete();
+
CrashFactory.delete(crash);
}
}
diff --git a/schema/spacewalk/common/tables/rhnServerCrash.sql b/schema/spacewalk/common/tables/rhnServerCrash.sql
index ed5751b..486818a 100644
--- a/schema/spacewalk/common/tables/rhnServerCrash.sql
+++ b/schema/spacewalk/common/tables/rhnServerCrash.sql
@@ -41,6 +41,7 @@ create table rhnServerCrash
package_arch_id number
constraint rhn_server_crash_arch_id_fk
references rhnPackageArch(id),
+ storage_path varchar(1024),
created timestamp with local time zone
default (current_timestamp) not null,
modified timestamp with local time zone
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.oracle b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.oracle
index ed5751b..a2d3795 100644
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.oracle
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.oracle
@@ -41,6 +41,7 @@ create table rhnServerCrash
package_arch_id number
constraint rhn_server_crash_arch_id_fk
references rhnPackageArch(id),
+ storage_path varchar2(1024),
created timestamp with local time zone
default (current_timestamp) not null,
modified timestamp with local time zone
diff --git a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.postgresql b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.postgresql
index c9fe8a7..6e47250 100644
--- a/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.postgresql
+++ b/schema/spacewalk/upgrade/spacewalk-schema-1.8-to-spacewalk-schema-1.9/013-rhnServerCrash.sql.postgresql
@@ -1,4 +1,4 @@
--- oracle equivalent source sha1 fe95c7a174fbc86d6979350136a7fd11641e24aa
+-- oracle equivalent source sha1 9514c6e098beb581d49e6cd0bc28d1390690a985
--
-- Copyright (c) 2013 Red Hat, Inc.
--
@@ -42,6 +42,7 @@ create table rhnServerCrash
package_arch_id NUMERIC
constraint rhn_server_crash_arch_id_fk
references rhnPackageArch(id),
+ storage_path VARCHAR(1024),
created TIMESTAMPTZ
default (current_timestamp) not null,
modified TIMESTAMPTZ
11 years, 2 months
Changes to 'refs/tags/spacewalk-java-1.9.75-1'
by Tomáš Kašpárek
Tag 'spacewalk-java-1.9.75-1' created by Tomas Kasparek <tkasparek(a)redhat.com> at 2013-02-25 13:28 +0000
Tagging package [spacewalk-java] version [1.9.75-1] in directory [java/].
Changes since spacewalk-schema-1.9.34-1:
Tomas Kasparek (2):
API for setting primary network interface
Automatic commit of package [spacewalk-java] release [1.9.75-1].
---
java/code/src/com/redhat/rhn/domain/server/Server.java | 8 ++
java/code/src/com/redhat/rhn/frontend/strings/java/StringResource_en_US.xml | 3
java/code/src/com/redhat/rhn/frontend/xmlrpc/NoSuchNetworkInterfaceException.java | 37 ++++++++++
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 28 +++++++
java/spacewalk-java.spec | 5 +
rel-eng/packages/spacewalk-java | 2
6 files changed, 81 insertions(+), 2 deletions(-)
---
11 years, 2 months