![]() |
|
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. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
How would you run a script when the Docker starts?
I wouldn't mind rebooting my extenders when my Docker restarts. How do I initiate a script when the Docker starts. I think in linux this is done in something like an rc.d file - is there something similar when a docker starts?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#2
|
||||
|
||||
if /opt/sagetv/server/sagetv-user-script.sh exists it will be run immediately before the SageTV starts.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#3
|
|||
|
|||
Great, thanks. Does this script have to terminate before Sage starts or is the Sage start done in parallel? What I am looking at doing is running a script that restarts my extenders and have them autoconnect to Sage. But Sage will have to be up and running in order for that to happen.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#4
|
||||
|
||||
sage's startup will not continue until the script is done.
That said, if you start up the extender while the server is unavailable, it send a wake-up packet and wait for the server to become available, and once it is, it will connected to it, so you should be able to reboot your extender in the startup script, and once sage is up, the extender will connect.
__________________
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; 01-26-2017 at 11:04 AM. |
#5
|
||||
|
||||
Quote:
so if this script called... Code:
do-my-long.task.sh Code:
do-my-long-task.sh &
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#6
|
||||
|
||||
just curious, my extenders seem to reboot automatically when the docker is restarted... even the ones that were not on or in use at the time I need to wander by and turn them off afterwards...
I thought that was their normal behavior?
__________________
NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice... |
#7
|
||||
|
||||
I believe the SageTCPServer plugin would do this.
__________________
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 |
#8
|
|||
|
|||
I think you are right. I used to use that but it had a bug where it would only store the IP or MAC addresses of 10 miniclients. Any more and it would cause issues. So if you happened to use Placeshifter on a PC once then it would take up a slot, unless you went and cleaned out the list in the sage.properties file.
I think the other option for me may be SJQ as I think you can kick off jobs for when Sage starts up, in addition to Recording Started, Recording Stopped, Cron jobs, etc.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#9
|
||||
|
||||
you are probably correct I do use the SageTCPServer plugin to talk to my CQC HA server...
so it is not just a default sage thing after all? I did not know about the 10 client limit though... that may be problematic at some point in the future... in my case that would mostly be because of Stuckless and his incredibly cool mini client... I just cant help but load it up on every android device I come across... someone leaves their phone unlocked, they get a mini client installed... that is just the way it is... can't be helped... I blame stuckless..
__________________
NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice... Last edited by SomeWhatLost; 01-27-2017 at 12:47 PM. |
#10
|
|||
|
|||
I can't find specific mention of the ten device limit in the thread but I remember hearing it from Fonceur - it might have been in a PM. I believe the limit was because it reserved a port for each miniclient and they didn't consider that some of the miniclients may be transient - in the past I would often use Placeshifter to connect to a server to try something out but never use Placeshifter on that computer again. There is less reason not to do this today as, as was mentioned, there are clients for mobile devices, and there is no licensing requirement for Placeshifter.
It would be nice if this limit could be eliminated but I don't think anyone if maintaining SageTCPServer anymore. edit - And no, it is definitely not part of the core of SageTV, but maybe it should be?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server Last edited by wayner; 01-27-2017 at 01:22 PM. |
#11
|
||||
|
||||
Quote:
![]()
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#12
|
|||
|
|||
And I hope you have a large JVM heap size and lots of upload bandwidth to deal with all of those miniclients.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#13
|
||||
|
||||
Quote:
and yes, I set JVM heap to like 4 gig or something... and for some reason (could be my imagination?) Docker Sage does not seem to use it up as quickly as windows did...
__________________
NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice... |
#14
|
|||
|
|||
It wouldn't surprise me if there is a memory leak in Windows as occasionally I will get JVM heap issues with only a couple of extenders attached, especially if there have been many other extenders attached, and then detached, since the last reboot. Maybe those memory leaks don't occur in Linux.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#15
|
|||
|
|||
Quote:
__________________
Server: i5 8400, ASUS Prime H370M-Plus/CSM, 16GB RAM, 15TB drive array + 500GB cache, 2 HDHR's, SageTV 9, unRAID 6.6.3 Client 1: HD300 (latest FW), HDMI to an Insignia 65" 1080p LCD and optical SPDIF to a Sony Receiver Client 2: HD200 (latest FW), HDMI to an Insignia NS-LCD42HD-09 1080p LCD |
#16
|
||||
|
||||
My best guess would be that V4L is a much lighter protocol to work with over BDA. There's also some differences in how some of the native code is compiled for Linux vs Windows that would contribute to the overall memory footprint.
__________________
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 |
#17
|
|||
|
|||
One further question on this - will this script also be run whenever the SageTV service (if that is still the right term in unRAID) restarts, such as when a Plugin forces a restart?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#18
|
||||
|
||||
No, this is run only when the startup is done when the container loads.
__________________
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 |
#19
|
|||
|
|||
So any suggestions on how to do this - I want to ensure that some of my extenders are connected and if you do a restart of the Sage service then the extender will lose the connection.
I thought that it was possible to use SJQ to start a task when SageTV starts but it turns out that isn't the case, as you can only attach tasks to: RecordingStarted, RecordingStopped, SystemMessagePosted, or MediaFileImported. Would it be possibel to have a SystemMessage generated whenever SageTV starts?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#20
|
||||
|
||||
Quote:
__________________
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 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to stop docker? | matt91 | SageTV for unRAID/Docker | 2 | 01-16-2017 04:37 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 |
NASs? Docker? | ThePaladinTech | SageTV Github Development | 10 | 08-16-2015 02:34 PM |
Unfortunate behavior when fav #5 starts at 11:05pm but fav #15 starts at 11:00pm | rmellor | SageTV Software | 16 | 03-23-2005 03:05 AM |