[mythtv-users] Mythbuntu's kill/restart irexec command kills but no longer restarts until pressed again
Joey Morris
rjmorris.list at zoho.com
Sun Mar 17 21:54:35 UTC 2013
Alex Tomlins <alex at tomlins.org.uk> wrote on Sun, Mar 17, 2013 at 06:28:18PM +0000:
> On 17/03/13 16:15, Ian Evans wrote:
> >I think that's the first time my subject pretty much summed up my
> >whole issue. :-)
> >
> >Mythbuntu's kill/restart irexec command kills but no longer restarts
> >until pressed again.
> >
> >That is, the power/clear combo that kills mythfrontend and restarts
> >it, now just kills it. If I hit the combo again, it finally restarts.
> >
> >The command hasn't changed. Any idea why it would take two usages now
> >instead of one?
> >
> >Here's the command that's sent:
> >
> >(kill $(pgrep mythfrontend) || true) && mythfrontend --service &
> >
> It could well be a race condition...
>
> My guess is that on the first press, it sends the kill signal to
> mythfrontend, but then when it tries to start it again, the old
> instance hasn't finished exiting causing the new instance to fail to
> start (ports already in use etc...). On the second call, it will
> start successfully because by then the old instance has exited.
>
> You could test this by adding a sleep in between the 2 commands.
I run mythfrontend without the --service option on my mythbuntu
installs. As a result, the wrapper script starts mythfrontend.real and
then exits, and I don't get the auto-restart feature. I kill
mythfrontend.real using the command "killall mythfrontend.real" via
irexec. I always have to execute that twice to actually kill
mythfrontend.real. Even though we're starting and stopping
mythfrontend differently, I'd guess the behavior we're seeing is
related.
More information about the mythtv-users
mailing list