Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Why is this custom key command not working in Mythbuntu?

  1. #1
    Join Date
    Oct 2005
    Location
    Tokyo, Japan
    Beans
    102
    Distro
    Ubuntu 12.04 Precise Pangolin

    Why is this custom key command not working in Mythbuntu?

    I want to set up my MythTV interface so that when I press f12, it executes a script called "powerbutton.sh" which toggles the monitor on and off.

    I followed the instructions here for connecting the key to my script. However, despite following the instructions to the letter, when I press f12, my script is not executed, and I can't understand why. I am confident the script itself is fine because I have been using it for years, and when I run it from the command line, it works.

    I tried running mythfrontend from the command line, but there was nothing at the command prompt output related to pressing f12 that I could see.

    What else do I need to do so that my script will execute when I press f12?

    Here are the settings in my Mythbuntu interface:



    Desktop: Ubuntu 12.04 Gnome Classic, Intel i5, 4GB RAM, Nvidia GeForce 9600, dual monitor
    Laptop: Ubuntu 12.04 Gnome Classic (no effects), Panasonic Let's Note CF-Y2 laptop, 1GB RAM
    Media Server: Mythbuntu 12.04, Intel Q4, 4GB RAM

  2. #2
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: Why is this custom key command not working in Mythbuntu?

    Quote Originally Posted by Dave M G View Post
    I want to set up my MythTV interface so that when I press f12, it executes a script called "powerbutton.sh" which toggles the monitor on and off.

    I followed the instructions here for connecting the key to my script. However, despite following the instructions to the letter, when I press f12, my script is not executed, and I can't understand why. I am confident the script itself is fine because I have been using it for years, and when I run it from the command line, it works.

    I tried running mythfrontend from the command line, but there was nothing at the command prompt output related to pressing f12 that I could see.

    What else do I need to do so that my script will execute when I press f12?

    Here are the settings in my Mythbuntu interface:
    shouldn't the entry start /bin/sh not sh?
    Last edited by nickrout; July 17th, 2012 at 05:33 AM.

  3. #3
    Join Date
    Feb 2009
    Beans
    Hidden!

    Re: Why is this custom key command not working in Mythbuntu?

    Who owns the powerbutton.sh file and who is running your mythtv

    ls -al /path/to/powerbutton.sh

    and

    ps -aux | grep myth

    sounds like a permission issue

  4. #4
    Join Date
    Oct 2005
    Location
    Tokyo, Japan
    Beans
    102
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why is this custom key command not working in Mythbuntu?

    Thank you for the replies.

    shouldn't the entry start /bin/sh not sh?
    I tried /bin/sh but it does not seem to change anything.

    As for permissions and ownership, it looks like powerbutton.sh is owned by the user "mythbuntu" and has fully open permissions (777), and is executable:

    Code:
    -rwxrwxrwx  1 mythbuntu mythbuntu   180 Nov 22  2011 powerbutton.sh
    If I'm reading the output correctly, the MythTV back end seems to be run by a user called "mythtv", and the front end by a user with the number 1000(?):

    Code:
    $ ps -aux | grep myth
    Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
    avahi     1126  0.0  0.0   3568  1536 ?        S    Jul08   0:02 avahi-daemon: running [mythbuntu.local]
    mythtv    1863  0.0  0.8 323960 36096 ?        Sl   Jul08   3:38 /usr/bin/mythbackend --syslog local7 --user mythtv
    1000      2278  0.0  0.0   4060   204 ?        Ss   Jul08   0:01 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/share/mythbuntu/session.sh
    1000      2281  0.0  0.0   3920   740 ?        S    Jul08   0:00 /usr/bin/dbus-launch --exit-with-session /usr/share/mythbuntu/session.sh
    1000      2336  0.0  0.0   2216   592 ?        S    Jul08   0:00 /bin/sh /usr/bin/mythfrontend --service
    root      8365  0.0  0.0  10104  3420 ?        Ss   17:40   0:00 sshd: mythbuntu [priv]
    1000      8548  0.1  0.0  10252  1772 ?        S    17:40   0:00 sshd: mythbuntu@notty
    1000      8624  0.0  0.0   4132   836 pts/3    S+   17:41   0:00 grep --color=auto myth
    1000     12749  1.7  6.9 618604 288348 ?       Sl   Jul11 148:53 /usr/bin/mythfrontend.real --syslog local7
    root     19353  0.0  0.0  10104  3420 ?        Ss   Jul14   0:00 sshd: mythbuntu [priv]
    1000     19491  0.0  0.0  11888  3376 ?        S    Jul14   0:07 sshd: mythbuntu@notty
    root     19493  0.0  0.0  10104  3420 ?        Ss   Jul14   0:00 sshd: mythbuntu [priv]
    1000     19631  0.0  0.0  11216  2780 ?        S    Jul14   1:33 sshd: mythbuntu@notty
    1000     19786  0.0  0.0   6288  2200 ?        S    Jul14   0:00 
    root     22117  0.0  0.0  10104  3496 ?        Ss   Jul16   0:00 sshd: mythbuntu [priv]
    1000     22255  0.0  0.0  10104  1864 ?        S    Jul16   0:00 sshd: mythbuntu@pts/2
    Does any of that shed light on why the command might not be running?
    Desktop: Ubuntu 12.04 Gnome Classic, Intel i5, 4GB RAM, Nvidia GeForce 9600, dual monitor
    Laptop: Ubuntu 12.04 Gnome Classic (no effects), Panasonic Let's Note CF-Y2 laptop, 1GB RAM
    Media Server: Mythbuntu 12.04, Intel Q4, 4GB RAM

  5. #5
    Join Date
    Mar 2007
    Location
    Christchurch, NZ
    Beans
    3,239

    Re: Why is this custom key command not working in Mythbuntu?

    mythfrontend should run as the user you set up during install. Looks like you have somehow not given that user a proper name, or tried to delete it?

    Code:
    grep 1000 /etc/passwd

  6. #6
    Join Date
    Oct 2005
    Location
    Tokyo, Japan
    Beans
    102
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why is this custom key command not working in Mythbuntu?

    Turns out, user 1000 = user mythbuntu. Explanation here.

    So I guess I'm still looking for a reason why this command is not executing.
    Last edited by Dave M G; July 18th, 2012 at 11:20 AM.
    Desktop: Ubuntu 12.04 Gnome Classic, Intel i5, 4GB RAM, Nvidia GeForce 9600, dual monitor
    Laptop: Ubuntu 12.04 Gnome Classic (no effects), Panasonic Let's Note CF-Y2 laptop, 1GB RAM
    Media Server: Mythbuntu 12.04, Intel Q4, 4GB RAM

  7. #7
    Join Date
    Feb 2009
    Beans
    Hidden!

    Re: Why is this custom key command not working in Mythbuntu?

    When I setup my system, I added my username to the mythtv group as this avoid permission issues I was seeing.

  8. #8
    Join Date
    Oct 2005
    Location
    Tokyo, Japan
    Beans
    102
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why is this custom key command not working in Mythbuntu?

    My user is already added to the mythtv group as far as I can tell.

    Code:
    $ groups mythbuntu
    mythbuntu : mythbuntu adm dialout cdrom video plugdev fuse admin mythtv sambashare lpadmin
    Desktop: Ubuntu 12.04 Gnome Classic, Intel i5, 4GB RAM, Nvidia GeForce 9600, dual monitor
    Laptop: Ubuntu 12.04 Gnome Classic (no effects), Panasonic Let's Note CF-Y2 laptop, 1GB RAM
    Media Server: Mythbuntu 12.04, Intel Q4, 4GB RAM

  9. #9
    Join Date
    Feb 2009
    Beans
    Hidden!

    Re: Why is this custom key command not working in Mythbuntu?

    I would try two things. First of all, I'd try a simple command instead of the script. Something like

    touch /path/to/file

    with and without the quotes.

    I'd also use phpmyadmin and make sure it's actually assigning the f12 key to the script.

  10. #10
    Join Date
    Oct 2005
    Location
    Tokyo, Japan
    Beans
    102
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Why is this custom key command not working in Mythbuntu?

    The keybinding seems to be in my database:

    Code:
    context	action		description			keylist		hostname
    Global	SYSEVENT01	Trigger System Key Event #1	F12		mythbuntu
    I tried the touch command. I verified it worked directly from the command line, but it does not work from within MythTV with the keybinding.

    So it would seem the problem is that the keybinding is not executing the command.
    Desktop: Ubuntu 12.04 Gnome Classic, Intel i5, 4GB RAM, Nvidia GeForce 9600, dual monitor
    Laptop: Ubuntu 12.04 Gnome Classic (no effects), Panasonic Let's Note CF-Y2 laptop, 1GB RAM
    Media Server: Mythbuntu 12.04, Intel Q4, 4GB RAM

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •