SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-30-2008, 07:26 PM
Kevintimm Kevintimm is offline
Sage User
 
Join Date: Jan 2006
Posts: 32
Linux Problems

Hello everyone, I hopw someone could help me with this. I am running sage 6.5 on Ubuntu 8.1 with Java 6. all latest patches for everything. The problem I am having is that the sage server will not run unless I am logged into the root account. (and not just an account with root rights. it has to be root.) I am not sure why this is and have tried many things such as changing the permissions on all of the files and adding my user account to the root group. nothing seems to work. The weird thing is that I get varied results. Sometimes System Monitor will say its running be when I goto connect, I get the "connecting to your local sage server" windows and then it disappears. I have to stop the process and start it again.

Another problem I am having is that my Wiz.bin keeps getting corrupt. acutally almost every reboot kills my Wiz.bin

This has happened for a couple of releases now, so it is not specific to this latest beta. I believe it is somehting wrong with my setup. I should also mention that this comp is only used to for sage. that is the only thing on it. and I have reformatted to see if that helps but it didnt.
Reply With Quote
  #2  
Old 12-30-2008, 08:09 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Regarding the Wiz.bin corruption.

Sounds to me like you have multiple nics. Make sure you have a udev rule set up to load your nics in the same name on every boot.

Regarding the user.

Make sure your user is the owner of all files in /opt/sagetv/server and I would also modify the startsage and stopsage scripts to write the PID files in /opt/sagetv/server and that your user is in the video group.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #3  
Old 12-30-2008, 10:35 PM
Kevintimm Kevintimm is offline
Sage User
 
Join Date: Jan 2006
Posts: 32
I just reformated again and all i did was install the deb package for the server. I installed all the dependencies and when I reboot it wont auto run. I tried like 5 times. Then I tried to login as root and it came up. this is from a fresh install. this wouldnt be too much of a problem but i cant run my server in root all the time. and i cant autologin to root either. Am I missing something here?
Reply With Quote
  #4  
Old 12-30-2008, 11:13 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
I don't use the deb package, sorry. I am not sure what scripts they run in there.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #5  
Old 12-31-2008, 08:47 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I use the deb packages, and I haven't had any issues yet.

As your normal user, try
Code:
# sudo /etc/init.d/sagetv restart
Next check /etc/rc3.d/S20sagetv and see if it points to /etc/init.d/sagetv.

Then you look at using the update-rc.d command (man update-rc.d) to set the scripts to autostart. (rean the man page)

As for running sagetv as a non root user, you can do it, but you'll want to spend a lot of time understanding how permissions work, and ensure that your grant the sagetv user access to hardware device nodes, and directories.
Reply With Quote
  #6  
Old 12-31-2008, 11:31 AM
Kevintimm Kevintimm is offline
Sage User
 
Join Date: Jan 2006
Posts: 32
Quote:
Originally Posted by stuckless View Post
As your normal user, try
Code:
# sudo /etc/init.d/sagetv restart
I tried that. the first time it worked great. i rebooted, and it didnt come back up. i tried sudo /etc/init.d/sagetv start and it said that it was already running. there is no sign of it running and the client wont connect. but when i do sudo /etc/init.d/sagetv restart it will work.
Quote:
Originally Posted by stuckless View Post
Next check /etc/rc3.d/S20sagetv and see if it points to /etc/init.d/sagetv.
This is what I have in there.
Code:
set -e

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="SageTV Server"
NAME=sagetv
SCRIPTNAME=/etc/init.d/$NAME
is this ok?
Quote:
Originally Posted by stuckless View Post
Then you look at using the update-rc.d command (man update-rc.d) to set the scripts to autostart. (rean the man page)
i entered
Code:
sudo update-rc.d sagetv defaults
and it told me that there was already a link.
Quote:
Originally Posted by stuckless View Post
As for running sagetv as a non root user, you can do it, but you'll want to spend a lot of time understanding how permissions work, and ensure that your grant the sagetv user access to hardware device nodes, and directories.
I dont need to run the service as a regular user, i just need the service to run while i'm logged into a user account. that way I canset it to autologin after a power failure or something.

Thanks for your input so far it has been a real help. i think im close to getting this, but im not good at linux.

Last edited by Kevintimm; 12-31-2008 at 12:03 PM.
Reply With Quote
  #7  
Old 12-31-2008, 11:43 AM
kbyrd kbyrd is offline
Sage Aficionado
 
Join Date: Sep 2008
Location: SF Bay Area, CA
Posts: 282
Not specific to SageTV, but I wouldn't expect many things inside /etc/init.d to run as a non-root user. Not just people in the root or wheel group, but actually root. Sure, you can get it to work, but you really need to know what you're doing. On distros that encourage "one user per service" like www-user for Apache and Debian-Exim for exim, the init.d script is run as root and either the script drops privileges to another user or the application itself does it.
Reply With Quote
  #8  
Old 12-31-2008, 11:46 AM
kbyrd kbyrd is offline
Sage Aficionado
 
Join Date: Sep 2008
Location: SF Bay Area, CA
Posts: 282
Quote:
Originally Posted by Kevintimm View Post

I dont need to run the service as a regular user, i just need the service to run while i'm logged into a user account. that way I canset it to autologin after a power failure or something.
BIG CAVEAT: I'm not using SageTV on Linux yet so I may be complete wrong here.

I don't understand this. It is my impression that after installation SageTV has a service script in /etc/init.d and that it's setup to have start/stop at the various runlevels. If that is the case, the server should start up automatically when you reboot, even before your Linux box has presents you with a login prompt and almost certainly before you graphical desktop starts up.

Are you trying to run the SageTV UI automatically once you do a graphical login to the desktop?
Reply With Quote
  #9  
Old 12-31-2008, 12:07 PM
Kevintimm Kevintimm is offline
Sage User
 
Join Date: Jan 2006
Posts: 32
that is how i understood it also. but that doesnt happen. my comp wont run the server automaticly. that is where i am confused also. it should work but for some reason which I cant see, it doesn't. I also could car less about the GUI. its just that the server service wont run properly. it says its running but I cant connect to it until I do a
Code:
 sudo /etc/init.d/sagetv restart
. thanks for the reply

Last edited by Kevintimm; 12-31-2008 at 12:09 PM.
Reply With Quote
  #10  
Old 12-31-2008, 01:22 PM
kbyrd kbyrd is offline
Sage Aficionado
 
Join Date: Sep 2008
Location: SF Bay Area, CA
Posts: 282
The initial startup from init.d is as root and if that is not working it's a different problem that user permissions. Weird. Where does it say it is running? with the ps command?
Reply With Quote
  #11  
Old 12-31-2008, 02:11 PM
rz888951 rz888951 is offline
Sage User
 
Join Date: Jun 2007
Posts: 18
Had the same issue running Ubuntu 8.04. I renamed the sagetv script in the rc2.d directory(I thought this was the default run-level of Ubuntu) to S94sagetv from S20... On my system there are six or seven S20... scripts so I thought it might be gumming things up with Sage.
Reply With Quote
  #12  
Old 12-31-2008, 03:14 PM
kbyrd kbyrd is offline
Sage Aficionado
 
Join Date: Sep 2008
Location: SF Bay Area, CA
Posts: 282
Quote:
Originally Posted by rz888951 View Post
Had the same issue running Ubuntu 8.04. I renamed the sagetv script in the rc2.d directory(I thought this was the default run-level of Ubuntu) to S94sagetv from S20... On my system there are six or seven S20... scripts so I thought it might be gumming things up with Sage.
That just means SageTV will start later. That could be it, if Sage depends on something else being started first then going later might help.
Reply With Quote
  #13  
Old 12-31-2008, 08:44 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
i tried sudo /etc/init.d/sagetv start and it said that it was already running
Then it would seem that the service is being started...

Try rebooting, then login as a regular user and enter the following command
Code:
ps aux | grep sagetv
If it's running, then you should see something like
Code:
java -Dsage.paths.tools=/opt/sagetv/server -Djava.awt.headless=true -DUSERKEY
If you see nothing, then it's not running.

If it's running but a client won't connect, then that's a different issue than the service not starting.

Have you tried using the placeshifter on the same linux box to connect to the server on the same box?
Reply With Quote
  #14  
Old 01-04-2009, 04:03 PM
Kevintimm Kevintimm is offline
Sage User
 
Join Date: Jan 2006
Posts: 32
thanks for the suggestions everyone. I was unable to get this to work due to my lack on linux experiance. I have since purchased a windows license as an easy way out. once i get a little better at linux i think i'll give it another go since I still have that license also.

thanks for the help everyone it was apperciated.
Reply With Quote
  #15  
Old 01-05-2009, 04:22 PM
bastafidli bastafidli is offline
Sage Expert
 
Join Date: Dec 2007
Location: Charlottesville, VA
Posts: 728
You may want to look at this thread

http://forums.sagetv.com/forums/showthread.php?t=33133

when I run sage through sudo, I got always corrupted Win.biz. The problem was in different path between when running as root and sudo.
__________________

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
  #16  
Old 01-13-2009, 05:01 PM
jpappas jpappas is offline
Sage User
 
Join Date: Feb 2007
Location: Texas USA
Posts: 47
Running sage as non-root...

Hey all,

Apparently, a couple of programs (in this case VLC) have begun to prohibit running as non-root. I outlined the problem here in my recent post in the neilm's webserver thread. I do not see any documentation related to running as non-root. I am sure that I could get it all to run as non-root, but I am lazy (not to mention I am trying to stay reasonably close to factory to minimize impact on the rare email to support).

What do you all think? Should Sage move standard to non-root (like oracle or other apps)?

Thanks!
jp
Reply With Quote
  #17  
Old 01-13-2009, 05:16 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I haven't tried it, but I would think that making sage run as non-root would be trivial. The issue would be ownership permissions on devices and directories. As long as the ownership is set correctly, there is no reason that Sage can't run as regular user. I think that sage has chosen to run as root to avoid all the stupid "sage can't see my tuner card" questions because the v4l device node changed ownership.
Reply With Quote
  #18  
Old 01-13-2009, 05:42 PM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
I run SageTV as non-root. Not difficult at all to set up.

Code:
chown -R sagetv /opt/sagetv/server
chown -R sagetv /var/media/* # You may want to be more specific, but not me
Then I modify /opt/sagetv/server/startsage and /opt/sagetv/server/stopsage for the pid file creation.

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #19  
Old 01-14-2009, 03:14 PM
jpappas jpappas is offline
Sage User
 
Join Date: Feb 2007
Location: Texas USA
Posts: 47
Running sage as non-root...

Thanks b & stuckless! You guys are awesome!

I have changed file ownership as outlines and can see how to change the pid file location to be less non-root friendly, but I do not understand how to launch the system at boot and run in proper context

How do you launch via init.d and switch user context?

Thanks!
jp
Reply With Quote
  #20  
Old 01-14-2009, 05:50 PM
kbyrd kbyrd is offline
Sage Aficionado
 
Join Date: Sep 2008
Location: SF Bay Area, CA
Posts: 282
A couple of ways to launch via init.d.

1) edit rc.local. Most distros run rc.local as the last thing they do before init.d is done. Any lines in that file get run.

OR

2) Create your own script and put it in /etc/init.d/ Then get your script turned on and off at the various runlevels. How you do this is distro specific, sometimes it's chkconfig, sometimes it's something else. At the lowest level, you can just create symlinks in the various rc[0-9].d directories. Copy an example from something in /etc/rc3.d/ like /etc/rc3.d/cron. It


Now about switching to another user. There are many ways to do this, but init.d runs as root and doing 'su -c /opt/sagetv/server/startsage sageusername' in a script like rc.local will run that command as 'sageusername'
__________________
Current Server: Sage v7.1.9.1 beta w/ Diamond UI on Ubuntu 11.10 x86_64 | Storage: Linux md's raid10,f2 | Client: HD300 extender | Tuner: HDHomeRun for QAM
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
Moved back to Windows from Linux mahcsm SageTV Linux 8 12-02-2008 05:45 PM
Some problems w/ GUI after new SageMC install jp1982 SageMC Custom Interface 2 11-29-2008 11:18 AM
I want to migrate to linux but... dnlmln SageTV Linux 3 09-27-2008 08:45 AM
ATI to Offer HD Playback with Linux bjterry62 Hardware Support 0 09-02-2008 01:56 PM
Linux or WHS? tmiranda SageTV Linux 8 08-12-2008 05:43 PM


All times are GMT -6. The time now is 09:19 AM.


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