Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

MythSystemEventHandler: Command '...' returned 1

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


mythtv-users at lists

Apr 19, 2012, 4:59 AM

Post #1 of 10 (585 views)
Permalink
MythSystemEventHandler: Command '...' returned 1

Hi all,

I'm trying to setup some commands in the System Event Handler, but
whatever I do, I always get "MythSystemEventHandler: Command '...'
returned 1".

What is the correct syntax for these commands? I even tried a simple one
like

touch /home/thomas/test

Background: Since there is no proper sleep function in MythTV in terms
of exiting the frontend in order to let the backend shutdown on idle, I
have a little script running in the background which kills the frontend
when the screensaver kicks in. Now since 0.25 gnome-screensaver is not
supported any more and it kicks in even when I watch something. So I
want to kill the screensaver on "LiveTV started" and "Playback started"
and start it again on "Playback stopped". (BTW: Why is there no "LiveTV
stopped" event?)

Or does anyone know how to do run a command like "killall mythfrontend"
with xscreenserver? Or even a better solution for my "poor man's sleep
function"? ;-)

Thanks
Thomas
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


mythtv-users at lists

Apr 19, 2012, 5:13 AM

Post #2 of 10 (551 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

Thomas Boehm wrote:
> I'm trying to setup some commands in the System Event Handler, but
> whatever I do, I always get "MythSystemEventHandler: Command '...'
> returned 1".
>
> What is the correct syntax for these commands? I even tried a simple one
> like
>
> touch /home/thomas/test

Oh boy, just found out that the commands are run as user mythtv and not
as the user who run's the frontend. Is this intended to be like this?
Especially since this is a "per frontend setting"...
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


raymond at wagnerrp

Apr 19, 2012, 5:46 AM

Post #3 of 10 (558 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

On 4/19/2012 08:13, Thomas Boehm wrote:
> Thomas Boehm wrote:
>> I'm trying to setup some commands in the System Event Handler, but
>> whatever I do, I always get "MythSystemEventHandler: Command '...'
>> returned 1".
>>
>> What is the correct syntax for these commands? I even tried a simple one
>> like
>>
>> touch /home/thomas/test
> Oh boy, just found out that the commands are run as user mythtv and not
> as the user who run's the frontend. Is this intended to be like this?
> Especially since this is a "per frontend setting"...

This is a per-host setting, and each connected host will run the
specified handler once. The master backend will always run the command
directly on whatever host it is running on. It will then pick one
application connected to it from each connected host to run the command
through.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


mythtv-users at lists

Apr 19, 2012, 9:25 AM

Post #4 of 10 (544 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

Raymond Wagner wrote:
> On 4/19/2012 08:13, Thomas Boehm wrote:
>> Oh boy, just found out that the commands are run as user mythtv and not
>> as the user who run's the frontend. Is this intended to be like this?
>> Especially since this is a "per frontend setting"...
>
> This is a per-host setting, and each connected host will run the
> specified handler once. The master backend will always run the command
> directly on whatever host it is running on. It will then pick one
> application connected to it from each connected host to run the command
> through.

This went right over my head, especially the last sentence ;-)

I understood that it is a per-host setting (that's what I meant by
per-frontend setting) and on a combined BE/FE the setting in
mythtv-setup is the same than in mythfrontend and the command will be
executed as the user who runs mythtv-backend (im my case mythtv).

On a standalone FE the command set in mythfrontend on that host will be
executed on that host AND as the user who runs mythfrontend, right?

Or does your last sentence mean that the command set on the backend will
be executed on every host with a connected frontend, even if there is no
command set in mythfrontend on that host? If so, as which user is it
executed, the user who runs mythfrontend?

It doesn't seem logical to me that a setting in a frontend on a BE/FE
behaves differently from a setting on a standalone FE. The settings on a
BE/FE should be separate in the frontend AND the backend. There were a
lot of other settings in 0.24 which you set in mythfrontend and which
effect the backend. I think it got better in 0.25. Sometimes you can't
find a certain setting because you're not sure whether it is in
mythtv-setup or mythfrontend...

Anyway, I solved my problem by switching to xscreensaver, but
understanding the whole "system event thingy" might be useful one day ;-)
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


raymond at wagnerrp

Apr 19, 2012, 9:39 AM

Post #5 of 10 (546 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

On 4/19/2012 12:25, Thomas Boehm wrote:
> Raymond Wagner wrote:
>> On 4/19/2012 08:13, Thomas Boehm wrote:
>>> Oh boy, just found out that the commands are run as user mythtv and not
>>> as the user who run's the frontend. Is this intended to be like this?
>>> Especially since this is a "per frontend setting"...
>> This is a per-host setting, and each connected host will run the
>> specified handler once. The master backend will always run the command
>> directly on whatever host it is running on. It will then pick one
>> application connected to it from each connected host to run the command
>> through.
> This went right over my head, especially the last sentence ;-)

The System Event... system... was built on top of MythTV's existing
event system. Typically, connections to the backend protocol are led by
the client. The client sends a query, the backend responds with a
result or error. When you announce yourself to the backend, you have
the option to reverse this. The backend sends events, and the client
does nothing, just handles them or ignores them.

System Events are a variation on this, and while normal events are sent
to any client that requests them, system events will only be sent to one
client per host. Since they trigger external commands, you only want
them running once per host. There is nothing controlling which client
will be issued the event, so the only guarantee you have in that regard
is that the master backend will be the one to handle it on its host.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


mythtv-users at lists

Apr 19, 2012, 11:01 AM

Post #6 of 10 (546 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

Raymond Wagner wrote:
> The System Event... system... was built on top of MythTV's existing
> event system. Typically, connections to the backend protocol are led by
> the client. The client sends a query, the backend responds with a
> result or error. When you announce yourself to the backend, you have
> the option to reverse this. The backend sends events, and the client
> does nothing, just handles them or ignores them.
>
> System Events are a variation on this, and while normal events are sent
> to any client that requests them, system events will only be sent to one
> client per host. Since they trigger external commands, you only want
> them running once per host. There is nothing controlling which client
> will be issued the event, so the only guarantee you have in that regard
> is that the master backend will be the one to handle it on its host.

Thanks for trying, but I'm non the wiser. After all this is mythtv-USERS ;-)

Assume the following:

host1 is running backend1 as user mythtv and frontend1 as user user1
command1 is set for system event "Playback started"

host2 is running frontend2 as user2
command2 is set for system event "Playback started"

Now there are two cases
-----------------------------------------
case1
What happens if user1 on host1 starts watching a recording?

Am I right when command1 gets executed as user mythtv on host1 and
nothing happens on host2?
-----------------------------------------
case2
What happens if user2 on host2 starts watching a recording?

Am I right when command2 gets executed as user2 on host2 and nothing
happens on host1?
------------------------------------------

At least that's what seems to happen when I try it out. So the question
still stands, why is command1 on host1 not executed as user1? Why can't
frontend1 talk to backend1 the same way frontend2 on host2 does? It's
not consistent. It shouldn't matter whether there is a backend running
on the same PC or somewhere else.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


martin.ginkel at googlemail

May 7, 2012, 12:59 AM

Post #7 of 10 (485 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

2012/4/19 Thomas Boehm <mythtv-users [at] lists>:
> supported any more and it kicks in even when I watch something. So I
> want to kill the screensaver on "LiveTV started" and "Playback started"
> and start it again on "Playback stopped". (BTW: Why is there no "LiveTV
> stopped" event?)
>
> Or does anyone know how to do run a command like "killall mythfrontend"
> with xscreenserver? Or even a better solution for my "poor man's sleep
> function"? ;-)

0.25 has now an idle timer in the FE, which is supposed to tell the BE, this
FE is disconnected and to reconnect after.
Have you tried that?

For me it worked once or twice, it also nicely displays a dimmed
screen and an idle message for the user.

Your approach has the disadvantage, that it only recognizes a few
functions of the FE,
not e.g. local video playback and music listening.

Currently I have some other problems with idle shutdown in the BE,
I can't tell yet, whether this is reliable.

Martin
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


brian at interlinx

May 7, 2012, 4:08 AM

Post #8 of 10 (480 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

On 12-05-07 03:59 AM, Martin Ginkel wrote:
>
> 0.25 has now an idle timer in the FE, which is supposed to tell the BE, this
> FE is disconnected and to reconnect after.
> Have you tried that?

Is this FE idle timer event hookable (i.e. like a system event -- but I
didn't see anything that looked applicable in the System Events config),
so that in addition to the above, one can have it do other things?

b.
Attachments: signature.asc (0.26 KB)


martin.ginkel at googlemail

May 7, 2012, 4:20 AM

Post #9 of 10 (497 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

2012/5/7 Brian J. Murrell <brian [at] interlinx>:
>> 0.25 has now an idle timer in the FE, which is supposed to tell the BE, this
>> FE is disconnected and to reconnect after.
>> Have you tried that?
>
> Is this FE idle timer event hookable (i.e. like a system event -- but I
> didn't see anything that looked applicable in the System Events config),

As far as I understand it the FE disconnects from the BE which would generate
a client disconnect event. But actually you wouldn't need this event.

If all running Frontends are idle then no client is connected anymore
to the backend
and the backends idle timer would wait for another 5 mins and then shut down
the backend computer.

Martin
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://www.mythtv.org/mailman/listinfo/mythtv-users


brian at interlinx

May 7, 2012, 4:22 AM

Post #10 of 10 (478 views)
Permalink
Re: MythSystemEventHandler: Command '...' returned 1 [In reply to]

On 12-05-07 07:20 AM, Martin Ginkel wrote:
>
> As far as I understand it the FE disconnects from the BE which would generate
> a client disconnect event. But actually you wouldn't need this event.

Not on the BE I wouldn't, no.

> If all running Frontends are idle then no client is connected anymore
> to the backend
> and the backends idle timer would wait for another 5 mins and then shut down
> the backend computer.

Which is all find and dandy for the BE. But I want the FEs to suspend
when they are idle too.

b.
Attachments: signature.asc (0.26 KB)

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.