Operating System - HP-UX
1751976 Members
4598 Online
108784 Solutions
New Discussion юеВ

Re: Automatically "recreate" mail.log on reboot ?

 
SOLVED
Go to solution
Steven E. Protter
Exalted Contributor

Re: Automatically "recreate" mail.log on reboot ?

here is how i do it in the /sbin/init.d/sendmail startup script

/usr/bin/mv /var/adm/syslog/mail.log /tmp
/usr/bin/touch /var/adm/syslog/mail.log
/usr/bin/chmod 000 /var/adm/syslog/mail.log
/usr/bin/chmod a+r /var/adm/syslog/mail.log

I don't have access to the box, so this is a paraphrase.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jeff Schussele
Honored Contributor

Re: Automatically "recreate" mail.log on reboot ?

Sri makes a good point - as always....
syslogd start *before* (220 vs 540) than sendmail.
So it's probably gotta be a diff startup OR or sendmail bounce to make sure.

Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Geoff Wild
Honored Contributor

Re: Automatically "recreate" mail.log on reboot ?

Another alternative is to use something like logrotate:

Logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.

http://hpux.ee.ualberta.ca/hppd/hpux/Sysadmin/logrotate-2.5/

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.