]> code.ossystems Code Review - openembedded-core.git/commitdiff
initscripts: Check for logrotate in dmesg.sh
authorOvidiu Vancea <ovidiu.vancea@ni.com>
Fri, 12 Aug 2016 15:04:12 +0000 (18:04 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 23 Aug 2016 16:44:05 +0000 (17:44 +0100)
Autodetect previously hardcoded logrotate location because it can be
installed in multiple places like /usr/bin/logrotate which is very
common besides /usr/sbin

Signed-off-by: Ovidiu Vancea <ovidiu.vancea@ni.com>
Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index a97b068..2b9eba6
@@ -8,8 +8,8 @@
 ### END INIT INFO
 
 if [ -f /var/log/dmesg ]; then
-       if [ -f /usr/sbin/logrotate ]; then
-               logrotate -f /etc/logrotate-dmesg.conf
+       if LOGPATH=$(which logrotate); then
+               $LOGPATH -f /etc/logrotate-dmesg.conf
        else
                mv -f /var/log/dmesg /var/log/dmesg.old
        fi