Operating System - HP-UX
1830898 Members
2214 Online
110017 Solutions
New Discussion

mailx/sendmail has stopped logging

 
SOLVED
Go to solution
Dek_1
Advisor

mailx/sendmail has stopped logging

I have recently truncated the mail log in /var/adm/syslog/mail.log and now it is not being updated.
I have tried a stop and a start of sendmail
Also the configuration of sendmail has not changed ( loglevel=9 )
Has anyone any ideas about what I have missed ?

Its on HPUX
8 REPLIES 8
morganelan
Trusted Contributor

Re: mailx/sendmail has stopped logging

Stopping and Starting the sendmail Daemon

If the sendmail configuration file or frozen configuration changes, you should kill and restart the sendmail daemon so that it re-reads the configuration file.

The command

# /usr/lib/sendmail -bk

run by the superuser, kills a sendmail daemon started with -bd, whether or not it was started with the -q interval flag. It does not kill a sendmail daemon started only with -q interval. You must kill this type of daemon by finding its process ID and killing it explicitly.

NOTE: Do not kill sendmail with kill -9. This may cause sendmail to corrupt the alias database. Use kill-15 instead.
Kamal Mirdad
Dek_1
Advisor

Re: mailx/sendmail has stopped logging

morganelan,
I stopped and started sendmail :-

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start
ps -ef | grep sendmail

and it certainly has restarted : new pid and starttime.
But it is still not appearing to log
Muthukumar_5
Honored Contributor
Solution

Re: mailx/sendmail has stopped logging

check these:

1) /etc/syslog.conf
mail.debug /var/adm/syslog/mail.log

2) # ls -l /var/adm/syslog/mail.log
-r--r--r-- 1 root root

3) # ls -ld /var/adm/syslog
dr-xr-xr-x 2 bin bin

4) /sbin/init.d/sendmail stop
> /var/adm/syslog/mail.log
/sbin/init.d/sendmail start

5) tail -f /var/adm/syslog/mail.log

hth.
Easy to suggest when don't know about the problem!
Dek_1
Advisor

Re: mailx/sendmail has stopped logging

I tried that out :-
dekerp.root > : ls -al /var/adm/syslog/mail.log
-rw-r----- 1 root sys 0 Aug 5 10:12 /var/adm/syslog/mail.log
dekerp.root > : chmod 444 /var/adm/syslog/mail.log
dekerp.root > : ls -al /var/adm/syslog/mail.log
-r--r--r-- 1 root sys 0 Aug 5 10:12 /var/adm/syslog/mail.log
dekerp.root > : ls -ld /var/adm/syslog
dr-xr-xr-x 2 bin bin 8192 Aug 5 10:13 /var/adm/syslog
dekerp.root > : /sbin/init.d/sendmail stop
Sendmail pid is 13792
Killing sendmail...
Sendmail killed.
dekerp.root > : > /var/adm/syslog/mail.log
dekerp.root > : ls -al /var/adm/syslog/mail.log
-r--r--r-- 1 root sys 0 Sep 8 13:11 /var/adm/syslog/mail.log
dekerp.root > : /sbin/init.d/sendmail start
/etc/mail/aliases: 8 aliases, longest 32 bytes, 128 bytes total
sendmail
dekerp.root > : tail -f /var/adm/syslog/mail.log


But even when I sent a mail
mailx ......
While the recipent got the mail, the log registered nothing.

But thanks for your help so far. As you can see some of the permissions were wrong
Geoff Wild
Honored Contributor

Re: mailx/sendmail has stopped logging

How did you truncate the log in the first place?

> /var/adm/syslog/mail.log

or did you delete, then touch it?


Try restarting syslogd:

kill -HUP `cat /var/run/syslog.pid`

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Raj D.
Honored Contributor

Re: mailx/sendmail has stopped logging

Hi Peter ,

Hope you have not deleted the mail.log file.

Check the file and try restarting syslogd:

# ls -l /var/adm/syslog/mail.log (check the file)

# ps -ef | grep syslogd [ Note the PID]
# kill -HUP PID

Then verify the log file...

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Dek_1
Advisor

Re: mailx/sendmail has stopped logging

Bingo
Thanks to Geoff for the final piece, and thanks to Muthukumar for the structual bits. It is all working now - so I can put that one down to experience.
Next time I truncate the log I will do it properly ;-)
Dek_1
Advisor

Re: mailx/sendmail has stopped logging

Thanks all