SageTV Community  

Go Back   SageTV Community > SageTV BETA Release Products > SageTV Beta Test Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Beta Test Software Discussion related to BETA Releases of the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. regarding SageTV Beta Releases should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-03-2010, 06:24 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
SageTV 7.0 Linux Upgrade - Non Debian

I am wondering if anyone has an upgrade script sorted out which supports the tarball install on Linux? I am having an issue with plugins setting up correctly and have to uninstall and reinstall.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #2  
Old 09-03-2010, 06:42 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I looked at doing something like this awhile ago... now I just nuke everything and start over with each install
Reply With Quote
  #3  
Old 09-03-2010, 06:50 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
I think I am going to use rsync and see if I can make that work. Right now I am just cp'ing files, but I am missing things.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #4  
Old 09-03-2010, 07:15 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Be sure to share, if you create anything
Reply With Quote
  #5  
Old 09-03-2010, 10:16 AM
Motofreak75 Motofreak75 is offline
Sage Expert
 
Join Date: Oct 2005
Posts: 578
Send a message via ICQ to Motofreak75
Maybe i'm doing it wrong, but for the but 9 months I have just backed up the entire sagetv server folder and then downloading the tar file in the server folder and unpacking it, and editing the sagecore file for java path and heap size and then just used ./startsage without removing or reinstalling any plug-ins.

I have yet to see anything go wrong but I still back up the entire directory first.
__________________
12.04 server Sagetv7
HD-pvr / 2250 /PVR 500 / DVBS w/rotor & 36 inch dish
Reply With Quote
  #6  
Old 09-03-2010, 10:27 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Interesting. I will try that the next time around. Use the sagesettings to store files.

B

Edit: I meant sagesettings for config information. Thanks for clarifying Jeff
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT

Last edited by bcjenkins; 09-03-2010 at 12:44 PM.
Reply With Quote
  #7  
Old 09-03-2010, 11:50 AM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,349
I just use the sagesettings to store my config-specific settings and then unpack the tarball on top of my /opt/sagetv/server folder each time I upgrade. And I have no issues. The only thing it won't catch is if we remove things from the install...but the only time that was ever an issue was when we change the name of the default theme in V7.

I also use the 'presage' scripts to do other things like copy a customer firewire tuner .so (my server doesn't have the required dependencies for the one we bundle with our linux installer); and also create a 'restart' file so that the server process will automatically restart itself if for some reason it dies (not that I need that anymore; it was mainly for early beta testing stages before we go public when things aren't as stable).
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #8  
Old 09-03-2010, 11:58 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by Narflex View Post
I just use the sagesettings to store my config-specific settings and then unpack the tarball on top of my /opt/sagetv/server folder each time I upgrade. And I have no issues. The only thing it won't catch is if we remove things from the install...but the only time that was ever an issue was when we change the name of the default theme in V7.

I also use the 'presage' scripts to do other things like copy a customer firewire tuner .so (my server doesn't have the required dependencies for the one we bundle with our linux installer); and also create a 'restart' file so that the server process will automatically restart itself if for some reason it dies (not that I need that anymore; it was mainly for early beta testing stages before we go public when things aren't as stable).
I wasn't aware of the 'presage' scripts, so that's good to know as well. I'll try the unzip and overwrite method and see what happens from now on. Btw, when I install from the .deb, does it remove the previous install, or does it simply extract over the current install?
Reply With Quote
  #9  
Old 09-03-2010, 12:48 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Clearly I have been doing this the harder way..

I guess my new upgrade script will be:
  1. Download Upgrade from $2 url
  2. execute $1/stopsage
  3. tar the current directory
  4. untar the upgrade into the directory
  5. execute $1/startsage
  6. Grab some and watch TV
B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #10  
Old 09-03-2010, 12:55 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by bcjenkins View Post
Clearly I have been doing this the harder way..

I guess my new upgrade script will be:
  1. Download Upgrade from $2 url
  2. execute $1/stopsage
  3. tar the current directory
  4. untar the upgrade into the directory
  5. execute $1/startsage
  6. Grab some and watch TV
B
It's sad that the first thing that entered my mind was, "why is he paying 2 dollars for the url?".... And it's not like I don't live in a command shell

EDIT: btw, if you have a simple script that does that... then post it.. it'll be handy to use. I tend to just do it manually.
Reply With Quote
  #11  
Old 09-04-2010, 12:04 AM
bastafidli bastafidli is offline
Sage Expert
 
Join Date: Dec 2007
Location: Charlottesville, VA
Posts: 728
What I am doing is

1. rm /opt/sagetv/server
2. cp /opt/sagetv/server_7.x.old /opt/sagetv/server_7.x.new
3. untar xx.tar to /opt/sagetv/server_7.x.new
4. ln /opt/sagetv/server_7.x.new /opt/sagetv/server

This way I am always using /opt/sagetv/server as my current sagetv install and have backups to switch to immediately if somethind doesn't work.

The only issue with this is that SageTV is detecting the current page as the absolute path /opt/sagetv/server_7.x.new rather than the logical path from where it is started /opt/sagetv/server. What this leads to is that from time to time I have to go and edit the properties and remove the version numbers from the paths stored there.

Long time ago I have reported it as a bug for Linux version but must have fallen through the cracks.
__________________

TV: Samsung UN46D8000
Server: Intel Core i3 540, 4G RAM, Matrox G450, 70GB EXT3 encrypted software RAID1 system drive, 1TB XFS tv recording drive, 2TB EXT3 encrypted data drive mirror across 2 machines, 2TB EXT3 encrypted media drive mirror across 2 machines, CentOS 6 64 bit, Experimenting with DNLA servers
1Gb wired network
Disconnected after G day[HD 100 Media Extender, Placeshifter 7.x, SageTV 7.x, HDHomeRun]
Reply With Quote
  #12  
Old 09-04-2010, 04:29 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Quote:
Originally Posted by stuckless View Post
"why is he paying 2 dollars for the url?"
I always buy my download links on Ebay.

I will post something later after I engineer something overly complex.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #13  
Old 09-04-2010, 06:55 AM
drewg drewg is offline
Sage Icon
 
Join Date: Aug 2007
Location: Richmond, VA
Posts: 1,042
Quote:
Originally Posted by bastafidli View Post
The only issue with this is that SageTV is detecting the current page as the absolute path /opt/sagetv/server_7.x.new rather than the logical path from where it is started /opt/sagetv/server. What this leads to is that from time to time I have to go and edit the properties and remove the version numbers from the paths stored there.

Long time ago I have reported it as a bug for Linux version but must have fallen through the cracks.
This really isn't so much a bug in sagetv, its more just how *nix works. There are 2 ways to obtain the current working directory -- the $PWD environment variable maintained by the shell, and the getcwd system call. Typically, the shell will maintain $PWD via the path you took to some directory (so it will say /opt/sagetv/server), but the getcwd syscall will contain the real path (/opt/sagetv.7.x/server).

That said, this could be fixed in sagetv if there was a sage_config_path or something where you could specify the path to the sage configuration. Then you could plug in the symlink path..

Drew
Reply With Quote
  #14  
Old 09-04-2010, 11:56 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Quote:
Originally Posted by stuckless View Post
btw, if you have a simple script that does that... then post it.. it'll be handy to use. I tend to just do it manually.
I just created this, this morning and tested the steps but won't use it until next release as my update has been running a few days already.

B

Code:
#!/bin/bash
# ©2010 Brandon Jenkins
# SageTV Upgrade Script - Version .1 BETA
# USE AT YOUR OWN RISK! Backup all your data!
# To use this script place it in a file called sagetv_upgrade.sh
# Execute "chmod +x sagetv_upgrade.sh"
# ./sagetv_upgrade.sh URL_TO_DOWNLOAD PATH_TO_SAGETV 
# The PATH_TO_SAGETV is not needed if SageTV is installed to the default path
# This script will default to /opt/sagetv/server

# Setting up application variables
SAGETV_HOME=/opt/sagetv/server
if [[ $2 ]]; then SAGETV_HOME=$2; fi
SAGETV_URL=$1
SAGETV_FILE=$(echo $SAGETV_URL | cut -d "/" -f $(expr $(echo $SAGETV_URL | grep -o "/" | wc -l) + 1))
SAGETV_BACKUP_PATH=$(echo $SAGETV_HOME |cut -d "/" -f -$(echo $SAGETV_HOME | grep -o "/" |wc -l))
#SAGETV_BACKUP_PATH=/opt/sagetv #Optional set hard path

# Download the file
if [[ ! $SAGETV_URL == "" ]]; then
  wget -O $SAGETV_BACKUP_PATH/$SAGETV_FILE $SAGETV_URL
  tar -tf $SAGETV_BACKUP_PATH/$SAGETV_FILE 2>/dev/null 1>/dev/null
  if [[ ! $? -eq 0 ]]; then
    echo "The download did not complete successfully. Aborting!"
    exit 1
  fi
else
  echo "Usage: Please provide a valid URL for the download. Eg. sagetv_upgrade.sh http://download.sage.tv/linuxbeta/server_7.0.16.tar.gz"
  exit 1
fi

#Stop SageTV and make sure it is dead :)
PIDFILE=/var/run/sagetv.pid
if [ -e $SAGETV_HOME/sagesettings ]; then . $SAGETV_HOME/sagesettings; fi
if [ -e $PIDFILE ]; then
  while [[ $(ps -f --pid $(cat $PIDFILE) | grep Sage.jar | grep -v grep) != "" ]]; do
    echo "Attempting to stop SageTV for upgrade"
    $SAGETV_HOME/stopsage
    #kill -9 $PIDFILE
  done
fi

# Backup the directory
tar -czf $SAGETV_BACKUP_PATH/server_$(date +%Y%m%d).tar.gz $SAGETV_HOME
if [[ ! $? -eq 0 ]]; then
  echo "The backup did not complete successfully. Aborting!"
  exit 1
fi

# Untar upgrade
cd $SAGETV_HOME
tar xzvf $SAGETV_BACKUP_PATH/$SAGETV_FILE
if [[ ! $? -eq 0 ]]; then
  echo "The installation did not complete successfully. Aborting!"
  exit 1
fi

# Start SageTV
$SAGETV_HOME/startsage

exit 0
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT

Last edited by bcjenkins; 09-06-2010 at 08:37 AM. Reason: Added further comments/instruction to the script
Reply With Quote
  #15  
Old 09-04-2010, 09:10 PM
MrD MrD is offline
Sage Aficionado
 
Join Date: Feb 2005
Location: Washington DC
Posts: 387
Quote:
Originally Posted by bcjenkins View Post
Clearly I have been doing this the harder way..

I guess my new upgrade script will be:
  1. Download Upgrade from $2 url
  2. execute $1/stopsage
  3. tar the current directory
  4. untar the upgrade into the directory
  5. execute $1/startsage
  6. Grab some and watch TV
B
I think you can eliminate step 3 for efficiency Live on the edge!
__________________
[size=1]-MrD
=============
Linux Server 7.1.9 (1)HD300 (1) HD200 (1) HD100 (2) PC Clients
Intel Xeon L? 32Gb
CetonTV cable card /FIOS
Reply With Quote
  #16  
Old 09-04-2010, 09:12 PM
MrD MrD is offline
Sage Aficionado
 
Join Date: Feb 2005
Location: Washington DC
Posts: 387
Quote:
Originally Posted by drewg View Post
This really isn't so much a bug in sagetv, its more just how *nix works. There are 2 ways to obtain the current working directory -- the $PWD environment variable maintained by the shell, and the getcwd system call. Typically, the shell will maintain $PWD via the path you took to some directory (so it will say /opt/sagetv/server), but the getcwd syscall will contain the real path (/opt/sagetv.7.x/server).

That said, this could be fixed in sagetv if there was a sage_config_path or something where you could specify the path to the sage configuration. Then you could plug in the symlink path..

Drew
?

ROOT=`pwd`
echo $ROOT
__________________
[size=1]-MrD
=============
Linux Server 7.1.9 (1)HD300 (1) HD200 (1) HD100 (2) PC Clients
Intel Xeon L? 32Gb
CetonTV cable card /FIOS
Reply With Quote
  #17  
Old 09-04-2010, 09:51 PM
jpwegas jpwegas is offline
Sage Expert
 
Join Date: May 2007
Posts: 502
Quote:
Originally Posted by MrD View Post
?

ROOT=`pwd`
echo $ROOT
Right, that returns the path that you cd'd to within the shell. But Drew's point is that if Sage is using the getcwd syscall then it gets the real path, which might be different and leads to the issue bastafidli described.

Example:

cd /tmp
mkdir foo
ln -s foo notfoo
cd foo
pwd
/tmp/foo
perl -e 'use Cwd; print getcwd . "\n";'
/tmp/foo
cd ../notfoo
pwd
/tmp/notfoo
perl -e 'use Cwd; print getcwd . "\n";'
/tmp/foo


--John
Reply With Quote
  #18  
Old 09-06-2010, 01:59 AM
bastafidli bastafidli is offline
Sage Expert
 
Join Date: Dec 2007
Location: Charlottesville, VA
Posts: 728
Correct, I think the solution is for the .startsage to pass the current working directory (the symlink one) to the Java code.
__________________

TV: Samsung UN46D8000
Server: Intel Core i3 540, 4G RAM, Matrox G450, 70GB EXT3 encrypted software RAID1 system drive, 1TB XFS tv recording drive, 2TB EXT3 encrypted data drive mirror across 2 machines, 2TB EXT3 encrypted media drive mirror across 2 machines, CentOS 6 64 bit, Experimenting with DNLA servers
1Gb wired network
Disconnected after G day[HD 100 Media Extender, Placeshifter 7.x, SageTV 7.x, HDHomeRun]
Reply With Quote
  #19  
Old 09-24-2010, 04:42 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
The current version upgrade went off without a hitch with my super duper script. I have a nice tarball (not the BP kind) of the .16 version and an upgraded copy of SageTV.

Thanks for the pointer Jeff!

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
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
V7 linux upgrade pricing? drewg SageTV Beta Test Software 5 05-20-2010 07:51 PM
SageTV on Debian lyroy SageTV Linux 2 03-12-2009 04:05 PM
Upgrade SageTV beta on Debian chip33az SageTV Beta Test Software 2 07-07-2008 05:17 PM
Linux 6.0.14.1 installed, should I upgrade? Dekard SageTV Linux 4 01-29-2007 10:05 AM
New nVidia Driver upgrade for Linux gplasky SageTV Linux 0 04-10-2006 09:34 AM


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


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