Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686128 - app-admin/rasdaemon - add USE=sqlite, or drop RDEPEND on dev-db/sqlite that should be optional
Summary: app-admin/rasdaemon - add USE=sqlite, or drop RDEPEND on dev-db/sqlite that s...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-17 01:01 UTC by Paul B. Henson
Modified: 2023-01-09 05:43 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
New ebuild (rasdaemon-0.6.2-r4.ebuild,1.17 KB, text/plain)
2019-05-23 20:28 UTC, Paul B. Henson
Details
New rc script (rasdaemon.openrc-r2,424 bytes, text/plain)
2019-05-23 20:28 UTC, Paul B. Henson
Details
conf.d file (rasdaemon.conf,88 bytes, text/plain)
2019-05-23 20:29 UTC, Paul B. Henson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul B. Henson 2019-05-17 01:01:38 UTC
sqlite is an optional component; if all you want to do is log to syslog it's not required; as such it would be better for it to be optionally included via a use flag.

Also, the init script runs it as "rasdaemon --foreground --record --enable", it would appear from the code that it always exits if --enable is set regardless of the foreground option:

        if (args.enable_ras) {
                int enable;

                enable = (args.enable_ras > 0) ? 1 : 0;                        
                toggle_ras_mc_event(enable);                                   

                return 0;
        }

        openlog(TOOL_NAME, 0, LOG_DAEMON);                                     
        if (!args.foreground)
                if (daemon(0,0))
                        exit(EXIT_FAILURE);                                    

        handle_ras_events(args.record_events);                                 

I haven't tested it yet, but based on visual inspection this just doesn't seem right. It would also be good to have an init script that supported just syslog as well instead of forcing sqlite.

Thanks...
Comment 1 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2019-05-17 22:49:53 UTC
syslog would be preferred, I'm open to patches as well, the idea is sound.
Comment 2 Paul B. Henson 2019-05-23 20:28:26 UTC
Created attachment 577672 [details]
New ebuild
Comment 3 Paul B. Henson 2019-05-23 20:28:47 UTC
Created attachment 577674 [details]
New rc script
Comment 4 Paul B. Henson 2019-05-23 20:29:16 UTC
Created attachment 577676 [details]
conf.d file
Comment 5 Paul B. Henson 2019-05-23 20:31:04 UTC
Ok, here's an updated ebuild with sqlite optional. I haven't tested it with sqlite, but it works fine with syslog.

I'm not sure why all those kernel options were marked as required? I removed them all but the ACPI one. rasdaemon uses the tracing infrastructure to read events, but all those trace kernel options were about actually tracing kernel function calls, which seems unrelated to this. It runs fine without them, although I haven't had any failures yet to validate it receives events.
Comment 6 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2019-05-23 21:39:04 UTC
At least at the time it would not build without the options set.
Comment 7 Paul B. Henson 2019-05-23 21:49:37 UTC
Huh. Dunno, the build barfed on me at first:

 * Checking for suitable kernel configuration options...
 *   CONFIG_DYNAMIC_FTRACE:      is not set when it should be.
 *   CONFIG_FUNCTION_GRAPH_TRACER:       is not set when it should be.
 *   CONFIG_FUNCTION_TRACER:     is not set when it should be.
 *   CONFIG_STACK_TRACER:        is not set when it should be.
 * Please check to make sure these options are set correctly.

I just removed the check for those and it compiled and seems to be running fine:

May 23 14:48:50 bender rasdaemon: ras:mc_event event disabled
May 23 14:48:50 bender rasdaemon: ras:aer_event event disabled
May 23 14:48:50 bender rasdaemon: mce:mce_record event disabled
May 23 14:48:50 bender rasdaemon: ras:extlog_mem_event event disabled
May 23 14:48:50 bender rasdaemon: ras:non_standard_event event disabled
May 23 14:48:50 bender rasdaemon: ras:arm_event event disabled
May 23 14:48:50 bender rasdaemon: ras:mc_event event enabled
May 23 14:48:50 bender rasdaemon: ras:aer_event event enabled
May 23 14:48:50 bender rasdaemon: mce:mce_record event enabled
May 23 14:48:50 bender rasdaemon: ras:mc_event event enabled
May 23 14:48:50 bender rasdaemon: Enabled event ras:mc_event
May 23 14:48:50 bender rasdaemon: ras:extlog_mem_event event enabled
May 23 14:48:50 bender rasdaemon: ras:non_standard_event event enabled
May 23 14:48:50 bender rasdaemon: ras:arm_event event enabled
May 23 14:48:50 bender rasdaemon: ras:aer_event event enabled
May 23 14:48:50 bender rasdaemon: Enabled event ras:aer_event
May 23 14:48:50 bender rasdaemon: ras:non_standard_event event enabled
May 23 14:48:50 bender rasdaemon: Enabled event ras:non_standard_event
May 23 14:48:50 bender rasdaemon: ras:arm_event event enabled
May 23 14:48:50 bender rasdaemon: Enabled event ras:arm_event
May 23 14:48:50 bender rasdaemon: Family 6 Model 9e CPU: only decoding architectural errors
May 23 14:48:50 bender rasdaemon: mce:mce_record event enabled
May 23 14:48:50 bender rasdaemon: Enabled event mce:mce_record
May 23 14:48:50 bender rasdaemon: ras:extlog_mem_event event enabled
May 23 14:48:50 bender rasdaemon: Enabled event ras:extlog_mem_event
Comment 8 Larry the Git Cow gentoo-dev 2019-05-24 04:32:59 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7e05995da72932bbe91c2b72d498ce86b862218

commit e7e05995da72932bbe91c2b72d498ce86b862218
Author:     Matthew Thode <prometheanfire@gentoo.org>
AuthorDate: 2019-05-24 04:32:36 +0000
Commit:     Matthew Thode <prometheanfire@gentoo.org>
CommitDate: 2019-05-24 04:32:53 +0000

    app-admin/rasdaemon: we don't need sqlite
    
    Thanks to Paul B. Henson <henson@acm.org> for the help
    Fixes: https://bugs.gentoo.org/686128
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Matthew Thode <prometheanfire@gentoo.org>

 app-admin/rasdaemon/files/rasdaemon.confd     |  2 +
 app-admin/rasdaemon/files/rasdaemon.openrc-r2 | 21 +++++++++
 app-admin/rasdaemon/rasdaemon-0.6.2-r4.ebuild | 64 +++++++++++++++++++++++++++
 3 files changed, 87 insertions(+)
Comment 9 Erik Quaeghebeur 2021-08-22 21:17:37 UTC
I think this fix is incomplete. When using the systemd unit file, the recording funtionality is assumed (-r option) and one'll get rasdaemon erroring out. (I had this happen to me and I fixed it by adding the sqlite use flag for the ebuild.)