LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Trying to configure MythTV, serial to set top box, channel.bin permission denied... (https://www.linuxquestions.org/questions/linux-software-2/trying-to-configure-mythtv-serial-to-set-top-box-channel-bin-permission-denied-605247/)

Mysticle31 12-07-2007 02:26 PM

Trying to configure MythTV, serial to set top box, channel.bin permission denied...
 
I've been trying to configure MythTV. I'm excited in that this is the closest I have gotten to a working Linux install! It's been a nice crash course.


I'm running Kubuntu
I started having this problem after following the directions here:

https://help.ubuntu.com/community/My...hannel_Changer



steve@Desktop -$ channel 54
bash: /usr/local/bin/channel: Permission denied
steve@Desktop:~$ sudo channel 54
[sudo] password for steve:
sudo: channel: command not found
steve@Desktop:~$ cd /usr/local/bin
steve@Desktop:/usr/local/bin$ channel 54
bash: /usr/local/bin/channel: Permission denied
steve@Desktop:/usr/local/bin$ sudo channel 54
sudo: channel: command not found

Then I did this
steve@Desktop:/usr/local/bin$ sudo chmod +x /usr/local/bin/channel
steve@Desktop:/usr/local/bin$ channel

Did nothing but a blinking cursor, so I abborted with Ctrl+C

steve@Desktop:/usr/local/bin$ setserial /dev/ttys0
/dev/ttys0: Input/output error
steve@Desktop:/usr/local/bin$ channel 54
channel: /dev/ttyS0: Resource temporarily unavailable


I think I would much rather have access denied and help fixing that than resource temporarily unavailable What did I do! Someone help dig me out of my little hole. How do I make this work?

On a side note, I tried to skip this step and just see if my capture card would just play whatever channel my cable box is set to, and it wouldn't. So I have more problems to investigate after this one :P.
__________________

pljvaldez 12-07-2007 03:19 PM

Probably the reason why you can't run channel as a user is that you don't have permission to run the underlying hardware. The reason you probably can't run it with sudo is that it's probably not in your path. Try sudo echo $PATH. If it doesn't have /usr/local/bin listed, then as root (i.e. sudo) you can't just type "channel" because the shell is not looking in that directory. From the /usr/local/bin directory you can type sudo ./channel 54 (the "./" means in this directory) and it should work.

As to why you get "resource unavailable" I can't tell you. My Myth box just gets expanded basic from the wall, I haven't messed with controlling a set top box.

Mysticle31 12-09-2007 12:57 PM

Well, I reformatted and got rid of all the modifications I made. However, it's still not working.

I tried sudo echo $path and running it as sudo ./channel 54. Just to prove that I was in the same directory I did ls.


steve@Desktop:/usr/local/bin$ channel 54
bash: /usr/local/bin/channel: Permission denied
steve@Desktop:/usr/local/bin$ sudo channel 54
sudo: channel: command not found
steve@Desktop:/usr/local/bin$ sudo echo $path

steve@Desktop:/usr/local/bin$ sudo ./channel 54
sudo: ./channel: command not found
steve@Desktop:/usr/local/bin$ dir
channel
steve@Desktop:/usr/local/bin$ ls
channel
steve@Desktop:/usr/local/bin$

Mysticle31 12-09-2007 12:59 PM

Just for the fun of it I tried running channel without a channel number to see if I got different results.

Same thing.

steve@Desktop:/usr/local/bin$ channel
bash: /usr/local/bin/channel: Permission denied
steve@Desktop:/usr/local/bin$ ./channel
bash: ./channel: Permission denied
steve@Desktop:/usr/local/bin$ sudo ./channel
sudo: ./channel: command not found
steve@Desktop:/usr/local/bin$ sudo channel
sudo: channel: command not found

pljvaldez 12-10-2007 11:28 AM

What is the output of ls -l?

Mysticle31 12-13-2007 12:37 AM

steve@Desktop:~$ ls -l
total 0
drwx------ 2 steve steve 43 2007-12-12 21:04 Desktop
lrwxrwxrwx 1 steve steve 26 2007-12-12 21:56 Documents -> /media/secondary/Documents
lrwxrwxrwx 1 steve steve 26 2007-12-12 00:48 Examples -> /usr/share/example-content
lrwxrwxrwx 1 steve steve 22 2007-12-12 21:56 Music -> /media/secondary/Music
lrwxrwxrwx 1 steve steve 25 2007-12-12 21:56 Pictures -> /media/secondary/Pictures
lrwxrwxrwx 1 steve steve 23 2007-12-12 21:56 Videos -> /media/secondary/Videos


I created soft links to my data drive mounted /media/secondary.

pljvaldez 12-13-2007 11:15 AM

Sorry, I meant of the /usr/local/bin directory. You can do ls -l /usr/local/bin |grep channel.

Mysticle31 12-13-2007 06:59 PM

I thought that was odd you would ask me for that. I was thinking "hmm, I wonder if he means in the usr folder" Then I thought "nah, better do as told" :P Sorry.

I've reformatted a couple of times and have the same problem. Although the location and name of the file have changed. It depends on which set of configuration instructions I was following at the time.


steve@Desktop:~$ ls -l /usr/bin |grep change-channel
-rw-r--r-- 1 root mythtv 2741 2007-12-12 20:52 change-channel.py
steve@Desktop:~$

Just so you know I'm not dreaming, here is a series of commands I did to try and change the channel.

steve@Desktop:~$ change-channel.py 34
bash: /usr/bin/change-channel.py: Permission denied
steve@Desktop:~$ sudo change-channel.py 34
sudo: change-channel.py: command not found
steve@Desktop:~$ sudo /usr/bin/change-channel.py 34
sudo: /usr/bin/change-channel.py: command not found
steve@Desktop:~$ cd /usr/bin
steve@Desktop:/usr/bin$ ls *.py
automatix.py change-channel.py
steve@Desktop:/usr/bin$ change-channel.py 45
bash: /usr/bin/change-channel.py: Permission denied
steve@Desktop:/usr/bin$ sudo change-channel.py 45
sudo: change-channel.py: command not found
steve@Desktop:/usr/bin$ sudo ./change-channel.py 45
sudo: ./change-channel.py: command not found
steve@Desktop:/usr/bin$


If I can't do it, how is MythTV supposed to do it :P (it doesn't, I tried)

I find it interesting I can't run this as sudo. I thought sudo could do everything.

pljvaldez 12-13-2007 07:12 PM

Well, when I look at the output of the ls command, the execute bit isn't set. You might try sudo chmod a+x /usr/bin/change-channel and then run it again.

I haven't used python scripting (just bash scripting), but I assume the script's first line identifies itself as python so that the shell knows what to do with it.

Mysticle31 12-14-2007 12:54 AM

Yes it does. The first line is
"#!/usr/bin/python"

Why is that important? Is that what happens when you make a script executable? I see poeple say "make the script executable" but I don't know how to do that. How do I do that?

And thank you, thank you! It worked.

What did sudo chmod a+X /usr/bin/change-channel do?

Now I just have to go see if MythTV can use it!

pljvaldez 12-14-2007 11:52 AM

Sorry I didn't explain, the chmod a+x is how you make scripts/files executable. Well, actually, what it says is allow all (a) to have execute (+x) permission. Here's a couple of links on how to manage file permissions in linux.

http://en.wikipedia.org/wiki/Chmod
http://www.comptechdoc.org/os/linux/..._ugfilesp.html

If you go back up and look at your ls -l output, you can see the file permissions on the left "-rw-r--r--" which told me that the owner of the file had read-write permission, the file group had read-only permission, and everyone else had read-only permission. There was no execute bit set.


All times are GMT -5. The time now is 01:47 AM.