The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

logrotate errors and TMP noexec

Discussion in 'General Discussion' started by DavidR, Feb 6, 2005.

  1. DavidR

    DavidR Well-Known Member

    Joined:
    Feb 25, 2003
    Messages:
    177
    Likes Received:
    0
    Trophy Points:
    16
    This appears to be an obscure issue, at least according to my searches. I hope someone has run across it before. My host recently changed my tmp directory so that it has "noexec" status. There was some issue before about doing this because it is a Virtuozzo VPS. On the first logrotate attempt after this change, I received the following errors:

    I have logrotate set to compress the old log files and retain them in the same directory. After this last rotate, it appears that the old logs were copied but not compressed. Other than that, I can't find anything out of order. The postrotate section of the individual logrotate configs, according to man logrotate, allows commands to be run and all of them contain a command which appears to stop writing to the log file while it creates a new one.

    So, I'm thinking that this somehow tries to execute commands or run a script in the TMP directory? But if so, certainly someone would have run into this before and I can't find much at all even close in my searches. The following is about as close as I have gotten:

    http://www.fedoraforum.org/forum/archive/index.php/t-22359.html

    That thread suggests there might be a way to specify an alternate TMP directory for postrotate functions to use, but it's just speculation and nothing in the logrotate docs supports it. Any help is appreciated.

    David
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That's certainly odd. I take it that it was all working before enabling nosuexec? Have you tried removing the setting to confirm the problem? If so, then you might have to ask Virtuozzo for their comments.
     
  3. marcadrian

    marcadrian Member

    Joined:
    Apr 7, 2005
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    fixy

    If your TMP is noexec then you simply have to:

    vi /etc/cron.daily/logrotate

    Edit the following:

    #!/bin/sh
    TMPDIR=/var/tmp
    export TMPDIR


    To test, run on the command line:
    TMPDIR=/var/tmp
    export TMPDIR
    /usr/bin/logrotate -vf /etc/logrotate.conf

    Works for me.
     
  4. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hi

    I tried the export trick but it doesnt seem to work.
    Any ideas ?

    I runnign trustix 2.2.

    Regards
    Andy
     
Loading...

Share This Page