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 04-12-2018, 08:37 PM
Carlton Bale Carlton Bale is offline
Sage Advanced User
 
Join Date: Sep 2010
Location: Indianapolis, Indiana, USA
Posts: 120
Docker Configuration via Synology Docker GUI

I installed the SageTV Java 10 Docker on my Synology NAS. Docker is configured via a GUI and I want to make sure I'm implementing the original instruction correctly. Feedback appreciated.

Original instructions I'm following:
Code:
docker run -d --name sagetv-server \
  -v /home/seans/unRAID/mnt/user/sagemedia:/var/media \
  -v /home/seans/unRAID/mnt/user/mediaext:/var/mediaext \
  -v /home/seans/unRAID/mnt/user/apps/sagetv3:/opt/sagetv \
  -v /home/seans/unRAID:/unraid \
  --net host \
  --env PUID=1000 \
  --env PGID=1000 \
  --env VIDEO_GUID=19 \
  --env OPT_GENTUNER=Y \
  --env OPT_COMMANDIR=Y \
  --env OPT_COMSKIP=Y \
  --env JAVA_MEM_MB=768 \
  --env VERSION=latest \
  --env OPT_SETPERMS=Y \
  --privileged \
  -t -i stuckless/sagetv-server-java8
Here' the General Settings screen. Container Name takes care of: --name sagetv-server and high privilege takes care of --privileged \


The Volumes tab takes care of the -v ... commands:


Port settings are auto, taking care of --net host \


Environment settings take care of the --env settings



Question: After removing all of the GUI-entered commands, the original run command distills down to this:
Code:
docker run -d -t -i docker/sagetv-server-java10
Is this correct? Do I need the the -d, -t, and -i arguments?

What's the purpose of the "docker/sagetv-server-java10" path? Do I need that?

Thanks in advance!

Last edited by Carlton Bale; 04-12-2018 at 08:41 PM.
Reply With Quote
  #2  
Old 04-13-2018, 07:12 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I don't think your volumes are correct.

the -v commands map NAS volumns to CONTAINER volumes. (ie, path on your synology file system to path INSIDE the docker container)

Code:
  -v /home/seans/unRAID/mnt/user/sagemedia:/var/media \
  -v /home/seans/unRAID/mnt/user/mediaext:/var/mediaext \
  -v /home/seans/unRAID/mnt/user/apps/sagetv3:/opt/sagetv \
  -v /home/seans/unRAID:/unraid \
So in your case you are not using /var/media or /opt/sagetv and as such recordings and sagetv configurations will be stored INSIDE your container and restarts/upgrades will likely blow it all away.

So in your UI it would appear that your RIGHT HAND side must be values like /opt/sagetv and /var/media/ and the LEFT HAND side will be full paths to where you want this information stored on your NAS. And neither of them can be READ ONLY (sagetv will need to write to those paths)

The ENV section will need some tweaking as well
Code:
  --env PUID=1000 \
  --env PGID=1000 \
  --env VIDEO_GUID=19 \
  --env OPT_GENTUNER=Y \
  --env OPT_COMMANDIR=Y \
  --env OPT_COMSKIP=Y \
  --env JAVA_MEM_MB=768 \
  --env VERSION=latest \
  --env OPT_SETPERMS=Y \
PUID and GUID MUST be the linux user and group ON YOUR SYNOLOGY system under which sagetv will run. (on unRAID this is 99,100 respectively, on my personal linux system this is 1000,1000 respectively).

The VIDEO_GUID needs to be group id of the "video" group which generally has read access to the /dev/video# nodes.

SETPERMS if set to Y will change the ownership of all files under /var/media and /opt/sagetv (is your mounted paths) to be the PUID and PGUID so that when you access the files over smb or some other means, you actually have access to those files.
Reply With Quote
  #3  
Old 04-14-2018, 05:53 PM
Carlton Bale Carlton Bale is offline
Sage Advanced User
 
Join Date: Sep 2010
Location: Indianapolis, Indiana, USA
Posts: 120
Thanks Stuckless. This helps tremendously. I now understand what the volume mount commands are doing and got everything in the container mapped.

For UIDs, my initial thought is that everything could go under root. SSH into the Synology system gives root UID/GID/Groups = 0 and and an existing docker container shows similar. Or should I run it under a specific user account?


For the Video_GUID, I'm completely lost. I can't find any reference to that in the Synology system for any user or group, and no reference for /dev/video#. There is no video output from the Synology; it's completely headless. I'm not sure what I need to do that Video_GUID, if anything. Thoughts?

Last edited by Carlton Bale; 04-14-2018 at 07:53 PM.
Reply With Quote
  #4  
Old 04-15-2018, 11:21 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Carlton Bale View Post
Thanks Stuckless. This helps tremendously. I now understand what the volume mount commands are doing and got everything in the container mapped.

For UIDs, my initial thought is that everything could go under root. SSH into the Synology system gives root UID/GID/Groups = 0 and and an existing docker container shows similar. Or should I run it under a specific user account?


For the Video_GUID, I'm completely lost. I can't find any reference to that in the Synology system for any user or group, and no reference for /dev/video#. There is no video output from the Synology; it's completely headless. I'm not sure what I need to do that Video_GUID, if anything. Thoughts?
if you can ssh into your NAS, then you can figure out these UIDs like this..

Code:
$ cat /etc/group | grep video
It will show something like,
Code:
video:x:44:
so 44 is the video guid.

So the next would be to figure out is Synology is owning everything as root or not. So use the 'ls -al' command on some media file that you copied to your nas.

ie, when ssh'd to the your NAS if you have files in /media/videos/ (as an example), then
$ ls -al /media/videos
it will show complete username and group ownerships
-r--r--r-- 1 seans seans 828 Feb 15
if the user shows up as root root then yeah, synology runs as root and owns everything as root. But if it shows something else, that likely that is the user that the NAS is using for file ownerships, and you need to set the PUID and PGUID to their numeric user and group values.

$ cat /etc/passwd | grep seans
seans:x:1000:1000:Sean Stuckless,,,:/home/seans:/bin/bash

in the above case seans user has a user:group ids of 1000 and 1000.
Reply With Quote
  #5  
Old 04-17-2018, 08:51 PM
Carlton Bale Carlton Bale is offline
Sage Advanced User
 
Join Date: Sep 2010
Location: Indianapolis, Indiana, USA
Posts: 120
Thanks for the tip on the "ls -al" command. It looks like the files are owned by the default admin account (1024) and the users account group (100).

Quote:
Originally Posted by stuckless View Post
if you can ssh into your NAS, then you can figure out these UIDs like this..

Code:
$ cat /etc/group | grep video
It will show something like,
Code:
video:x:44:
so 44 is the video guid.
I previously tried something similar, and unfortunately, there is nothing in /etc/group for video. Here's the full list via "cat /etc/group", and nothing obviously links to video.

Code:
#$_@GID__INDEX@_$276949$
administrators:x:101:sysadmin
avahi:x:84:
bind:x:53:
daemon:x:2:daemon,root
dbus:x:81:
dovecot:x:143:dovecot
ftp:x:21:ftp
http:x:1023:user1
ldap:x:439:
log:x:19:root
lp:x:7:lp
maildrop:x:126:
mysql:x:66:
nobody:x:99:
ntp:x:87:
postfix:x:125:postfix
postgres:x:55:
root:x:0:
rpc:x:32:
smmsp:x:25:sysadmin,smmsp
StorageAnalyzer:x:276949:
SynoFinder:x:195341:
SynologyGuests:x:106:
system:x:1:system
users:x:100:
wheel:x:10:
I don't think I can just remove the video environment variable. It doesn't seem to launch, and I'm assuming that's the issue.

Last edited by Carlton Bale; 04-17-2018 at 09:00 PM.
Reply With Quote
  #6  
Old 04-18-2018, 05:02 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
So the video group only comes into play, later, if you are actually using video hardware. Based on your group list, you can probably set it to 1, and it won't be used until you add video hardware (and you don't add video hardware, then no worries either).

If sagetv is not starting up, then you'll want to check the docker logs to see if there is a problem.

How does synology start your docker container? Does it provide a log?
Reply With Quote
  #7  
Old 04-23-2018, 06:44 AM
Carlton Bale Carlton Bale is offline
Sage Advanced User
 
Join Date: Sep 2010
Location: Indianapolis, Indiana, USA
Posts: 120
Thanks for all of your help. I finally got it up and running. The container was starting properly, but I mistakenly had the container ports set to "automatic", which resulted in them being mapped to 32xxx port numbers on the host. Once I manually mapped the container port the matching port numbers on the host, I was able to connect and configure.

I am still having a problem with network auto-discovery. My SageTV extenders and clients are unable to auto-discover the server. I have to manually connect to the server via IP address. Additional, the server was unable to discover the SiliconDust HDHR turners on my network. I read through multiple other threads but couldn't find an obvious solution. Any suggestion as to where I should start looking?
Reply With Quote
  #8  
Old 04-27-2018, 01:09 AM
7up 7up is offline
Sage Advanced User
 
Join Date: Mar 2003
Posts: 176
Do you have HDHomerun package installed? I am very interested in this project as I would love to run SageTV server on Synology NAS.
Reply With Quote
  #9  
Old 04-27-2018, 03:17 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Carlton Bale View Post
Thanks for all of your help. I finally got it up and running. The container was starting properly, but I mistakenly had the container ports set to "automatic", which resulted in them being mapped to 32xxx port numbers on the host. Once I manually mapped the container port the matching port numbers on the host, I was able to connect and configure.

I am still having a problem with network auto-discovery. My SageTV extenders and clients are unable to auto-discover the server. I have to manually connect to the server via IP address. Additional, the server was unable to discover the SiliconDust HDHR turners on my network. I read through multiple other threads but couldn't find an obvious solution. Any suggestion as to where I should start looking?
I know for unRAID I have to set the networking to "HOST" (which means that port mapping is not really required, as it exposes the ports directly). What is your network type set to?
Reply With Quote
  #10  
Old 04-30-2018, 09:53 AM
Carlton Bale Carlton Bale is offline
Sage Advanced User
 
Join Date: Sep 2010
Location: Indianapolis, Indiana, USA
Posts: 120
Quote:
Originally Posted by 7up View Post
Do you have HDHomerun package installed? I am very interested in this project as I would love to run SageTV server on Synology NAS.
That package isn't installed. How can I install it in such a way that it's maintained between upgrades?

Quote:
I know for unRAID I have to set the networking to "HOST" (which means that port mapping is not really required, as it exposes the ports directly). What is your network type set to?
I had networking set to BRIDGE (separate subnet and gateway) instead of HOST (i.e. "Docker Host" in the Synology initial docker image configuration process.) Changing that should resolve the networking issue.

Last edited by Carlton Bale; 04-30-2018 at 10:44 AM.
Reply With Quote
  #11  
Old 04-30-2018, 05:06 PM
7up 7up is offline
Sage Advanced User
 
Join Date: Mar 2003
Posts: 176
Quote:
Originally Posted by Carlton Bale View Post
That package isn't installed. How can I install it in such a way that it's maintained between upgrades?
By upgrades am I correct you are referring to DSM? I've been running Version 1.0.1-1 for a while now and have not an issue thus far with each DSM update. Whether it will allow you to see network tuners I don't know but it may be worth trying.
Reply With Quote
  #12  
Old 05-02-2018, 09:48 PM
Carlton Bale Carlton Bale is offline
Sage Advanced User
 
Join Date: Sep 2010
Location: Indianapolis, Indiana, USA
Posts: 120
Quote:
Originally Posted by 7up View Post
By upgrades am I correct you are referring to DSM? I've been running Version 1.0.1-1 for a while now and have not an issue thus far with each DSM update. Whether it will allow you to see network tuners I don't know but it may be worth trying.
I was talking about maintaining the file through upgrades of the docker image. The mapped directories for /var/media , /var/mediaext , and /opt/sagetv are all that is retained when a new version of docker image auto-installs. So it's necessary for the HDHR files to be maintained outside of the docker image itself.
Reply With Quote
  #13  
Old 05-12-2018, 11:33 AM
7up 7up is offline
Sage Advanced User
 
Join Date: Mar 2003
Posts: 176
Any updates and were you able to get the tuners recognized?
Reply With Quote
  #14  
Old 05-12-2018, 11:49 AM
Carlton Bale Carlton Bale is offline
Sage Advanced User
 
Join Date: Sep 2010
Location: Indianapolis, Indiana, USA
Posts: 120
Quote:
Originally Posted by 7up View Post
Any updates and were you able to get the tuners recognized?
No, I haven't figured that out yet. So SageTV Windows is still my primary.
Reply With Quote
  #15  
Old 05-13-2018, 12:24 AM
7up 7up is offline
Sage Advanced User
 
Join Date: Mar 2003
Posts: 176
Bummer. How difficult would it be to build a native (non-Docker) package?
Reply With Quote
  #16  
Old 06-02-2020, 12:00 PM
Protoman's Avatar
Protoman Protoman is offline
Sage Advanced User
 
Join Date: Jun 2007
Posts: 88
Rise my minion, RISE!

So in D&D I play a Death Cleric. The reason this is relevant is that I am raising this post from the dead!


I have been running SageTV from my Synology DS1019+ for the past week, and with great success so far. I found SSHing into the DS1019 and then running the Docker command is much better than the Docker GUI that comes on Synology NASes. I have two Hauppuage HVR-950Q currently attached and will be moving the other two at some point.

So far this looks to be a great solution instead of having a full PC running 24x7 only doing one thing... I also have my movie and music library running in Plex. I am going to experiment with running a Windows 10 Pro as a VM as well.

This is the docker command I am running, and I have the container limited to 2 GB RAM.

Code:
sudo docker run -d -m 2g --name sagetv-server \
  -v /volume2/Recordings:/var/media \
  -v /volume1/docker/SageTV/Config:/opt/sagetv \
  -v /volume1/docker/SageTV/resolv.conf:/etc/resolv.cnf \
  --net bridge \
  --env PUID=1024 \
  --env PGID=100 \
  --env VIDEO_GUID=1 \
  --env OPT_GENTUNER=N \
  --env OPT_COMMANDIR=N \
  --env OPT_COMSKIP=Y \
  --env JAVA_MEM_MB=1024 \
  --env VERSION=latest \
  --env OPT_SETPERMS=Y \
  --publish 8080:8080/tcp \
  --publish 31099:31099/tcp \
  --publish 31100:31100/udp \
  --publish 42024:42024/tcp \
  --publish 7818:7818/tcp \
  --publish 7760:7760/tcp \
  --publish 8270:8270/udp \
  --publish 8271:8271/udp \
  --publish 6969:6969/tcp \
  --publish 16867:16867/udp \
  --publish 16869:16869/udp \
  --publish 16881:16881/udp \
  --publish 8000:8000/tcp \
  --publish 9010:9010 \
  --privileged \
  --restart always \
  -v /dev/dvb:/dev/dvb \
  -t -i stuckless/sagetv-server-java11:latest
__________________
Server: Synology DS1019+, 2x WD Red 10 TB, 2x HVR-950Q OTA
Old Server: ASRock Z77 Pro5-M, Intel i3-3225, 16GB RAM, 2x HVR-1800 OTA, 2x HVR-950Q OTA, 2x HD-PVR w/SPDIF (Not in use), 2x 1TB WD Black, 2TB WD Black, and Windows 7 Professional 64-bit.

- 1x HD 300
- 2x HD 200
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
Nullencodingserver in docker graywolf SageTV for unRAID/Docker 2 07-28-2017 10:09 AM
Docker Questions SWKerr SageTV for unRAID/Docker 12 06-16-2017 06:14 AM
Docker question wayner SageTV for unRAID/Docker 5 05-27-2017 05:51 PM
Is unRAID/Docker the right OS for me? wayner SageTV for unRAID/Docker 32 01-12-2017 03:08 PM
Docker container coppit SageTV Github Development 20 09-06-2015 06:26 PM


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


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