SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV v7 Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-26-2010, 01:19 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Utility: SageTV Auto Restarter (SAR)

This is a simple executable jar that will connect to a SageTV server, determine if a restart is necessary (usually due to plugin installation/upgrades) and if it is will restart the server only if certain conditions are met. This version supports the following checks before restarting the server:
  • Minimum time until next scheduled recording
  • Do not restart if one or more clients are connected
  • Do not restart if a recording is in progress

Unzip the sar.jar to any location and run as follows:

Code:
$ java -jar sar.jar -h
sar.jar [-o|--host=localhost[:1098]] [-b|--mins-before-next-rec=15]
        [-f|--force] [-i|--ignore-clients] [-r|--reboot] [-s|--shutdown]
        [-t|--test-mode] [-v|--verbose] [-h|--help]

Default values shown above; if -t set then server is never actually restarted

-f forces restart if safe; -f with -r or -s will force sys reboot or shutdown

-i will restart server even if clients are connected

-r/-s will reboot/shutdown entire system instead of restarting SageTV
System reboots/shutdowns (-r/-s) occur on the host specified, which MAY NOT BE
THE SAGETV SERVER INSTANCE!  SageTV app restarts are ALWAYS triggered on the
SAGETV SERVER APPLICATION.  System reboot/shutdown only supported on Windows
and Linux.

Port number is the registered RMI port for the sagex-services plugin

This utility requires the sagex-services plugin be installed w/RMI enabled
I run this program from cron (Linux/Cygwin) to detect necessary restarts and do them when the server is not busy. A similar setup should be possible with the Task Scheduler on MS Windows.

This program will only succeed if you have the sagex-services plugin installed on your Sage server with the RMI service installed, enabled and running.

Download from here.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...

Last edited by Slugger; 09-27-2010 at 04:48 PM.
Reply With Quote
  #2  
Old 09-27-2010, 05:43 AM
ohpleaseno ohpleaseno is offline
Sage Aficionado
 
Join Date: Apr 2009
Location: South Florida
Posts: 464
Just to be clear, does this restart the service or the machine?
__________________
Server: WHS with 11TB of storage
Clients:1) HD-200 to a Samsung 32" Slimfit CRT HDTV 2) HD-200 to a Pioneer 26" X1 LCD
Tuners: 1) HD-Homerun 2) Avermedia USB ATSC
Twitter: ohpleaseno
Reply With Quote
  #3  
Old 09-27-2010, 06:05 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by ohpleaseno View Post
Just to be clear, does this restart the service or the machine?
Currently, it just restarts the SageTV server application (it does NOT reboot the entire machine). Also, regardless of whether you specify the IP of a Sage server or a Sage client, it will ALWAYS test the state of the server host and only restart the SageTV server application.

The next version will add the option to do a complete system reboot of the Sage server host (Windows and Linux only - OS X support can be added if someone gives me the command to reboot OS X).
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #4  
Old 09-27-2010, 07:27 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
On a related note - why do upgrades of Jetty apps now require a Sage server restart? Didn't they used to upgrade on the fly?
__________________
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 09-27-2010, 07:43 AM
kevine kevine is offline
Sage Expert
 
Join Date: Aug 2007
Posts: 514
Thanks, Slugger!
Reply With Quote
  #6  
Old 09-27-2010, 07:45 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
On a related note - why do upgrades of Jetty apps now require a Sage server restart? Didn't they used to upgrade on the fly?
Depends on how the app is packaged for Sage v7. Basically, if the Jetty app also provides a plugin implementation and that plugin implementation also wants to use code from the Jetty app then you have to move the Jetty app's code into a jar in SageTV/JARs/ since a plugin class can't access code from a Jetty war file (different class loaders) and once you move the Jetty app into SageTV/JARs/ then hot deploy is no longer an option. If you completely isolate the Jetty app from the core (meaning no plugin config via STV and no plugin implementation class OR the plugin config/impl does not use any code from the Jetty app) then you can keep it all in a war and maintain hot deploy capabilities.

For me, all my plugins use the plugin implementation framework except for SJQv3 so hot deploy is not an option for any of those plugins. The next version of SJQ will also take complete advantage of the plugin framework so it will lose its hot deploy abilities as well.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #7  
Old 09-27-2010, 04:44 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Latest build now available. Adds support for ability to reboot or shutdown the host running the sagex-services plugin you are connected to.

Restarting SageTV always restarts the SageTV server application, regardless of whether or not you are connecting to the server or a PC client to run SAR. However, if you specify the system reboot or shutdown option then it can only shutdown the system it connects to.

System reboot and shutdown is only supported for Windows and Linux (OS X could be added if necessary and someone has to provide me the shutdown command for OS X). The build has only been tested on Linux - I have not nor will I have an opportunity to reboot my Windows (production) server for the next few days anyways.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #8  
Old 02-11-2015, 08:27 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
I have unsubscribed from this thread. "Quick(ish) response" support for this plugin is no more. I may or may not read further posts in this thread and if I do read them then I may or may not respond to them. More details here.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
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
Utility: SageTV Registry Settings babgvant SageTV Customizations 71 06-04-2013 11:24 AM
Utility: SageTV Remote Control shadeblue.com SageTV Customizations 89 01-08-2011 05:23 PM
Utility: SageTray - SageTV tray application k10ck3r SageTV Customizations 247 09-30-2010 09:26 AM
Is there a utility that allows me to save my SageTV config? sdsean SageTV Customizations 1 11-07-2009 10:13 PM
Utility: ComChecker for SageTV on Mac OS X bcjenkins SageTV Customizations 29 09-01-2009 07:29 PM


All times are GMT -6. The time now is 01:50 PM.


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