On Mon, 24 Sep 2012 10:55:10 +0200, Meike Stone wrote:

>> You simple place the log files in a different place where the user that
>> creates the files has write perms or accomodate the "/var/log/
>> your_application/*" directory permissions.
>>
> Yes I did this, and changed the rights to the user from the script:
> mkdir /var/log/script
> chown script.root /var/log/script
> chmod 640 /var/log/script
> 
> But logrotate "complains":
> ========================================= 
> ~# logrotate -d
> /etc/logrotate.d/script reading config file /etc/logrotate.d/script
> reading config info for /var/log/script/script.log
> 
> Handling 1 logs
>
> rotating pattern: /var/log/script/escript.log
>  10485760 bytes (99 rotations)
> empty log files are not rotated, old logs are removed considering log
> /var/log/script/script.log error: "/var/log/script" has insecure
> permissions. It must be owned and be writable by root only to avoid
> security problems. Set the "su" directive in the config file to tell
> logrotate which user/group should be used for rotation.

You can omit the warning because you obviously should know beforehand the 
security problems it can carry this operation, right? If so and you still 
want to go that path, proceed with the suggested step by adding the su 
variable at the logrotate config file.

> error: stat of /var/log/script/script.log failed: No such file or
> directory 
> ======================================================
>
> My goal was NOT create the logfile on my own (as root). so now, the only
> ("true") solution is to create the file  an change the rights to user
> "script".

(...)

The application you're running from the cron job has to create the log 
file "automatically", not you nor logrotate.

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/k3pru5$e50$1...@ger.gmane.org

Reply via email to