SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux > SageTV for unRAID/Docker
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV for unRAID/Docker Discussion related to SageTV for unRAID/Docker. Questions, issues, problems, suggestions, etc. relating to SageTV for unRAID/Docker should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-10-2016, 03:23 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Updated Docker Container

I just updated the Docker container. If you are running unRAID, you can probably force the update, if you want.... I only recommend updating IF you are interesting in LIRC or have issues mounting.... Just in case this new image introduces some issues. (Note sagetv updates are independent of the docker image).

The primary updates with this new image include....

1. It now uses the Phusion base image (still Ubuntu 16.04) and the sagetv startup has been refactored into multiple startup scripts which makes it easier to add new scripts and makes it easier to maintain the existing ones.

2. LIRC has been added. (See the OPT_LIRC section in the Options doc)

3. More permissions have been extended... ie, (mount, lirc, irsend, etc should now run as root as well)
Reply With Quote
  #2  
Old 10-10-2016, 06:15 PM
mibsy mibsy is offline
Sage User
 
Join Date: Jul 2007
Posts: 57
Stuckless, I did the upgrade and the OPT_LIRC didn't show up on the docker configuration. It did upgrade the docker.

I put in the variable manually, copied the files to the right location (I think) and it still didn't work. No files copied, no LIRC startup. I quite likely made a mistake or two. When you say SAGE_HOME, is that equal to /opt/sagetv/ for the lirc.d directory? I see some of the lirc files like lircd, mode2, and lircrcd, so the upgrade seems to have taken place.

Quote:
Originally Posted by stuckless View Post
I just updated the Docker container. If you are running unRAID, you can probably force the update, if you want.... I only recommend updating IF you are interesting in LIRC or have issues mounting.... Just in case this new image introduces some issues. (Note sagetv updates are independent of the docker image).

The primary updates with this new image include....

1. It now uses the Phusion base image (still Ubuntu 16.04) and the sagetv startup has been refactored into multiple startup scripts which makes it easier to add new scripts and makes it easier to maintain the existing ones.

2. LIRC has been added. (See the OPT_LIRC section in the Options doc)

3. More permissions have been extended... ie, (mount, lirc, irsend, etc should now run as root as well)

Last edited by mibsy; 10-10-2016 at 06:20 PM.
Reply With Quote
  #3  
Old 10-10-2016, 06:41 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by mibsy View Post
Stuckless, I did the upgrade and the OPT_LIRC didn't show up on the docker configuration. It did upgrade the docker.

I put in the variable manually, copied the files to the right location (I think) and it still didn't work. No files copied, no LIRC startup. I quite likely made a mistake or two. When you say SAGE_HOME, is that equal to /opt/sagetv/ for the lirc.d directory? I see some of the lirc files like lircd, mode2, and lircrcd, so the upgrade seems to have taken place.
SAGE_HOME is /opt/sagetv/server

so the lirc files should be in /opt/sagetv/server/lirc.d/
Reply With Quote
  #4  
Old 10-10-2016, 06:43 PM
mibsy mibsy is offline
Sage User
 
Join Date: Jul 2007
Posts: 57
Dang, that's what I tried first... Will move them and try again.

Any idea why the variable is not showing up on the docker configuration page?


Quote:
Originally Posted by stuckless View Post
SAGE_HOME is /opt/sagetv/server

so the lirc files should be in /opt/sagetv/server/lirc.d/
Reply With Quote
  #5  
Old 10-10-2016, 06:44 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by mibsy View Post
Dang, that's what I tried first... Will move them and try again.

Any idea why the variable is not showing up on the docker configuration page?
sadly, unraid templates do no upgrade So, either you have to remove it completely and then re-add it, or just do as you did, and just manually add the OPT_LIRC environment variable.
Reply With Quote
  #6  
Old 10-10-2016, 06:46 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
This is the lirc initialization script... for reference..

https://github.com/stuckless/sagetv-...init.d/40-lirc
Reply With Quote
  #7  
Old 10-10-2016, 06:49 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
btw... in unRAID after you start the container, you can view the logs (right click and view log). You should see this script output in there... ie, the cp command use -v so you should it copying the files, etc.
Reply With Quote
  #8  
Old 10-11-2016, 01:58 AM
starfire starfire is offline
Sage Expert
 
Join Date: Mar 2008
Location: England, UK
Posts: 505
Quote:
Originally Posted by stuckless View Post
(Note sagetv updates are independent of the docker image).
Can you just clarify that, I thought we would pick up new SageTV builds as part of the container being updated ?
__________________
2 X HD300, 2 X HD100 & KVM unRAID Host with SageTV Docker using TBS 6285 Quad DVB-T2 & TBS 6984 Quad DVB-S2 Tuners
Reply With Quote
  #9  
Old 10-11-2016, 02:57 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by starfire View Post
Can you just clarify that, I thought we would pick up new SageTV builds as part of the container being updated ?
Unless you have told the docker container not to (using the VERSION variable), it will always check for and update to the newest build of sagetv on each start of the container. The only reason to update the container itself is to get new container capabilities (like the aforementioned VERSION variable added a couple weeks ago, or the LIRC capabilities added yesterday). So under normal use, if you want to upgrade sagetv, all you have to do is restart the SageTV Docker Container, and you'll be on the newest sage release.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #10  
Old 10-11-2016, 03:33 AM
starfire starfire is offline
Sage Expert
 
Join Date: Mar 2008
Location: England, UK
Posts: 505
Yes, that's what I thought.

I just thought stuckless post implied that SageTV would not be upgraded, when it is, on every restart unless you use the version system.
__________________
2 X HD300, 2 X HD100 & KVM unRAID Host with SageTV Docker using TBS 6285 Quad DVB-T2 & TBS 6984 Quad DVB-S2 Tuners
Reply With Quote
  #11  
Old 10-11-2016, 05:50 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Stuckless,
I started the research phase on testing/implementing USB-UIRT in the docker post-these-changes, and it looks like step one will be to get a udev rule into the docker to map the usb-uirt to a symlink, since the sage USB-UIRT implementation doesn't currently handle detecting the device, simply using it assuming it is at /dev/remoted. I'm not entirely sure where the best place to do this would be in the docker (whether baked into an image, or in a script, etc), but all it should take is the following file:

/etc/udev/rules.d/99-usb-serial.rules
Code:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="f850", SYMLINK+="remoted"
EDIT: Just realized this may be tricky, as I don't believe udev rules are processed inside the containers, so this would have to exist on the unRAID host. This means the only way I can see to make this symlink is to script it in the container, which means it'd only work if the USB-UIRT is inserted when the container starts, and plug/unplug could break it. yuck.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room

Last edited by Fuzzy; 10-11-2016 at 06:01 AM.
Reply With Quote
  #12  
Old 10-11-2016, 07:43 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Fuzzy View Post
Stuckless,
I started the research phase on testing/implementing USB-UIRT in the docker post-these-changes, and it looks like step one will be to get a udev rule into the docker to map the usb-uirt to a symlink, since the sage USB-UIRT implementation doesn't currently handle detecting the device, simply using it assuming it is at /dev/remoted. I'm not entirely sure where the best place to do this would be in the docker (whether baked into an image, or in a script, etc), but all it should take is the following file:

/etc/udev/rules.d/99-usb-serial.rules
Code:
SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="f850", SYMLINK+="remoted"
EDIT: Just realized this may be tricky, as I don't believe udev rules are processed inside the containers, so this would have to exist on the unRAID host. This means the only way I can see to make this symlink is to script it in the container, which means it'd only work if the USB-UIRT is inserted when the container starts, and plug/unplug could break it. yuck.
It would probably be fairly easy to add that as an unRAID plugin, or ask the unRAID DVB team to add this udev rule (they might already have it there). Which unRAID kernel are you using... I run the unRAID DVB (LibreElec) kernal.

I see this post talking about udev... We might be able to use the monitor/tigger approach to automatically setup the device node when usb-uirt is attached/detached.

http://stackoverflow.com/questions/3...cker-container
Reply With Quote
  #13  
Old 10-11-2016, 07:45 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Without the udev rule... does it get autodetected as /dev/ttyUSB0 ? (ie, is it just a matter that we want to simlink /dev/remoted to /dev/ttyUSB0?)
Reply With Quote
  #14  
Old 10-11-2016, 07:59 AM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,657
Quote:
Originally Posted by stuckless View Post
Without the udev rule... does it get autodetected as /dev/ttyUSB0 ? (ie, is it just a matter that we want to simlink /dev/remoted to /dev/ttyUSB0?)
That might be one way to handle this. I'd probably leave /dev/ttyUSB0 configurable since sometimes people have more than one USB to serial adapter plugged in.

Yeah, it could easily be done using a volume mapping mapping /dev/ttyUSB0 on the host to /dev/remoted on the container... or, we could scan the usb devices using a script and create the symlink on the container start.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG

Last edited by stuckless; 10-11-2016 at 08:04 AM.
Reply With Quote
  #15  
Old 10-11-2016, 08:15 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by stuckless View Post
It would probably be fairly easy to add that as an unRAID plugin, or ask the unRAID DVB team to add this udev rule (they might already have it there). Which unRAID kernel are you using... I run the unRAID DVB (LibreElec) kernal.

I see this post talking about udev... We might be able to use the monitor/tigger approach to automatically setup the device node when usb-uirt is attached/detached.

http://stackoverflow.com/questions/3...cker-container
I'll be installing the librelec kernal to do this work - I don't currently use any capture devices (my HD-PVR is tied up in another project right now), so I'm just on the default kernal right now. After I get that in there, i'll have to see what it includes, if any.

Quote:
Originally Posted by stuckless View Post
Without the udev rule... does it get autodetected as /dev/ttyUSB0 ? (ie, is it just a matter that we want to simlink /dev/remoted to /dev/ttyUSB0?)
I think part of the issue is that it gets brought in as /dev/ttyUSB?, and it can potentially change every time it is plugged/unplugged. That's the purpose of the udev rule tied to the vender and device id's. I'm just giong off the various USB-UIRT on linux guides I've found out there, trying to handle the various possible problems.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #16  
Old 10-11-2016, 10:38 PM
mibsy mibsy is offline
Sage User
 
Join Date: Jul 2007
Posts: 57
So I deleted and added the template to get the revised templates. I wasn't aware that didn't update as well. I didn't have the version variable either...

So I found a few issues:

You are copying files to the /etc/lirc.d directory, but it doesn't exist in the container so the copy never happens unless you manually create the directory and reboot

Even when you create the directory, lirc won't start since the /etc/init.d/lirc startup script looks for /etc/lirc by default

I'd suggest that to solve both, you copy the files to the default /etc/lirc directory. The startup script could be adjusted and the /etc/lirc.d directory manually created if there is a reason for moving it.

When lirc starts, in many configurations it creates a socket under /var/run/lirc/lircd1 (or 0) as specified in the hardware configuration file. Is it possible to create that directory to use the socket?

I see that you are adjusting the permissions for /dev/lirc[0-4], but for USB-UIRT, it uses the serial to USB devices ttyUSB[0-X]. Since you setuid on irsend, I suspect it should fix the issue with gentuner. Should the permissions on ttyUSB be adjusted?

Thanks for putting LIRC in the docker.

If anyone wants the hardware.conf and lirc.conf I have working for my USB-UIRT, I can post them. The lircd.conf is really specific to what you are trying to control (a DISH VIP 211 receiver in my case), but the hardware.conf is more tied to the USB-UIRT and a few other configuration items.


Quote:
Originally Posted by stuckless View Post
This is the lirc initialization script... for reference..

https://github.com/stuckless/sagetv-...init.d/40-lirc
Reply With Quote
  #17  
Old 10-12-2016, 05:47 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by mibsy View Post
So I deleted and added the template to get the revised templates. I wasn't aware that didn't update as well. I didn't have the version variable either...

So I found a few issues:

You are copying files to the /etc/lirc.d directory, but it doesn't exist in the container so the copy never happens unless you manually create the directory and reboot

Even when you create the directory, lirc won't start since the /etc/init.d/lirc startup script looks for /etc/lirc by default

I'd suggest that to solve both, you copy the files to the default /etc/lirc directory. The startup script could be adjusted and the /etc/lirc.d directory manually created if there is a reason for moving it.

When lirc starts, in many configurations it creates a socket under /var/run/lirc/lircd1 (or 0) as specified in the hardware configuration file. Is it possible to create that directory to use the socket?

I see that you are adjusting the permissions for /dev/lirc[0-4], but for USB-UIRT, it uses the serial to USB devices ttyUSB[0-X]. Since you setuid on irsend, I suspect it should fix the issue with gentuner. Should the permissions on ttyUSB be adjusted?

Thanks for putting LIRC in the docker.

If anyone wants the hardware.conf and lirc.conf I have working for my USB-UIRT, I can post them. The lircd.conf is really specific to what you are trying to control (a DISH VIP 211 receiver in my case), but the hardware.conf is more tied to the USB-UIRT and a few other configuration items.
Thanks for testing and finding those issues... i could have sworn that in my setup it was the lirc.d/ directory... but I'll change the script to move to the lirc directory.

As for the permissions... I can set /dev/ttyUSB* to be root:sagetv as well... the irsend will work because of the suid bit, but, if other things that don't use the irsend command try to access them, then they should be owned by sagetv.

My wife is travelling, so I can probably do this work tonight
Reply With Quote
  #18  
Old 10-12-2016, 04:25 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Updated the image...

As per Fuzzy's suggestion, i'm making the chown/chmod command quieter...

I also fixed the lirc stuff (I hope).
Reply With Quote
  #19  
Old 10-12-2016, 04:41 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by stuckless View Post
As per Fuzzy's suggestion, i'm making the chown/chmod command quieter...
Ooohhh.. SOO much cleaner now.. thank!
Quote:
Originally Posted by stuckless View Post
I also fixed the lirc stuff (I hope).
Will try to check on this soon.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #20  
Old 10-12-2016, 04:52 PM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Quote:
Originally Posted by mibsy View Post
So I deleted and added the template to get the revised templates. I wasn't aware that didn't update as well. I didn't have the version variable either...

So I found a few issues:

You are copying files to the /etc/lirc.d directory, but it doesn't exist in the container so the copy never happens unless you manually create the directory and reboot

Even when you create the directory, lirc won't start since the /etc/init.d/lirc startup script looks for /etc/lirc by default

I'd suggest that to solve both, you copy the files to the default /etc/lirc directory. The startup script could be adjusted and the /etc/lirc.d directory manually created if there is a reason for moving it.

When lirc starts, in many configurations it creates a socket under /var/run/lirc/lircd1 (or 0) as specified in the hardware configuration file. Is it possible to create that directory to use the socket?

I see that you are adjusting the permissions for /dev/lirc[0-4], but for USB-UIRT, it uses the serial to USB devices ttyUSB[0-X]. Since you setuid on irsend, I suspect it should fix the issue with gentuner. Should the permissions on ttyUSB be adjusted?

Thanks for putting LIRC in the docker.

If anyone wants the hardware.conf and lirc.conf I have working for my USB-UIRT, I can post them. The lircd.conf is really specific to what you are trying to control (a DISH VIP 211 receiver in my case), but the hardware.conf is more tied to the USB-UIRT and a few other configuration items.
I'd love to see your config files (don't have dish, but would like to see a working setup for comparison).
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Docker Image for unRaid ChaOConnor SageTV Linux 73 05-28-2017 11:57 AM
SageTV Docker/unRAID now has a sub-forum stuckless SageTV for unRAID/Docker 0 10-10-2016 07:20 AM
Interactive Docker Container for building SageTV (Linux) stuckless SageTV Github Development 4 09-04-2016 03:14 PM
Docker container coppit SageTV Github Development 20 09-06-2015 06:26 PM
NASs? Docker? ThePaladinTech SageTV Github Development 10 08-16-2015 02:34 PM


All times are GMT -6. The time now is 12:35 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.