#!/usr/bin/perl -w

my ($kernelrotate, $force_kernelrotate, $logrotate, $force_logrotate, $ziplog);
                                                                                                                             
$kernelrotate = `ps -eo "%y %p %a" | grep -v grep | grep "/usr/sbin/logrotate /etc/kernelrotate.conf" | tr -s " " | cut -d " " -f2`;
chomp ($kernelrotate);
                                                                                                                             
$force_kernelrotate = `ps -eo "%y %p %a" | grep -v grep | grep "/usr/sbin/logrotate -f /etc/kernelrotate.conf" | tr -s " " | cut -d " " -f2`;
chomp ($force_kernelrotate);
                                                                                                                             
$logrotate = `ps -eo "%y %p %a" | grep -v grep | grep "/usr/sbin/logrotate /etc/logrotate.conf" | tr -s " " | cut -d " " -f2`;
chomp ($logrotate);
                                                                                                                             
$force_logrotate = `ps -eo "%y %p %a" | grep -v grep | grep "/usr/sbin/logrotate -f /etc/logrotate.conf" | tr -s " " | cut -d " " -f2`;
chomp ($force_logrotate);
                                                                                                                             
$ziplog = `ps -eo "%y %p %a" | grep -v grep | grep "/etc/multiconf/scripts/ziplogfiles" | tr -s " " | cut -d " " -f2`;
chomp ($ziplog);
                                                                                                                             
if ((($kernelrotate eq "") || ($kernelrotate eq " ")) && (($force_kernelrotate eq "") || ($force_kernelrotate eq " ")) && (($logrotate eq "") || ($logrotate eq " ")) && (($force_logrotate eq "") || ($force_logrotate eq " ")) && (($ziplog eq "") || ($ziplog eq " ")))
{
        `/usr/sbin/logrotate /etc/kernelrotate.conf`;
}
