initscripts: Check for logrotate in dmesg.sh

Autodetect previously hardcoded logrotate location because it can be
installed in multiple places like /usr/bin/logrotate which is very
common besides /usr/sbin

(From OE-Core rev: 277a5975d43125623b5a51ddcb48f9ee2474d0fc)

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ovidiu Vancea 2016-08-12 18:04:12 +03:00 committed by Richard Purdie
parent 4945cdfd76
commit 0d445840c4
1 changed files with 2 additions and 2 deletions

4
meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh Normal file → Executable file
View File

@ -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