XBMC Server
#1
Hi,

For my current setup I have a computer that is in my room.
this computer is running Ubuntu + XBMC + SABNzbd + Sickbeard
and it is used as backend
Things getting downloaded, xbmc getting notify, and doing library update.
This computer also runs SQL Server and video library is on it.
so he plays only as "Backend".

Now at the living room I have another computer that runs windows and uses the same SQL as the backend does. So I play all of the shows there. On the widescreen.
This is my frontend.

Now if the backend restarts xbmc doesn't start with the system since that's a usermode app and not service.
is there is anyway to run xbmc as service only to do franquent library updates + response to update requests from Sickbeard?
I need this also because if xbmc geting crushed I need to reopen this myself. If it were a service that was much helpful.

Any ideas/thoughts about that?
Reply
#2
Any one?
Reply
#3
This is certainly possible in Windows - well you can't run XBMC as a service but you can configure auto-logon and run it as an app. I assume something similar can be done in Linux, but this sounds like a Linux question rather than an XBMC question.

JR
Reply
#4
Searching with your topic title, should have answered your question:
http://forum.xbmc.org/showthread.php?tid=105883
http://forum.xbmc.org/showthread.php?tid=107931

In short: This is a much wanted feature but nobody is working on this yet...
Reply
#5
Thank you!
Reply
#6
Note: This isn't a "service" fix, but it starts XBMC for me when the system boots.

I'm running a Gentoo Linux system and wanted XBMC to start automatically when the computer booted. I don't use this system with a graphical desktop (this is more of a home "play" server with XBMC running as a perk). You may be able to do something similar on Ubuntu, but you'll have to look around.

I'm not sure of everything i did to get this working because it's been a long while since i did this, but i'll post what i do remember here. Notice, I'm a novice-intermediate linux user at best and there are probably better ways of doing this.... but...

I got my system to login to the root account automatically by modifying my inittab file.... (YES, i know, bad practice but this is a play system and not something secure)

/etc/inittab
Code:
# TERMINALS
c1:12345:respawn:/sbin/mingetty --autologin root tty1 linux

Then i modified the the xinitrc script so the failsafe section had xbmc as the first option. This script gets run when the "startx" command is run. Remember, i don't have a graphical desktop installed so my system checks for other options.

/etc/X11/xinit/xinitrc
Code:
if [ -n "$failsafe" ]; then
        [b]xbmc[/b] &
        twm &
        xclock -geometry 50x50-1+1 &
        ....etc

After that i modified my bashrc script, which is responsible for setting up the initial environment at login, to run the "startx" command UNLESS an X session is running already. (Don't want another X session starting if it's already running)

/etc/bash/bashrc (added this to end of file...)
Code:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
   startx
fi

As i said, i'm sure it's different on Ubuntu and there are probably better ways to do it, but i'm sure there is a way. Just look around for creative solutions. Read, read and read some more.

Good Luck.
Reply
#7
Thanks for the answer.
this computer running in graphical mode
so doing this isn't good for me
another reason is that this computer does more stuff
So I'm running xbmc I'm window mode and minimize.
but thanks alot for your time Smile
Reply
#8
DxCx Wrote:Thanks for the answer.
this computer running in graphical mode
so doing this isn't good for me
another reason is that this computer does more stuff
So I'm running xbmc I'm window mode and minimize.
but thanks alot for your time Smile

No problem.

Something else you may want to look into, is a process monitor for linux. Basically something that will run and watch XBMC in the process list. If it stops, the process monitor should restart it.

A few i found with some Google searching:
http://mmonit.com/monit/
http://kin.klever.net/dudki/

I've never used one, so do your research. Good weekend project maybe. Nod

You could also look at a script of some sort, that you could run via a cron job every few minutes. There is always more then one way to do something, just got to be creative.

Good Luck!
Reply
#9
Quote:Now if the backend restarts xbmc doesn't start with the system since that's a usermode app and not service.

Well, the first part of your question "start after reboot on a desktop system" can be easily fixed by enabling autologin & add xbmc in auto start.

This is not perfect but this is what you get with the current xbmc on a desktop system without writing your own script. I am not even sure if it is possible to autostart a desktop program before login. Does the gnome session exists before login? Guess not.

On a "headless" system is somewhat better except it will not be truly headless. Just run xbmc-live on the unused console and dont look at it. The rest of the system will act as a normal server. Problem is that you need a graphical card & xorg installed. Not sure how much power it will drain but make sure that set the screen saver to black.
Reply
#10
There is a patch around for this purpose:
http://forum.xbmc.org/showthread.php?tid...t=headless
Reply
#11
Another option is to use nodm to auto start XBMC.

First install nodm and update the configuration, (taking a backup just in case):
Code:
sudo apt-get install nodm
sudo cp /etc/default/nodm /home/xbmc/nodm.bkup
sudo nano /etc/default/nodm

Edit the config file as follows:
Code:
# nodm configuration
# Set NODM_ENABLED to something different than 'false' to enable nodm
NODM_ENABLED=true
# User to autologin for
NODM_USER=xbmc
# xinit program
NODM_XINIT=/usr/bin/xinit
# First vt to try when looking for free VTs
NODM_FIRST_VT='7'
# X session
NODM_XSESSION=/etc/X11/Xsession
# Options for the X server
NODM_X_OPTIONS='vt7 -nolisten tcp'
# If an X session will run for less than this time in seconds, nodm will wait an
# increasing bit of time before restarting the session.
NODM_MIN_SESSION_TIME=60

Then create an xsession config file for the XBMC user, which nodm will look to in order to determine whip program to run:
Code:
sudo nano /home/xbmc/.xsession

.xsession will look like this:
Code:
#!/bin/sh
xbmc

Now make it executable:
Code:
sudo chmod +x /home/xbmc/.xsession

Finally, allow any user to launch an X server session.
Code:
sudo dpkg-reconfigure x11-common
When prompted, choose to let anyone launch its own X server.

Now, when you reboot, XBMC will launch with no display manager running.

Notes:
  1. Please, please ensure that you have SSH access working before you try this, or you will never be able to get back into the box.
  2. If you need to disable nodm for any reason, SSH in and edit /etc/default/nodm, changing the NODM_ENABLED value to false.
Reply

Logout Mark Read Team Forum Stats Members Help
XBMC Server0