Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 19359 - logwatch adds wrong crontab entry: logwatch.pl v. logwatch
Summary: logwatch adds wrong crontab entry: logwatch.pl v. logwatch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Jared H. Hudson (RETIRED)
URL:
Whiteboard:
Keywords:
: 20150 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-04-15 09:10 UTC by B. K. Oxley (binkley)
Modified: 2003-12-07 08:03 UTC (History)
2 users (show)

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


Attachments
change logwatch.pl -> logwatch (logwatch-4.3.2.ebuild.diff,616 bytes, patch)
2003-04-15 09:14 UTC, B. K. Oxley (binkley)
Details | Diff
fixes /usr/sbin -> /usr/bin (logwatch-4.3.2.ebuild-diff,615 bytes, patch)
2003-04-15 10:34 UTC, B. K. Oxley (binkley)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description B. K. Oxley (binkley) 2003-04-15 09:10:45 UTC
The 4.2.2 ebuild for sys-apps/logwatch adds the wrong crontab entry in pkg_postinst.  It 
should run /usr/sbin/logwatch but instead runs /usr/sbin/logwatch.pl.  I'm sure this is because 
that's what happens in the original source tarball for logwatch.  The fix is trivial: remove the .pl 
suffix in the ebuild.  The diff is below: 
 
*** fixed-logwatch-4.3.2.ebuild Tue Apr 15 08:10:01 2003 
--- logwatch-4.3.2.ebuild       Tue Apr 15 08:09:38 2003 
*************** 
*** 55,61 **** 
        if [ "`grep logwatch.pl ${ROOT}var/spool/cron/crontabs/root`" == "" ]; 
        then 
                einfo "adding to cron..." 
!               echo "0 0 * * * ${ROOT}usr/sbin/logwatch 2>&1 > /dev/null" \ 
                        >> ${ROOT}var/spool/cron/crontabs/root 
        fi 
  } 
--- 55,61 ---- 
        if [ "`grep logwatch.pl ${ROOT}var/spool/cron/crontabs/root`" == "" ]; 
        then 
                einfo "adding to cron..." 
!               echo "0 0 * * * ${ROOT}usr/sbin/logwatch.pl 2>&1 > /dev/null" \ 
                        >> ${ROOT}var/spool/cron/crontabs/root 
        fi 
  } 
 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 B. K. Oxley (binkley) 2003-04-15 09:14:24 UTC
Created attachment 10677 [details, diff]
change logwatch.pl -> logwatch

This diff makes a logwatch-4.3.2-r1.ebuild that only removes the errant suffix.
Comment 2 B. K. Oxley (binkley) 2003-04-15 10:31:47 UTC
There is one other issue: /usr/bin/logwatch is the correct path, not /usr/sbin/logwatch.pl.  It isn't 
just the suffix .pl but also the path.  I've updated my proposed patch to reflect this. 
Comment 3 B. K. Oxley (binkley) 2003-04-15 10:34:50 UTC
Created attachment 10684 [details, diff]
fixes /usr/sbin -> /usr/bin

Replaces previous suggested patch.
Comment 4 Jared H. Hudson (RETIRED) gentoo-dev 2003-04-15 18:44:34 UTC
Since logwatch-4.3.2 creates a /usr/sbin/logwatch.pl executable, I think the cron updating script is correct as is.

If your filesystem has a /usr/bin/logwatch, then that might be from an older install of logwatch.

I'm open towards renaming logwatch.pl to just logwatch (via rename or symbolic link), but I think logwatch should remain in /usr/sbin, since it is a system (sbin) type program, not a normal user binary (bin) program.

If your filesystem contains a /usr/bin/logwatch or /usr/sbin/logwatch,
install gentoolkit and perform a 'epm -qf /usr/bin/logwatch to see what version of logwatch it belongs to, or re-emerge logwatch and make note of what files it says it's >> (installing).

Either way, thanks for submitting this bug report. Because of this I discovered a different bug: the logwatch man page refers to a /etc/log.d/logwatch.conf (as a symbolic link to the currently existing /etc/log.d/conf/logwatch.conf) which we do not have
Comment 5 Jared H. Hudson (RETIRED) gentoo-dev 2003-04-18 19:47:30 UTC
please see the comment above.
Comment 6 B. K. Oxley (binkley) 2003-04-18 19:58:22 UTC
Thanks for the suggestion!  /usr/bin/logwatch is owned by no one and I have no file named 
/usr/sbin/logwatch*.  And reemerging reveals: 
 
# ls -l /usr/bin/*logw* 
lrwxrwxrwx    1 root     root           39 Apr 18 19:55 /usr/bin/logwatch -> 
/usr/share/logwatch/scripts/logwatch.pl 
# ls -l /usr/sbin/*logw* 
ls: /usr/sbin/*logw*: No such file or directory 
 
So something is still interesting. 
 
The emerge installed sys-apps/logwatch 4.2.1. 
 
 
Comment 7 Michaela Susan Buesing 2003-04-30 10:34:49 UTC
I emerged logwatch for the first time less than a week ago. It is sys-apps/logwatch-4.2.1 . The crontab-entry wants to use /usr/sbin/logwatch, which does not exist. What exists is:

-rwxr-xr-x    1 root     root        22537 2003-04-27 05:17 /usr/share/logwatch/scripts/logwatch.pl

and

lrwxrwxrwx    1 root     root           39 2003-04-27 05:17 /usr/bin/logwatch -> /usr/share/logwatch/scripts/logwatch.pl

I agree that it *should* be in /usr/sbin . What also puzzles me is the permissions on /usr/share/logwatch/scripts/logwatch.pl . -rwxr-x--- would seem more appropiate to me.
Comment 8 Rajiv Aaron Manglani (RETIRED) gentoo-dev 2003-06-01 22:17:26 UTC
*** Bug 20150 has been marked as a duplicate of this bug. ***
Comment 9 Alessandro Pisani 2003-11-16 11:48:48 UTC
this bug can be safely closed since the logwatch ebuild doesn't modify the
crontab anymore (cfr logwatch-4.3.2.ebuild)
Comment 10 Heinrich Wendel (RETIRED) gentoo-dev 2003-12-07 08:03:03 UTC
you're right, close :)