SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux > SageTV for unRAID/Docker

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, 04:52 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,610
Adding a custom script during startup

While the docker container tries to do many things, it's likely that there are configurations that will require extra tweaking.

During startup if the following script exists in the SAGE_HOME (ie, root of the sagetv server) then it will get executed.

Code:
sagetv-user-script.sh
(Full path inside the container is)
Code:
/opt/sagetv/server/sagetv-user-script.sh
This script must be a valid linux script. ie...
1. Must have a script header like
Code:
#!/bin/bash
2. Must be executable
Code:
# chmod 775 sagetv-user-script.sh
3. Must be an in unix format (ie, if you are creating/editing this file from Windows, make sure the editor that you are using supports saving a file unix line endings). (If you are editing this file using vi, vim, or nano, etc, it will already have the correct line endings)

So, using the "sagetv-user-script.sh", you can do whatever you want BEFORE sagetv is started.
Reply With Quote
  #2  
Old 10-10-2017, 12:38 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,899
Does SageTV wait for this script to complete before executing or does it execute SageTV concurrently with this script? Let's say I wanted to use a SageTV startup script to restart my HD-PVRs. If I ran the script to do a power cycle and then waited 10 seconds (or longer) would I be good?
__________________
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
Reply With Quote
  #3  
Old 10-10-2017, 01:23 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,610
Quote:
Originally Posted by wayner View Post
Does SageTV wait for this script to complete before executing or does it execute SageTV concurrently with this script? Let's say I wanted to use a SageTV startup script to restart my HD-PVRs. If I ran the script to do a power cycle and then waited 10 seconds (or longer) would I be good?
It should wait. The intention was really to add a hook to do something important BEFORE sagetv was started.
Reply With Quote
  #4  
Old 10-10-2017, 01:27 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,899
Ok then I think this could be a good way to restart my HD-PVRs rather than using a cron job that runs during the weekly backup process described here.

On a related note - what is the easiest way to have SageTV trigger a SageTV system message when the service restarts? I use your notification plugin so this way I will see when this happens.
__________________
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
Reply With Quote
  #5  
Old 10-28-2017, 03:33 PM
mibsy mibsy is offline
Sage User
 
Join Date: Jul 2007
Posts: 57
Quote:
Originally Posted by wayner View Post
Ok then I think this could be a good way to restart my HD-PVRs rather than using a cron job that runs during the weekly backup process described here.

On a related note - what is the easiest way to have SageTV trigger a SageTV system message when the service restarts? I use your notification plugin so this way I will see when this happens.
Did you write a script to reboot your HD-PVRs. If so, could you share? I'd like to do the same.
Reply With Quote
  #6  
Old 10-28-2017, 05:31 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 6,899
Quote:
Originally Posted by mibsy View Post
Did you write a script to reboot your HD-PVRs. If so, could you share? I'd like to do the same.
I can share it but unless you have the same hardware, which in my case is a Digital Loggers web controlled power switch, then it won't be of any use to you. How to you plan to switch the power on and off?
__________________
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
Reply With Quote
  #7  
Old 10-29-2017, 08:27 PM
mibsy mibsy is offline
Sage User
 
Join Date: Jul 2007
Posts: 57
Quote:
Originally Posted by wayner View Post
I can share it but unless you have the same hardware, which in my case is a Digital Loggers web controlled power switch, then it won't be of any use to you. How to you plan to switch the power on and off?
My fault, I was thinking you were telling them to reboot directly over the HD-PVR USB connection. I might be able to do it with my UPS. I'll look into it. Thanks.
Reply With Quote
  #8  
Old 12-06-2017, 11:00 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,761
What user does this script run as?
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #9  
Old 12-06-2017, 11:12 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,610
Quote:
Originally Posted by bcjenkins View Post
What user does this script run as?
It runs as sagetv. It also takes care of the ownerships and file format (ie, settting it properly) before running it.
Reply With Quote
Reply


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

Advanced Search
Display Modes

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
Adding custom main menu item -Video Folder or Category wado1971 SageTV v7 Customizations 0 08-10-2010 02:58 PM
Adding a custom filter to Sage Movie Wall medwynd SageMC Custom Interface 0 04-25-2010 10:08 AM
Adding custom command for launching external program dinki SageMC Custom Interface 14 01-22-2010 08:16 AM
TIP: Adding automatic Wiz.bin backup to startup laurenglenn SageTV Linux 5 03-31-2006 11:52 AM
Adding a pause during close in custom xml menu... n3w813 SageTV Customizations 2 05-16-2005 01:37 PM


All times are GMT -6. The time now is 08:41 PM.


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