Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 189582 - app-text/man2html - cron task should be quiet
Summary: app-text/man2html - cron task should be quiet
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High trivial
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-20 11:59 UTC by Harvey Chapman
Modified: 2008-05-23 23:30 UTC (History)
1 user (show)

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 Harvey Chapman 2007-08-20 11:59:21 UTC
Getting an e-mail everyday from man2html's cron task is annoying. The following should replace the file /etc/cron.daily/man2html. I'm not bothering to submit a patch because the entire file is 4 lines long. The new cron task saves the output to a temp file and then cats the temp file if an error occurs.

From:
#!/bin/sh
nice -n 19 /usr/bin/glimpseindex -f -z -H /var/man2html `man -w | tr : ' '`
chmod 644 /var/man2html/.glimpse*

To:

#!/bin/sh
nice -n 19 /usr/bin/glimpseindex -f -z -H /var/man2html `man -w | tr : ' '` 2>&1 > /tmp/man2html.$$ || cat /tmp/man2html.$$
rm -f /tmp/man2html.$$
chmod 644 /var/man2html/.glimpse*
Comment 1 Robert Buchholz (RETIRED) gentoo-dev 2007-09-01 09:02:29 UTC
reassigning to proper alias
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-05-22 04:53:20 UTC
Can't you simply redirect the output to /dev/null and voila, no more messages?

Resolving as INVALID because this is completely up to the user to set up how s/he wants.
Comment 3 Harvey Chapman 2008-05-22 20:41:48 UTC
I respectfully disagree. Users should not have to fix problems left behind by developers. Cron programs should not spam users unless that is what they're designed to do (log filters, etc.).

The original cron job spammed the user once a day, annoying a user enough until they finally track down the offending cron job and redirect it to NULL. And how is a user supposed to know that "glimpse" is in any way related to man2html without research? The cron output only mentions glimpse.

The replacement script I gave in the original comment is the best of both worlds. It will perform completely silent unless an error occurs. If an error occurs, the user will get an e-mail with the full output of the cron job.

Problem solved.
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-05-22 21:08:25 UTC
Ah, ok. Sorry, I guess I did not understand the problem well enough.

Since this package doesn't have a mainainer, I'm thinking the best compromise would be to put your method in the file with a comment stating what it does. Would this be an acceptable solution for you? If this package did have a maintainer, then he or she would decide on what to do. 
Comment 5 Harvey Chapman 2008-05-23 01:21:05 UTC
Sorry if I snapped a bit. I only posted it as a bug here because the package didn't have a maintainer and I was hoping that someone with more knowledge of the package system and commit privileges would apply my change. A comment at the top explaining it's function is an excellent idea.
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-05-23 04:00:27 UTC
We definitely value your contribution! =) I will put in your suggestion with a reference to this bug sometime soon here.
Comment 7 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-05-23 23:30:12 UTC
% cvs diff
cvs diff: Diffing .
Index: man2html.cron
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-text/man2html/files/man2html.cron,v
retrieving revision 1.1
diff -r1.1 man2html.cron
3a4,13
> 
> # Below is submitted from another user. "It will perform completely silent 
> # unless an error occurs. If an error occurs, the user will get an e-mail with 
> # the full output of the cron job."
> # See https://bugs.gentoo.org/show_bug.cgi?id=189582 for more information
> 
> #nice -n 19 /usr/bin/glimpseindex -f -z -H /var/man2html `man -w | tr : ' '`
> #2>&1 > /tmp/man2html.$$ || cat /tmp/man2html.$$
> #rm -f /tmp/man2html.$$
> #chmod 644 /var/man2html/.glimpse*

Added your suggestion, I know it isn't ideal but it will have to work. I think it is the best compromise that we can agree to. At least if someone picks up maintainership of this package, s/he will know where to look and possible fix (and maintain) the default method. Thanks again.