This is untested but in /etc/cron.daily/logrotate change
/usr/sbin/logrotate /etc/logrotate.conf
to
TMPDIR=/var/tmp /usr/sbin/logrotate /etc/logrotate.conf
Should be all that is needed.
This line of code uses the TMPDIR value is in the runScript function
logrotate.c: snprintf(buf, sizeof(buf), "%s/logrotate.XXXXXX",
getenv("TMPDIR") ?: "/tmp");
John.
scott.list wrote:
> Hi all:
>
> logrotate is broken on my stock 4.1 install. After hunting and
> hunting I found there is a bug filed with Redhat on the issue.
> logrotate fails becasue my /tmp partition is mounted noexec. I
> understand it is that way for security reasons. The box in question
> is on a dedicated hosting site and that's the way it was handed off to
> me, built.
>
> Some said setting TMPDIR=/var/tmp;export TMPDIR would fix it. My
> /var/tmp is not on a noexec partition so I'm good there. Setting
> TMPDIR however does not fix it. I've tried adding the variable in
> /etc/cron.daily/logrotate, I tried it after a prerotate inside the
> actual syslog logrotate file, netiher worked. I finally had to
> remount /tmp and remove the noexec. I have the stock 4.1 logrotate, I
> understand some later versions *may* address the TMPDIR but I hate to
> start straying off the stock/stable path since the main reason I am
> running Centos4.1 is to have a stable server platform that is
> maintained via yum update alone.
>
> Has anyone fixed this on 4.1? Or have a workaround besides setting
> /tmp to exec or changing logrotate versions?
>
> Thanks,
> Soctt
>
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>
>
--
John Newbigin
Computer Systems Officer
Faculty of Information and Communication Technologies
Swinburne University of Technology
Melbourne, Australia
http://www.ict.swin.edu.au/staff/jnewbigin