Here's the original posting: ---------- Forwarded Message ---------- Subject: [SLE] online-update and logrotate mail problem Date: Saturday 25 September 2004 12:34 From: Jeffrey Laramie <suse-linux-e@Trans-Star.net> To: suse-linux-e@suse.com I'm having problems getting mail notification to work in Suse 9.1. It appears that postfix is not getting the mail generated by system daemons. Oddly I can use pine to mail to root and it is delivered correctly to the "real" email alias. here's what I've got so far: 1. postfix is running and mail sent to root is delivered ok 2. OnlineUpdate is run automatically when scheduled but the mail notification never occurs. I've tried different settings for MAIL_REPORTS_TO without any success. 3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed. 4. postfix mail log shows no activity at all when the above events occur. I have the same setup on 8.2 and it mails the reports as expected. I've spent days trying to get this to work. What am I missing here? Jeff
On Saturday 25 September 2004 2:25 pm, Jeffrey Laramie wrote:
3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed.
You sure it's supposed to email anything? My logrotate script in /etc/cron.daily looks like this.... #!/bin/sh /usr/sbin/logrotate /etc/logrotate.conf EXITVALUE=$? if [ $EXITVALUE != 0 ]; then /bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]" fi exit 0 It _logs_ an alert but will never mail anything due to the exit 0. Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.5-7.108-default x86_64
On Saturday 25 September 2004 17:34, Scott Leighton wrote:
On Saturday 25 September 2004 2:25 pm, Jeffrey Laramie wrote:
3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed.
You sure it's supposed to email anything?
Yup, here is my /etc/logrotate.conf file: # see "man logrotate" for details # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed #compress # uncomment these to switch compression to bzip2 #compresscmd /usr/bin/bzip2 #uncompresscmd /usr/bin/bunzip2 # RPM packages drop log rotation information into this directory include /etc/logrotate.d # no packages own wtmp -- we'll rotate them here #/var/log/wtmp { # monthly # create 0664 root utmp # rotate 1 #} # system-specific logs may be also be configured here. # Custom log rotation scripts. /var/log/messages { rotate 7 missingok daily mailfirst mail root create 0644 root root postrotate /etc/init.d/syslog reload endscript }
On Saturday 25 September 2004 2:47 pm, Jeffrey Laramie wrote:
On Saturday 25 September 2004 17:34, Scott Leighton wrote:
On Saturday 25 September 2004 2:25 pm, Jeffrey Laramie wrote:
3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed.
You sure it's supposed to email anything?
Yup, here is my /etc/logrotate.conf file:
Perhaps it is conflicting with the earlier directives in /etc/logrotate.d/syslog that deal with /var/log/messages Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.5-7.108-default x86_64
On Saturday 25 September 2004 18:03, Scott Leighton wrote:
On Saturday 25 September 2004 2:47 pm, Jeffrey Laramie wrote:
On Saturday 25 September 2004 17:34, Scott Leighton wrote:
On Saturday 25 September 2004 2:25 pm, Jeffrey Laramie wrote:
3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed.
You sure it's supposed to email anything?
Yup, here is my /etc/logrotate.conf file:
Perhaps it is conflicting with the earlier directives in /etc/logrotate.d/syslog that deal with /var/log/messages
Another good idea but I already deleted the reference to /var/log/messages in that file. Jeff
* Jeffrey Laramie <suse-linux-e@Trans-Star.net> [09-25-04 16:25]:
I'm having problems getting mail notification to work in Suse 9.1. It appears that postfix is not getting the mail generated by system daemons. Oddly I can use pine to mail to root and it is delivered correctly to the "real" email alias. here's what I've got so far:
you have an entry in /etc/aliases, root: <your-id> ???
1. postfix is running and mail sent to root is delivered ok
mail sent to root from ??????
2. OnlineUpdate is run automatically when scheduled but the mail notification never occurs. I've tried different settings for MAIL_REPORTS_TO without any success.
my first comment..... MAIL_REPORTS_TO should be root
3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed.
How do you know? Did you verify this in /var/log/mail ?
4. postfix mail log shows no activity at all when the above events occur.
/var/log/mail should contain lines like (looong line): Sep 25 14:31:24 wahoo postfix/local[27888]: E487C63853: to=<pat@wahoo.no-ip.org>, orig_to=<root>, relay=local, delay=3, status=sent (delivered to command: /usr/bin/procmail)
I have the same setup on 8.2 and it mails the reports as expected. I've spent days trying to get this to work. What am I missing here?
*most* probably my first line above. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
On Saturday 25 September 2004 18:40, Patrick Shanahan wrote:
* Jeffrey Laramie <suse-linux-e@Trans-Star.net> [09-25-04 16:25]:
I'm having problems getting mail notification to work in Suse 9.1. It appears that postfix is not getting the mail generated by system daemons. Oddly I can use pine to mail to root and it is delivered correctly to the "real" email alias. here's what I've got so far:
you have an entry in /etc/aliases, root: <your-id> ???
Yes. I've tried setting it to local users and remote email accounts. Mail sent from mail clients is delivered correctly.
1. postfix is running and mail sent to root is delivered ok
mail sent to root from ??????
From root and from another system (NIS) user.
2. OnlineUpdate is run automatically when scheduled but the mail notification never occurs. I've tried different settings for MAIL_REPORTS_TO without any success.
my first comment..... MAIL_REPORTS_TO should be root
It is, although I've tried setting it to other users and it didn't solve the problem.
3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed.
How do you know? Did you verify this in /var/log/mail ?
The /var/log/messages file is rotated correctly, but when logrotate runs I get an error in /var/log/messages "logrotate: ALERT exited abnormally with [1]". /var/log/mail shows no entries when logrotate runs.
4. postfix mail log shows no activity at all when the above events occur.
/var/log/mail should contain lines like (looong line): Sep 25 14:31:24 wahoo postfix/local[27888]: E487C63853: to=<pat@wahoo.no-ip.org>, orig_to=<root>, relay=local, delay=3, status=sent (delivered to command: /usr/bin/procmail)
It does when I send mail from mail clients.
I have the same setup on 8.2 and it mails the reports as expected. I've spent days trying to get this to work. What am I missing here?
*most* probably my first line above.
-- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
* Jeffrey Laramie <suse-linux-e@Trans-Star.net> [09-26-04 11:02]:
On Saturday 25 September 2004 18:40, Patrick Shanahan wrote:
you have an entry in /etc/aliases, root: <your-id> ???
Yes. I've tried setting it to local users and remote email accounts. Mail sent from mail clients is delivered correctly.
ALL mail is sent from a client of some sort. What do you mean, exactly?
3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed.
How do you know? Did you verify this in /var/log/mail ?
The /var/log/messages file is rotated correctly, but when logrotate runs I get an error in /var/log/messages "logrotate: ALERT exited abnormally with [1]". /var/log/mail shows no entries when logrotate runs.
google is your friend, especially google.com/linux I found: http://www.linuxquestions.org/questions/showthread.php?threadid=23614 look at post #4 ps: It would be nice if you would trim your quotes, PLEASE. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
you have an entry in /etc/aliases, root: <your-id> ???
Yes. I've tried setting it to local users and remote email accounts. Mail sent from mail clients is delivered correctly.
ALL mail is sent from a client of some sort. What do you mean, exactly?
As I stated in a previous post, pine, mail, kmail, etc. work as expected and mail is delivered correctly.
3. logrotate also runs as called by cron. The logrotate scripts run as expected but the "mail" command fails and the logs are never mailed.
How do you know? Did you verify this in /var/log/mail ?
The /var/log/messages file is rotated correctly, but when logrotate runs I get an error in /var/log/messages "logrotate: ALERT exited abnormally with [1]". /var/log/mail shows no entries when logrotate runs.
google is your friend, especially google.com/linux I found: http://www.linuxquestions.org/questions/showthread.php?threadid=23614 look at post #4
I tried Googling and didn't find anything useful. The post you found referred to a problem with a corrupted logrotate.status file that caused logrotate to fail. Other than it's inability to mail the report, logrotate works as expected and my logrotate.status file accurately reflects the dates the logs were last rotated. This is a difficult problem to search on since it effects the mailing of OnlineUpdate reports as well. It's as if the MAIL_REPORTS_ TO setting is blank, but it's not. Is there another setting somewhere that enables/disables the mailing feature? Thanks for your help. Jeff
* Jeffrey Laramie <suse-linux-e@Trans-Star.net> [09-26-04 14:49]:
This is a difficult problem to search on since it effects the mailing of OnlineUpdate reports as well. It's as if the MAIL_REPORTS_ TO setting is blank, but it's not. Is there another setting somewhere that enables/disables the mailing feature?
/etc/logdigest/config must contain: # person to send log activity to. SYSADMIN=root /etc/cron.daily/logdigest must contain: # Person to send log activity to. : ${SYSADMIN:=root} /etc/crontab must contain: MAILTO=root crontab -e -u root must contain: MAILTO=root ***** the files under /etc/logdigest/ *may* *not* have more than *one* blank line at the end and *no* blank lines before the end. You should not have edited any of these files except xxx.local (alarming,ignore). ***** *all* these conditions should be met, but the last is probably your problem. It bit me once. (*once* <grin>). gud luk, -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
/etc/logdigest/config must contain: # person to send log activity to. SYSADMIN=root
/etc/cron.daily/logdigest must contain: # Person to send log activity to.
: ${SYSADMIN:=root}
logdigest? I don't have any of these files on my system and a search of available packages didn't get a hit on that name.
/etc/crontab must contain: MAILTO=root
Already done.
crontab -e -u root must contain: MAILTO=root
I didn't have a crontab for root, so I created one and put that line in it. Jeff
* Jeffrey Laramie <suse-linux-e@Trans-Star.net> [09-26-04 16:01]:
/etc/logdigest/config must contain: # person to send log activity to. SYSADMIN=root
/etc/cron.daily/logdigest must contain: # Person to send log activity to.
: ${SYSADMIN:=root}
logdigest? I don't have any of these files on my system and a search of available packages didn't get a hit on that name.
# ls -la /etc/logdigest/ total 44 drwx------ 2 root root 4096 Sep 17 06:43 . drwxr-xr-x 92 root root 8192 Sep 26 16:34 .. -rw------- 1 root root 1041 Oct 2 2003 alarming -rw------- 1 root root 27 Jul 26 07:20 alarming.local -rw------- 1 root root 358 Jul 10 12:12 config -rw------- 1 root root 9281 Oct 2 2003 ignore -rw------- 1 root root 1097 Sep 17 06:43 ignore.local -rw------- 1 root root 973 Aug 13 06:31 ignore.local~ ls -la /etc/cron.daily/ total 92 drwxr-xr-x 2 root root 4096 Sep 12 17:57 . drwxr-xr-x 92 root root 8192 Sep 26 16:34 .. -rwxr-x--- 1 root root 79 Sep 12 17:01 01-rkhunter -rwx------ 1 root root 924 Nov 4 2003 clean_catman -rwx------ 1 root root 1761 Nov 4 2003 clean_core -rwx------ 1 root root 1169 Nov 4 2003 do_mandb -rwxr-xr-x 1 root root 12493 Sep 23 2003 faxcron -rwx------ 1 root root 5721 Oct 2 2003 logdigest -rwxr-xr-x 1 root root 51 Oct 2 2003 logrotate -rwxr-xr-x 1 root root 464 Oct 2 2003 storebackup -rwxr-xr-x 1 root root 1875 Sep 1 2003 suse.de-backup-rc.config -rwxr-xr-x 1 root root 2059 Sep 8 2003 suse.de-backup-rpmdb -rwxr-xr-x 1 root root 584 Sep 1 2003 suse.de-check-battery -rwxr-xr-x 1 root root 1121 Sep 1 2003 suse.de-clean-tmp -rwxr-xr-x 1 root root 472 Sep 1 2003 suse.de-clean-vi -rwxr-xr-x 1 root root 371 Sep 1 2003 suse.de-cron-local -rwxr-xr-x 1 root root 685 Nov 4 2003 tetex -rwx------ 1 root root 1526 Nov 4 2003 updatedb -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/photos
On Sun, 2004-09-26 at 13:41, Patrick Shanahan wrote:
* Jeffrey Laramie <suse-linux-e@Trans-Star.net> [09-26-04 16:01]:
/etc/logdigest/config must contain: # person to send log activity to. SYSADMIN=root
/etc/cron.daily/logdigest must contain: # Person to send log activity to.
: ${SYSADMIN:=root}
logdigest? I don't have any of these files on my system and a search of available packages didn't get a hit on that name.
SuSE 9.1 Pro here also.
# ls -la /etc/logdigest/ total 44 drwx------ 2 root root 4096 Sep 17 06:43 . drwxr-xr-x 92 root root 8192 Sep 26 16:34 .. -rw------- 1 root root 1041 Oct 2 2003 alarming -rw------- 1 root root 27 Jul 26 07:20 alarming.local -rw------- 1 root root 358 Jul 10 12:12 config -rw------- 1 root root 9281 Oct 2 2003 ignore -rw------- 1 root root 1097 Sep 17 06:43 ignore.local -rw------- 1 root root 973 Aug 13 06:31 ignore.local~
# ls -la /etc/logdigest/ /bin/ls: /etc/logdigest/: No such file or directory
ls -la /etc/cron.daily/ total 92 drwxr-xr-x 2 root root 4096 Sep 12 17:57 . drwxr-xr-x 92 root root 8192 Sep 26 16:34 .. -rwxr-x--- 1 root root 79 Sep 12 17:01 01-rkhunter -rwx------ 1 root root 924 Nov 4 2003 clean_catman -rwx------ 1 root root 1761 Nov 4 2003 clean_core -rwx------ 1 root root 1169 Nov 4 2003 do_mandb -rwxr-xr-x 1 root root 12493 Sep 23 2003 faxcron -rwx------ 1 root root 5721 Oct 2 2003 logdigest -rwxr-xr-x 1 root root 51 Oct 2 2003 logrotate -rwxr-xr-x 1 root root 464 Oct 2 2003 storebackup -rwxr-xr-x 1 root root 1875 Sep 1 2003 suse.de-backup-rc.config -rwxr-xr-x 1 root root 2059 Sep 8 2003 suse.de-backup-rpmdb -rwxr-xr-x 1 root root 584 Sep 1 2003 suse.de-check-battery -rwxr-xr-x 1 root root 1121 Sep 1 2003 suse.de-clean-tmp -rwxr-xr-x 1 root root 472 Sep 1 2003 suse.de-clean-vi -rwxr-xr-x 1 root root 371 Sep 1 2003 suse.de-cron-local -rwxr-xr-x 1 root root 685 Nov 4 2003 tetex -rwx------ 1 root root 1526 Nov 4 2003 updatedb
# ls -la /etc/cron.daily/ total 55 drwxr-xr-x 2 root root 448 2004-09-01 22:41 . drwxr-xr-x 69 root root 6736 2004-09-26 08:42 .. -rwx------ 1 root root 924 2004-04-05 19:32 clean_catman -rwx------ 1 root root 1761 2004-04-05 17:30 clean_core -rwx------ 1 root root 1169 2004-04-05 19:32 do_mandb -rwxr-xr-x 1 root root 176 2004-04-05 17:26 logrotate -rwxr-xr-x 1 root root 1875 2003-09-01 03:10 suse.de-backup-rc.config -rwxr-xr-x 1 root root 2059 2003-09-08 05:50 suse.de-backup-rpmdb -rwxr-xr-x 1 root root 566 2004-07-23 02:36 suse.de-check-battery -rwxr-xr-x 1 root root 1121 2003-09-01 03:10 suse.de-clean-tmp -rwxr-xr-x 1 root root 472 2003-09-01 03:10 suse.de-clean-vi -rwxr-xr-x 1 root root 371 2003-09-01 03:10 suse.de-cron-local -rwxr-xr-x 1 root root 685 2004-04-06 09:42 tetex -rwx------ 1 root root 1526 2004-04-05 17:30 updatedb Dee
logdigest? I don't have any of these files on my system and a search of available packages didn't get a hit on that name.
# ls -la /etc/logdigest/
# ls -la /etc/logdigest ls: /etc/logdigest: No such file or directory ls -la /etc/cron.daily/ total 55 drwxr-xr-x 2 root root 448 Jun 22 08:25 . drwxr-xr-x 72 root root 7536 Sep 24 11:04 .. -rwx------ 1 root root 924 Sep 11 2003 clean_catman -rwx------ 1 root root 1169 Sep 11 2003 do_mandb -rwxr-xr-x 1 root root 51 Mar 13 2003 logrotate -rwx------ 1 root root 357 Mar 28 2003 medusa.cron -rwxr-xr-x 1 root root 271 Jun 21 09:48 mydaily -rwxr-xr-x 1 root root 1864 Jul 29 2002 suse.de-backup-rc.config -rwxr-xr-x 1 root root 1974 May 21 2002 suse.de-backup-rpmdb -rwxr-xr-x 1 root root 573 Feb 7 2002 suse.de-check-battery -rwxr-xr-x 1 root root 1148 Feb 28 2003 suse.de-clean-tmp -rwxr-xr-x 1 root root 461 Feb 7 2002 suse.de-clean-vi -rwxr-xr-x 1 root root 360 May 21 2002 suse.de-cron-local -rwxr-xr-x 1 root root 685 Mar 27 2003 tetex This is form my 8.2 box. Nothing here either. This 8.2 box mails reports as expected so it doesn't look like logdigest is required. Jeff
The Saturday 2004-09-25 at 17:25 -0400, Jeffrey Laramie wrote:
I'm having problems getting mail notification to work in Suse 9.1. It appears that postfix is not getting the mail generated by system daemons. Oddly I can use pine to mail to root and it is delivered correctly to the "real" email alias. here's what I've got so far:
Test email using comand "mail". Check /var/log/mail. -- Cheers, Carlos Robinson
On Sunday 26 September 2004 07:56, Carlos E. R. wrote:
The Saturday 2004-09-25 at 17:25 -0400, Jeffrey Laramie wrote:
I'm having problems getting mail notification to work in Suse 9.1. It appears that postfix is not getting the mail generated by system daemons. Oddly I can use pine to mail to root and it is delivered correctly to the "real" email alias. here's what I've got so far:
Test email using comand "mail". Check /var/log/mail.
I can mail to both local and remote mailboxes using mail, pine, kmail, and Mozilla mail. The /var/log/mail file reflects this accurately. That's what makes this so odd. I have the same problem with scripts not mailing reports on all of my 9.1 boxes and none of my 8.2 ones. While this may be a coincidence it makes me think that there is a different setting in 9.1 that I haven't gotten right yet. Jeff
The Sunday 2004-09-26 at 11:44 -0400, Jeffrey Laramie wrote:
Test email using comand "mail". Check /var/log/mail.
I can mail to both local and remote mailboxes using mail, pine, kmail, and Mozilla mail. The /var/log/mail file reflects this accurately. That's what makes this so odd. I have the same problem with scripts not mailing reports on all of my 9.1 boxes and none of my 8.2 ones.
scripts... any script? Edit one of those scripts, preferably one that is not a cron job, and add "-x" at at the first line, after bash. My guess is that your scripts have a problem with either the command line program "mail" or with "sendmail", both of which are used to send mail from scripts. Perhaps mail is not on the path, or it is in /usr/local, or something of the sort. Or the path for the user running the script is weird, or the permission to access mail is not allowed for everybody. cer@nimrodel:~> which mail /usr/bin/mail cer@nimrodel:~> l /usr/bin/mail lrwxrwxrwx 1 root root 4 2004-08-15 14:04 /usr/bin/mail -> nail* cer@nimrodel:~> l /usr/bin/nail -rwxr-xr-x 1 root root 167510 2004-04-06 04:33 /usr/bin/nail* cer@nimrodel:~> l /usr/sbin/sendmail -rwxr-xr-x 1 root root 122054 2004-04-06 04:27 /usr/sbin/sendmail* (postfix includes a sendmail binary for compatibility)
While this may be a coincidence it makes me think that there is a different setting in 9.1 that I haven't gotten right yet.
I don't know. I updated from 8.2 to 9.1 and didn't have that problem. -- Cheers, Carlos Robinson
On Sunday 26 September 2004 19:26, Carlos E. R. wrote:
The Sunday 2004-09-26 at 11:44 -0400, Jeffrey Laramie wrote:
Test email using comand "mail". Check /var/log/mail.
I can mail to both local and remote mailboxes using mail, pine, kmail, and Mozilla mail. The /var/log/mail file reflects this accurately. That's what makes this so odd. I have the same problem with scripts not mailing reports on all of my 9.1 boxes and none of my 8.2 ones.
scripts... any script? Edit one of those scripts, preferably one that is not a cron job, and add "-x" at at the first line, after bash.
The 2 programs I'm having problems with are OnlineUpdate and logrotate which are called by cron scripts. However I've been able to get logrotate to duplicate the error by running it from the command line. su to root then: JeffsPC:/home/jalaramie # /usr/sbin/logrotate /etc/logrotate.conf Reload syslog service done error: mail command failed for /var/log/messages.1 The file is rotated correctly but the postfix log shows no activity at all when I run this. The really odd thing is I can use "mail" to send root a message from that very same shell. JeffsPC:/home/jalaramie # mail root -s test This works fine and the mail is forwarded to the correct user account. Thanks, Jeff
The Sunday 2004-09-26 at 21:16 -0400, Jeffrey Laramie wrote:
JeffsPC:/home/jalaramie # /usr/sbin/logrotate /etc/logrotate.conf Reload syslog service done error: mail command failed for /var/log/messages.1
The man page for logrotate shows: -m, --mail <command> Tells logrotate which command to use when mailing logs. This command should accept two arguments: 1) the subject of the message, and 2) the recipient. The command must then read a message on standard input and mail it to the recipient. The default mail command is /bin/mail -s. Does the file /bin/mail exist, and does it run?
The file is rotated correctly but the postfix log shows no activity at all when I run this. The really odd thing is I can use "mail" to send root a message from that very same shell.
JeffsPC:/home/jalaramie # mail root -s test
This works fine and the mail is forwarded to the correct user account.
There is something wrong with your command "mail", it is misplaced, diferent, or something. -- Cheers, Carlos Robinson
On Monday 27 September 2004 09:07, Carlos E. R. wrote:
The Sunday 2004-09-26 at 21:16 -0400, Jeffrey Laramie wrote:
JeffsPC:/home/jalaramie # /usr/sbin/logrotate /etc/logrotate.conf Reload syslog service done error: mail command failed for /var/log/messages.1
The man page for logrotate shows:
-m, --mail <command> Tells logrotate which command to use when mailing logs. This command should accept two arguments: 1) the subject of the message, and 2) the recipient. The command must then read a message on standard input and mail it to the recipient. The default mail command is /bin/mail -s.
Does the file /bin/mail exist, and does it run?
Yes, it's an alias for /usr/bin/nail. "/bin/mail root -s Test" works fine, but you're on to something here. NS2:~ # /usr/sbin/logrotate /etc/logrotate.conf -m /bin/mail -s logrotate: bad argument -s: unknown error The default logrotate mail command fails. NS2:~ # /usr/sbin/logrotate /etc/logrotate.conf -m /bin/mail Reload syslog service done Drop the "-s" and the mail command works and the log is mailed correctly. I don't know exactly why, but 9.1 breaks the default logrotate mail command. Annoying but fixable. Nice work, thanks! Now I need to see if I can fix OnlineUpdate so that it can mail it's report. At least I have a starting point for that one. Thanks again Carlos. Jeff
The Tuesday 2004-09-28 at 10:05 -0400, Jeffrey Laramie wrote:
"/bin/mail root -s Test" works fine, but you're on to something here.
NS2:~ # /usr/sbin/logrotate /etc/logrotate.conf -m /bin/mail -s logrotate: bad argument -s: unknown error
The default logrotate mail command fails.
NS2:~ # /usr/sbin/logrotate /etc/logrotate.conf -m /bin/mail Reload syslog service done
Drop the "-s" and the mail command works and the log is mailed correctly. I don't know exactly why, but 9.1 breaks the default logrotate mail command. Annoying but fixable. Nice work, thanks!
Mmmm... I don't really understand. The -s parameter as written above is not interpreted by "mail", but by logrotate, and it expects a filename behind. However, if using something lile -m "/bin/mail -s ", then then the "-s" should be interpreted by mail, and then it expects a text (the subject line). The cron job that calls logrotate uses: /usr/sbin/logrotate /etc/logrotate.conf but I don't have any mail clause in logrotate configs, so I don't know if it works or not.
Now I need to see if I can fix OnlineUpdate so that it can mail it's report. At least I have a starting point for that one. Thanks again Carlos.
Welcome. I dont use the OnlineUpdate applet, so I don't know. I use YOU manually. -- Cheers, Carlos Robinson
On Tuesday 28 September 2004 19:52, Carlos E. R. wrote:
The Tuesday 2004-09-28 at 10:05 -0400, Jeffrey Laramie wrote:
"/bin/mail root -s Test" works fine, but you're on to something here.
NS2:~ # /usr/sbin/logrotate /etc/logrotate.conf -m /bin/mail -s logrotate: bad argument -s: unknown error
The default logrotate mail command fails.
NS2:~ # /usr/sbin/logrotate /etc/logrotate.conf -m /bin/mail Reload syslog service done
Drop the "-s" and the mail command works and the log is mailed correctly. I don't know exactly why, but 9.1 breaks the default logrotate mail command. Annoying but fixable. Nice work, thanks!
Mmmm... I don't really understand. The -s parameter as written above is not interpreted by "mail", but by logrotate, and it expects a filename behind.
However, if using something lile -m "/bin/mail -s ", then then the "-s" should be interpreted by mail, and then it expects a text (the subject line).
Interestingly when I specify "-m /bin/mail" wihout the -s parameter, logrotate executes exactly as it does in 8.2 and sends an e-mail containing the log file with the path and file name of the rotated file as the subject. As far as my online_update issue, I figured out that the version of online_update used in 9.1 no longer prints a summary of patches to stdout, therefor there is no output for cron to mail. I created a small test script that sends data to stdout and ran the script from cron. It mailed the output as expected, so my cron mail configuration is fine. It turns out that what appeared to be a mail configuration problem was actually 2 unrelated issues which had nothing to do with each other. Thanks again to those of you who offered help and suggestions. Jeff
The 2004-09-30 at 10:09 -0400, Jeffrey Laramie wrote:
Interestingly when I specify "-m /bin/mail" wihout the -s parameter, logrotate executes exactly as it does in 8.2 and sends an e-mail containing the log file with the path and file name of the rotated file as the subject.
Interesting. I haven't tried myself, I don't email logs. It could be a bug or missfeature in logrotate, that perhaps is not prepared for that small diference between mail and nail. Needs confirmation, but you could inform suse feedback - I wonder if it is already too late for 9.2.
It turns out that what appeared to be a mail configuration problem was actually 2 unrelated issues which had nothing to do with each other. Thanks again to those of you who offered help and suggestions.
Nice to know :-) -- Cheers, Carlos Robinson
On Monday 04 October 2004 17:51, Carlos E. R. wrote:
Interesting. I haven't tried myself, I don't email logs. It could be a bug or missfeature in logrotate, that perhaps is not prepared for that small diference between mail and nail. Needs confirmation, but you could inform suse feedback - I wonder if it is already too late for 9.2.
I don't know, but it seems to be related to the way the parameters are passed so it ought to be a quick fix. I sent a report in anyway. The chatter indicates 9.2 is beta so it shouldn't be too much longer. I'm still deploying 9.1 so I'm not even thinking about 9.2 yet. :-( Jeff
participants (5)
-
Carlos E. R.
-
Jeffrey Laramie
-
Patrick Shanahan
-
Scott Leighton
-
W.D.McKinney