Logwatch query about Cron : ERROR (getpwnam() failed

Issues related to applications and software problems
Post Reply
aegersz
Posts: 86
Joined: 2016/04/04 07:42:58

Logwatch query about Cron : ERROR (getpwnam() failed

Post by aegersz » 2017/06/17 11:35:16

since i moved to 6.9, I am seeing this in logwatch:

Code: Select all

--------------------- Cron Begin ------------------------ 

 
 **Unmatched Entries**
 ERROR (getpwnam() failed)
 
 ---------------------- Cron End ------------------------- 
any idea what it is telling me ?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Logwatch query about Cron : ERROR (getpwnam() failed

Post by TrevorH » 2017/06/17 11:55:14

Probably telling you there are errors in /var/log/cron

man getpwnam says "The getpwnam() function returns a pointer to a structure containing the broken-out fields of the record in the password database (e.g., the local password file /etc/passwd, NIS, and LDAP) that matches the username name." so I'd say it's possible you have a cron job set up for a user that's been removed or something like that.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

aegersz
Posts: 86
Joined: 2016/04/04 07:42:58

Re: Logwatch query about Cron : ERROR (getpwnam() failed

Post by aegersz » 2017/06/17 12:09:03

Yes, you are probably right as the cron log showed this error (i missed it the first time i scanned the log):

Code: Select all

Jun 16 02:00:01 forum crond[1827]: (/usr/bin/perl) ERROR (getpwnam() failed)
and it was the only entry in my crontab WITHOUT a user associated with it so i added "root":

Code: Select all

00 02 * * * root /usr/bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=XXXX -update
Thanks again, you put me on the right track !

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Logwatch query about Cron : ERROR (getpwnam() failed

Post by TrevorH » 2017/06/17 12:41:04

Odd. The awstats package from EPEL puts its cron entry in /etc/cron.hourly which doesn't need a username.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

aegersz
Posts: 86
Joined: 2016/04/04 07:42:58

Re: Logwatch query about Cron : ERROR (getpwnam() failed

Post by aegersz » 2017/06/17 13:09:04

I am using /etc/crontab - would that matter ?

the /var/log/cron shows that it's ok now so i'm happy.

EDIT: I know what i have done wrong - the entry in /etc/crontab does not need to be there as it is running hourly anyway !

Post Reply