Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 477188 - app-admin/logcheck requires /var/log read permission to function
Summary: app-admin/logcheck requires /var/log read permission to function
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Paweł Hajdan, Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-17 07:36 UTC by Eddie Parker
Modified: 2013-07-27 19:13 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eddie Parker 2013-07-17 07:36:58 UTC
On my newly built system, logcheck won't function and gives errors like the following:

sendmail: account default not found: no configuration file available
Error closing sendmail: non-zero exit (78) at /usr/bin/mime-construct line 559

The root of this issue is two fold:

- By default the logs I'm using are with root-only read permissions (/var/log/messages is 0600)
- The /etc/msmtprc file is also too restrictive for this tool to make use of (0600)

My solution:

-- Add the logcheck user to the 'adm' group in /etc/group
-- chmod 0640 /etc/msmtprc and /var/log/messages
-- chgrp adm /etc/msmtprc and /var/log/messages
-- Modify /etc/syslog-ng.conf to add permissions to have it set the permissions itself:

destination messages { file("/var/log/messages" perm(0640) group(adm)); };

I only mention this as it took a lot of trial and error to figure this out.  As a minimum, it would be great if the ebuild printed a message along these lines, or at best if the system had a group and appropriate permissions for logcheck to hook into.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-07-17 12:00:30 UTC
(In reply to Eddie Parker from comment #0)
> sendmail: account default not found: no configuration file available
> Error closing sendmail: non-zero exit (78) at /usr/bin/mime-construct line
> 559

That is from mail-mta/msmtp, which suggests (in einfo messages):

   "Please edit /etc/msmtprc before first use.
    In addition, per user configuration files can be placed
    as '~/.msmtprc'.  See the msmtprc-user.example file under
    /usr/share/doc/${PF}/ for an example."

So you should set msmtp up properly system-wide and per-user, perhaps? Or if the system-wide runtime configuration works for all users, make it world-readable?

> The root of this issue is two fold:

One, then. The other issue (if there is one) is in mail-mta/msmtp.

> - By default the logs I'm using are with root-only read permissions
> (/var/log/messages is 0600)
Comment 2 Eddie Parker 2013-07-17 19:22:12 UTC
(In reply to Jeroen Roovers from comment #1)
> (In reply to Eddie Parker from comment #0)
> > sendmail: account default not found: no configuration file available
> > Error closing sendmail: non-zero exit (78) at /usr/bin/mime-construct line
> > 559
> 
> That is from mail-mta/msmtp, which suggests (in einfo messages):
> 
>    "Please edit /etc/msmtprc before first use.
>     In addition, per user configuration files can be placed
>     as '~/.msmtprc'.  See the msmtprc-user.example file under
>     /usr/share/doc/${PF}/ for an example."
> 
> So you should set msmtp up properly system-wide and per-user, perhaps? Or if
> the system-wide runtime configuration works for all users, make it
> world-readable?

Thanks for replying Jeroen.

I suppose that's likely a better way of doing it: having a ~/.msmtprc for each user: however logcheck runs under a user with no home directory, so their ~/.msmtprc would be under /.msmtprc, I imagine?  

I've gone ahead and made the default /etc/msmtprc readable by it's "group" and changed the group to "adm", which logcheck is now a part of, and the e-mail portion works fine.

> > The root of this issue is two fold:
> 
> One, then. The other issue (if there is one) is in mail-mta/msmtp.

Agreed, but they need to play nicely together (The logcheck user needs to be in the same group and have read permissions to /etc/msmtprc).
Comment 3 Paweł Hajdan, Jr. (RETIRED) gentoo-dev 2013-07-27 19:13:13 UTC
As far as I can see this should be covered by http://www.gentoo.org/doc/en/logcheck.xml

Please let me know if I'm missing something.