Author: Dom Date: To: dmo-discussion Subject: Re: logrotate errors for mythlogserver with frontend only
On 25/04/13 13:48, Dom wrote: > On 25/04/13 13:29, Christian Marillat wrote:
>> Dom<toyer@???> writes:
>>
>> [...]
>>
>>> It looks like mythlogserver is shutting itself down when I exit the
>>> frontend, rather than aborting.
>>
>> After a google search the daemon stop if no mythtv process are
>> running. Strange feature...
>
> I suppose there is no reason to run the daemon if there are no mythtv
> processes active to log. I think it gets started when any processes are
> launched.
>
>> Then the best is to use pkill instead of killall to kill the
>> mythlogserver process. Normally pkill doesn't return an error if the
>> process isn't running. What do you think ?
>>
>> ,----
>> | /var/log/mythtv/*.log {
>> | daily
>> | rotate 7
>> | notifempty
>> | delaycompress
>> | sharedscripts
>> | compress
>> | postrotate
>> | pkill -HUP mythlogserver
>> | endscript
>> | su mythtv mythtv
>> | }
>> `----
>
> That sounds like a good idea to me. I've modified the logrotate script
> and report what it does tomorrow morning.
>
> Thanks :)
I've done some more testing on this. It seems that although pkill
doesn't issue an error message when the process isn't running, it does
return an exit code of 1 and logrotate doesn't like that.
I have solved this for now with a simple script that uses:
if [ $(pgrep -c mythlogserver) -gt 0 ]
then
/usr/bin/pkill -HUP mythlogserver
fi
Although I suspect this will not solve the problem of mythlogserver
running under a userid other than mythtv. That is not going to be a
major problem for me, as I rarely use the frontend at the time that
logrotate is running, and now I am aware of the situation I can avoid it.
--
Dom