-
Notifications
You must be signed in to change notification settings - Fork 212
Description
All of the script commands which are executed through the function runScript never get the path to the files that were rotated passed to it. The problem is that with "-c" /bin/sh only interprets the argument directly after the "-c", not the rest of the arguments. A test:
/bin/sh -c /bin/echo logrotate_script /var/log/messages
On every system I could find to test produces an empty line. It does not echo "logrotate_script /var/log/messages" to standard out.
The problem seems to be the execl in runScripts. Attached is a trivial test program that demonstrates the problem.
I'm not sure that simply fixing the problem is the right thing to do, because I'm betting that all of the existing scripts out there, most of which are used to re-load or re-start processes after the log files are rotated will break when they all of a sudden have a bunch of additional arguments on the command line.
It would seem that either the documentation needs to be updated to document exactly what logroate does, or add some feature to allow the arguments to be passed on certain scripts. Or an over-the-top suggestion would be to expand a string in the scripts to be the log paths?