summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2011-03-10 18:10:56 +0100
committerKarel Klic <kklic@redhat.com>2011-03-10 18:20:52 +0100
commitf8b33e5dfb5385020c865a017a6f5c707e2a79b1 (patch)
tree4aec97f7f7ecff7e96db1ce2777e96beeeb65b55 /src
parent77bb7ac8f771817c4cd2111ab7e5ff529ec27ef7 (diff)
parentb798e84abdbdfcf330475da675ad3287a3b79daa (diff)
merge
Diffstat (limited to 'src')
-rw-r--r--src/daemon/abrt_event.conf15
-rw-r--r--src/gui-gtk/abrt-gtk.c73
-rw-r--r--src/gui-gtk/event_config_dialog.c29
-rw-r--r--src/lib/event_config.c103
-rw-r--r--src/plugins/Makefile.am2
-rw-r--r--src/plugins/abrt-action-print.c8
-rw-r--r--src/plugins/ccpp_events.conf1
-rw-r--r--src/plugins/report_Bugzilla.conf4
-rw-r--r--src/plugins/report_Logger.conf1
9 files changed, 172 insertions, 64 deletions
diff --git a/src/daemon/abrt_event.conf b/src/daemon/abrt_event.conf
index 45d8e9a4..191782c1 100644
--- a/src/daemon/abrt_event.conf
+++ b/src/daemon/abrt_event.conf
@@ -16,9 +16,6 @@
# Rule of the form "include GLOB_PATTERN" recurses to each file which matches
# GLOB_PATTERN. Example: "include post-create.d/*.conf"
#
-
-include events.d/*.conf
-
# Any other rules specify which programs to run on the crash dump.
#
# Each rule may have conditions to be checked before the program is run.
@@ -42,18 +39,25 @@ include events.d/*.conf
# If the program terminates successfully, next rule is read
# and processed. This process is repeated until the end of this file.
-# abrt-action-analyze-c needs package name, save package data first
+# abrt-action-analyze-c needs package name, save package data
+# before include directive
EVENT=post-create abrt-action-save-package-data
+
+include events.d/*.conf
+
EVENT=post-create getent passwd "`cat uid`" | cut -d: -f1 >username
EVENT=post-create analyzer=Python abrt-action-analyze-python
EVENT=post-create analyzer=Kerneloops abrt-action-analyze-oops
+
# If you want all users (not just root) to be able to see oopses:
#EVENT=post-create analyzer=Kerneloops echo 1 >inform_all_users
+
# If you want behavior similar to one provided by kerneloops daemon
# distributed by kerneloops.org - that is, if you want
# oopses to be reported automatically and immediately without
# user interaction, uncomment this line:
#EVENT=post-create analyzer=Kerneloops abrt-action-kerneloops
+
# Example: if you want to save sosreport immediately at the moment of a crash:
#EVENT=post-create
nice sosreport --tmp-dir "$DUMP_DIR" --batch \
@@ -69,6 +73,7 @@ EVENT=post-create analyzer=Kerneloops abrt-action-analyze-oops
true
} 2>/dev/null
+
EVENT=report analyzer=Kerneloops abrt-action-kerneloops
EVENT=report_Bugzilla analyzer=Python abrt-action-bugzilla -c /etc/abrt/plugins/Bugzilla.conf
-EVENT=report_Logger analyzer=Python abrt-action-print -o /var/log/abrt.log
+EVENT=report_Logger abrt-action-print -o "${Log_File:-/var/log/abrt.log}"
diff --git a/src/gui-gtk/abrt-gtk.c b/src/gui-gtk/abrt-gtk.c
index 120389d4..99b6f41f 100644
--- a/src/gui-gtk/abrt-gtk.c
+++ b/src/gui-gtk/abrt-gtk.c
@@ -5,6 +5,9 @@
#include "abrt-gtk.h"
#include "event_config_dialog.h"
+static const char * const help_uri ="http://docs.fedoraproject.org/en-US/"
+ "Fedora/14/html/Deployment_Guide/ch-abrt.html";
+
static GtkListStore *s_dumps_list_store;
static GtkWidget *s_treeview;
static GtkWidget *g_main_window;
@@ -148,9 +151,64 @@ static void on_btn_delete_cb(GtkButton *button, gpointer unused)
static void on_btn_online_help_cb(GtkButton *button, gpointer unused)
{
- gtk_show_uri(NULL,"http://docs.fedoraproject.org/en-US/Fedor"
- "a/14/html/Deployment_Guide/ch-abrt.html",
- GDK_CURRENT_TIME, NULL);
+ gtk_show_uri(NULL, help_uri, GDK_CURRENT_TIME, NULL);
+}
+
+static void on_menu_help_cb(GtkMenuItem *menuitem, gpointer unused)
+{
+ gtk_show_uri(NULL, help_uri, GDK_CURRENT_TIME, NULL);
+}
+
+static void on_menu_about_cb(GtkMenuItem *menuitem, gpointer unused)
+{
+ const char *copyright_str = "Copyright © 2009, 2010, 2011 Red Hat, Inc";
+
+ const char *license_str = "This program is free software; you can redistribut"
+ "e 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 Li"
+ "cense, or (at your option) any later version.\n\nThis program is distrib"
+ "uted in the hope that it will be useful, but WITHOUT ANY WARRANTY; witho"
+ "ut even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICU"
+ "LAR PURPOSE. See the GNU General Public License for more details.\n\nYo"
+ "u should have received a copy of the GNU General Public License along wi"
+ "th this program. If not, see <http://www.gnu.org/licenses/>.";
+
+ const char *website_url = "https://fedorahosted.org/abrt/";
+
+ const char *authors[] = {
+ "Anton Arapov <aarapov@redhat.com>",
+ "Karel Klic <kklic@redhat.com>",
+ "Jiri Moskovcak <jmoskovc@redhat.com>",
+ "Nikola Pajkovsky <npajkovs@redhat.com>",
+ "Denys Vlasenko <dvlasenk@redhat.com>",
+ "Michal Toman <mtoman@redhat.com>",
+ "Zdenek Prikryl",
+ NULL
+ };
+
+ const char *artists[] = {
+ "Patrick Connelly <pcon@fedoraproject.org>",
+ "Máirín Duffy <duffy@fedoraproject.org>",
+ "Lapo Calamandrei",
+ NULL
+ };
+
+ GtkWidget *about_d = gtk_about_dialog_new();
+
+ gtk_window_set_default_icon_name("abrt");
+ gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_d), VERSION);
+ gtk_about_dialog_set_logo_icon_name(GTK_ABOUT_DIALOG(about_d), "abrt");
+ gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(about_d), "ABRT");
+ gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about_d), copyright_str);
+ gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about_d), license_str);
+ gtk_about_dialog_set_wrap_license(GTK_ABOUT_DIALOG(about_d),true);
+ gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_d), website_url);
+ gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(about_d), authors);
+ gtk_about_dialog_set_artists(GTK_ABOUT_DIALOG(about_d), artists);
+ gtk_about_dialog_set_translator_credits(GTK_ABOUT_DIALOG(about_d), _("translator-credits"));
+
+ gtk_dialog_run(GTK_DIALOG(about_d));
+ gtk_widget_hide(GTK_WIDGET(about_d));
}
void show_events_list_dialog_cb(GtkMenuItem *menuitem, gpointer user_data)
@@ -236,14 +294,15 @@ GtkWidget *create_menu(void)
/* help submenu */
GtkWidget *help_submenu = gtk_menu_new();
- GtkWidget *log_item = gtk_menu_item_new_with_mnemonic(_("View _log"));
GtkWidget *online_help_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_HELP, NULL);
GtkWidget *about_item = gtk_image_menu_item_new_from_stock(GTK_STOCK_ABOUT, NULL);
- gtk_menu_shell_append(GTK_MENU_SHELL(help_submenu), log_item);
gtk_menu_shell_append(GTK_MENU_SHELL(help_submenu), online_help_item);
gtk_menu_shell_append(GTK_MENU_SHELL(help_submenu), about_item);
gtk_menu_item_set_submenu(GTK_MENU_ITEM(help_item), help_submenu);
+ g_signal_connect(online_help_item, "activate", G_CALLBACK(on_menu_help_cb), NULL);
+ g_signal_connect(about_item, "activate", G_CALLBACK(on_menu_about_cb), NULL);
+
return menu;
}
@@ -285,7 +344,7 @@ GtkWidget *create_main_window(void)
/* buttons are homogenous so set size only for one button and it will
* work for the rest buttons in same gtk_hbox_new() */
- GtkWidget *btn_report = gtk_button_new_with_label(_("Report"));
+ GtkWidget *btn_report = gtk_button_new_with_mnemonic(_("_Report"));
gtk_widget_set_size_request(btn_report, 200, 30);
GtkWidget *btn_delete = gtk_button_new_from_stock(GTK_STOCK_DELETE);
@@ -298,7 +357,7 @@ GtkWidget *create_main_window(void)
gtk_container_add(GTK_CONTAINER(halign), hbox_report_delete);
GtkWidget *hbox_help_close = gtk_hbutton_box_new();
- GtkWidget *btn_online_help = gtk_button_new_with_label(_("Online Help"));
+ GtkWidget *btn_online_help = gtk_button_new_with_mnemonic(_("_Online Help"));
GtkWidget *btn_close = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
gtk_box_pack_end(GTK_BOX(hbox_help_close), btn_online_help, false, false, 0);
gtk_box_pack_end(GTK_BOX(hbox_help_close), btn_close, false, false, 0);
diff --git a/src/gui-gtk/event_config_dialog.c b/src/gui-gtk/event_config_dialog.c
index 156c9e22..8b67a58e 100644
--- a/src/gui-gtk/event_config_dialog.c
+++ b/src/gui-gtk/event_config_dialog.c
@@ -49,6 +49,12 @@ static void add_option_widget(GtkWidget *widget, event_option_t *option)
option_widget_list = g_list_prepend(option_widget_list, ow);
}
+static void on_show_pass_cb(GtkToggleButton *tb, gpointer user_data)
+{
+ GtkEntry *entry = (GtkEntry *)user_data;
+ gtk_entry_set_visibility(entry, gtk_toggle_button_get_active(tb));
+}
+
static void add_option_to_dialog(event_option_t *option)
{
GtkWidget *label;
@@ -107,9 +113,16 @@ static void add_option_to_dialog(event_option_t *option)
last_row, last_row+1,
GTK_FILL, GTK_FILL,
0,0);
-
gtk_entry_set_visibility(GTK_ENTRY(option_input), 0);
add_option_widget(option_input, option);
+ last_row++;
+ GtkWidget *pass_cb = gtk_check_button_new_with_label(_("Show password"));
+ gtk_table_attach(GTK_TABLE(option_table), pass_cb,
+ 1, 2,
+ last_row, last_row+1,
+ GTK_FILL, GTK_FILL,
+ 0,0);
+ g_signal_connect(pass_cb, "toggled", G_CALLBACK(on_show_pass_cb), option_input);
break;
default:
//option_input = gtk_label_new_justify_left("WTF?");
@@ -218,8 +231,14 @@ static void show_event_config_dialog(event_config_t* event)
option_widget_list = NULL;
}
+ char *title;
+ if(event->screen_name != NULL)
+ title = event->screen_name;
+ else
+ title = _("Event Configuration");
+
GtkWidget *dialog = gtk_dialog_new_with_buttons(
- event->screen_name,
+ title,
GTK_WINDOW(parent_dialog),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_OK,
@@ -237,7 +256,7 @@ static void show_event_config_dialog(event_config_t* event)
g_list_foreach(event->options, &add_option, NULL);
GtkWidget *content = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
- gtk_box_pack_start(GTK_BOX(content), option_table, 0, 0, 10);
+ gtk_box_pack_start(GTK_BOX(content), option_table, false, false, 20);
gtk_widget_show_all(option_table);
int result = gtk_dialog_run(GTK_DIALOG(dialog));
if(result == GTK_RESPONSE_APPLY)
@@ -261,7 +280,7 @@ void show_events_list_dialog(GtkWindow *parent)
return;
}
parent_dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(parent_dialog), _("Event Config"));
+ gtk_window_set_title(GTK_WINDOW(parent_dialog), _("Events"));
gtk_window_set_default_size(GTK_WINDOW(parent_dialog), 450, 400);
if(parent != NULL)
{
@@ -312,7 +331,7 @@ void show_events_list_dialog(GtkWindow *parent)
gtk_container_add(GTK_CONTAINER(events_scroll), events_tv);
- GtkWidget *configure_event_btn = gtk_button_new_with_label(_("Configure"));
+ GtkWidget *configure_event_btn = gtk_button_new_with_mnemonic(_("Configure E_vent"));
g_signal_connect(configure_event_btn, "clicked", G_CALLBACK(on_configure_event_cb), events_tv);
GtkWidget *close_btn = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
index f9622c23..0f5c0f62 100644
--- a/src/lib/event_config.c
+++ b/src/lib/event_config.c
@@ -44,15 +44,11 @@ static int cmp_event_option_name_with_string(gconstpointer a, gconstpointer b)
return strcmp(((event_option_t *)a)->name, (char *)b);
}
-// (Re)loads data from /etc/abrt/events/*.{conf,xml}
+/* (Re)loads data from /etc/abrt/events/foo.{xml,conf} */
void load_event_config_data(void)
{
free_event_config_data();
- DIR *dir = opendir(EVENTS_DIR);
- if (!dir)
- return;
-
if (!g_event_config_list)
g_event_config_list = g_hash_table_new_full(
/*hash_func*/ g_str_hash,
@@ -61,15 +57,19 @@ void load_event_config_data(void)
/*value_destroy_func:*/ (GDestroyNotify) free_event_config
);
+ DIR *dir;
struct dirent *dent;
+
+ /* Load .xml files */
+ dir = opendir(EVENTS_DIR);
+ if (!dir)
+ return;
while ((dent = readdir(dir)) != NULL)
{
char *ext = strrchr(dent->d_name, '.');
if (!ext)
continue;
- bool conf = strcmp(ext + 1, "conf") == 0;
- bool xml = strcmp(ext + 1, "xml") == 0;
- if (!conf && !xml)
+ if (strcmp(ext + 1, "xml") != 0)
continue;
char *fullname = concat_path_file(EVENTS_DIR, dent->d_name);
@@ -80,48 +80,71 @@ void load_event_config_data(void)
if (new_config)
event_config = new_event_config();
- if (xml)
- load_event_description_from_file(event_config, fullname);
- if (conf)
- {
- map_string_h *keys_and_values = new_map_string();
+ load_event_description_from_file(event_config, fullname);
+ free(fullname);
+
+ if (new_config)
+ g_hash_table_replace(g_event_config_list, xstrdup(dent->d_name), event_config);
+ }
+ closedir(dir);
+
+ /* Load .conf files */
+ dir = opendir(EVENTS_DIR);
+ if (!dir)
+ return;
+ while ((dent = readdir(dir)) != NULL)
+ {
+ char *ext = strrchr(dent->d_name, '.');
+ if (!ext)
+ continue;
+ if (strcmp(ext + 1, "conf") != 0)
+ continue;
+
+ char *fullname = concat_path_file(EVENTS_DIR, dent->d_name);
+
+ *ext = '\0';
+ event_config_t *event_config = get_event_config(dent->d_name);
+ bool new_config = (!event_config);
+ if (new_config)
+ event_config = new_event_config();
- load_conf_file(fullname, keys_and_values, /*skipKeysWithoutValue:*/ false);
+ map_string_h *keys_and_values = new_map_string();
- /* Insert or replace every key/value from keys_and_values to event_config->option */
- GHashTableIter iter;
- char *name;
- char *value;
- g_hash_table_iter_init(&iter, keys_and_values);
- while (g_hash_table_iter_next(&iter, (void**)&name, (void**)&value))
+ load_conf_file(fullname, keys_and_values, /*skipKeysWithoutValue:*/ false);
+ free(fullname);
+
+ /* Insert or replace every key/value from keys_and_values to event_config->option */
+ GHashTableIter iter;
+ char *name;
+ char *value;
+ g_hash_table_iter_init(&iter, keys_and_values);
+ while (g_hash_table_iter_next(&iter, (void**)&name, (void**)&value))
+ {
+ event_option_t *opt;
+ GList *elem = g_list_find_custom(event_config->options, name, &cmp_event_option_name_with_string);
+ if (elem)
{
- event_option_t *opt;
- GList *elem = g_list_find_custom(event_config->options, name, &cmp_event_option_name_with_string);
- if (elem)
- {
- opt = elem->data;
- //log("%s: replacing '%s' value:'%s'->'%s'", fullname, name, opt->value, value);
- free(opt->value);
- }
- else
- {
- //log("%s: new value %s='%s'", fullname, name, value);
- opt = new_event_option();
- opt->name = xstrdup(name);
- }
- opt->value = xstrdup(value);
- if (!elem)
- event_config->options = g_list_append(event_config->options, opt);
+ opt = elem->data;
+ //log("conf: replacing '%s' value:'%s'->'%s'", name, opt->value, value);
+ free(opt->value);
}
-
- free_map_string(keys_and_values);
+ else
+ {
+ //log("conf: new value %s='%s'", name, value);
+ opt = new_event_option();
+ opt->name = xstrdup(name);
+ }
+ opt->value = xstrdup(value);
+ if (!elem)
+ event_config->options = g_list_append(event_config->options, opt);
}
- free(fullname);
+ free_map_string(keys_and_values);
if (new_config)
g_hash_table_replace(g_event_config_list, xstrdup(dent->d_name), event_config);
}
+ closedir(dir);
}
/* Frees all loaded data */
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index ff052b53..114321c0 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -42,6 +42,8 @@ eventsdir = $(EVENTS_DIR)
dist_events_DATA = \
report_Bugzilla.xml \
+ report_Bugzilla.conf \
+ report_Logger.conf \
analyze_LocalGDB.xml \
analyze_RetraceServer.xml
diff --git a/src/plugins/abrt-action-print.c b/src/plugins/abrt-action-print.c
index cc7fbb34..a5d7219b 100644
--- a/src/plugins/abrt-action-print.c
+++ b/src/plugins/abrt-action-print.c
@@ -56,12 +56,8 @@ int main(int argc, char **argv)
putenv(xasprintf("ABRT_VERBOSE=%u", g_verbose));
//msg_prefix = PROGNAME;
- char *env = getenv("Logger_LogPath");
- VERB3 log("output_file:'%s' Logger_LogPath env:'%s'", output_file, env);
- if (env)
- output_file = env;
-
- env = getenv("Logger_AppendLogs");
+//TODO: convert to an option:
+ char *env = getenv("Logger_AppendLogs");
VERB3 log("Logger_AppendLogs env:'%s'", env);
if (env && string_to_bool(env))
open_mode = "a";
diff --git a/src/plugins/ccpp_events.conf b/src/plugins/ccpp_events.conf
index 0cb2abe9..2e1badee 100644
--- a/src/plugins/ccpp_events.conf
+++ b/src/plugins/ccpp_events.conf
@@ -16,4 +16,3 @@ EVENT=reanalyze_Local analyzer=CCpp abrt-action-generate-backtrace
EVENT=reanalyze_RetraceServer analyzer=CCpp abrt-retrace-client batch -k --dir "$DUMP_DIR"
EVENT=report_Bugzilla analyzer=CCpp abrt-action-bugzilla -c /etc/abrt/plugins/Bugzilla.conf
-EVENT=report_Logger analyzer=CCpp abrt-action-print -o /var/log/abrt.log
diff --git a/src/plugins/report_Bugzilla.conf b/src/plugins/report_Bugzilla.conf
new file mode 100644
index 00000000..0a18c07a
--- /dev/null
+++ b/src/plugins/report_Bugzilla.conf
@@ -0,0 +1,4 @@
+Bugzilla_BugzillaURL = http://bugzilla.redhat.com
+Bugzilla_Login =
+Bugzilla_Password =
+Bugzilla_SSLVerify = yes
diff --git a/src/plugins/report_Logger.conf b/src/plugins/report_Logger.conf
new file mode 100644
index 00000000..3d23c739
--- /dev/null
+++ b/src/plugins/report_Logger.conf
@@ -0,0 +1 @@
+Log_File=/var/log/abrt.log