INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Start only mediaserver at boot  (Read 7123 times)

Wybe

  • World Citizen
  • ***
  • Posts: 129
Start only mediaserver at boot
« on: June 06, 2015, 08:23:56 am »

I installed a 32-bit "minimal" version of Debian Jessie on a small (size and performance) computer. Also installed vino (vnc server) for remote access (vnc viewer from an iMac). As I understand from another post, one can start only the mediaserver by using "mediacenter20 /mediaserver". Now I want to only start the mediaserver at boot. It appears that the crontab job @reboot does not work in Jessie. Is that correct? Can someone provide me with some simple tips and tricks to only start the mediaserver at boot. The only purpose of this computer is to run MC20. Thanks in advance!
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5181
  • "Linux Merit Badge" Recipient
Re: Start only mediaserver at boot
« Reply #1 on: June 06, 2015, 08:39:35 am »

@reboot cronjobs work fine in Jessie for me.  You're probably hitting a different issue.  Mediacenter requires an xserver in order to run, if x isn't started, mediacenter will just segfault. 

Is your device headless?  If so you need to also enable your vncserver on boot first, or force X11 to initialize without a monitor. 

I wrote up a simple way to do this on a raspberry pi over here:
http://yabb.jriver.com/interact/index.php?topic=95578.msg674431#msg674431

Obviously you won't need to follow all those steps (and would need to tweak others) as you've got some of the pieces installed already, and some of the steps are Pi specific.  The script's the main thing to look at.

You need to export a user, start a VNC server that creates a virtual display, export the display, and then start mediacenter.  That should do it.

You can also force the display to initialize by doing custom configuration of your Xorg.conf, but the virtual display method is way easier.
Logged

Wybe

  • World Citizen
  • ***
  • Posts: 129
Re: Start only mediaserver at boot
« Reply #2 on: June 06, 2015, 01:30:12 pm »

Thanks for the quick response. I'll have a look at your tutorial. Much appreciated!
Logged

Wybe

  • World Citizen
  • ***
  • Posts: 129
Re: Start only mediaserver at boot
« Reply #3 on: June 09, 2015, 03:54:31 am »

I did a clean install of 32-bit Debian Jessie, installed MC20 from the Terminal and followed the instructions for headless setup. Nice, it works! (of course) When I remotely connect now using vnc on my iMac, I get a view of MC20 and I can configure MC20 (for now I removed the /mediaserver part from the startup script). I can't boot/reboot remotely, start the Terminal or the File Manager and so on. Is this the way it should be or do need some more configuration?
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5181
  • "Linux Merit Badge" Recipient
Re: Start only mediaserver at boot
« Reply #4 on: June 09, 2015, 07:42:13 am »

I can't boot/reboot remotely, start the Terminal or the File Manager and so on. Is this the way it should be or do need some more configuration?

That's not usual.  Do you see any icons/bars when you log in to VNC, or just MC on a grey screen?  What desktop environment did you install as part of your debian installation?  You might need to edit the file at ~/.vnc/xstartup to make sure it's launching your desktop environment.
Logged

Wybe

  • World Citizen
  • ***
  • Posts: 129
Re: Start only mediaserver at boot
« Reply #5 on: June 09, 2015, 08:27:56 am »

I just see MC20 on a grey screen. I installed the standard desktop (preselected) enviroment (no Gnome, KDE …). Does it make a difference if you make the crontab job as root or as user (= wybe)? How should I edit the xstartup file? Thank you for your advice and patients!
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5181
  • "Linux Merit Badge" Recipient
Re: Start only mediaserver at boot
« Reply #6 on: June 09, 2015, 08:33:27 am »

I just see MC20 on a grey screen. I installed the standard desktop (preselected) enviroment (no Gnome, KDE …).

Ok it's not loading any desktop environment, just xterm.  The standard preselected desktop in Debian is Gnome, which isn't a particularly good pick for a headless server (fairly memory and graphics intensive).  If you were doing it again, I might recommend installing xfce4 or lxde (something light), and you still can if you want to.  But for now, you are where you are, so let's focus on getting things working.

Can you post the current contents of your xstartup file?

Quote
Does it make a difference if you make the crontab job as root or as user (= wybe)?

You should do it as a user, not as root. 
Logged

Wybe

  • World Citizen
  • ***
  • Posts: 129
Re: Start only mediaserver at boot
« Reply #7 on: June 09, 2015, 08:47:04 am »

While you answered I already looked for the file xstartup, but I can't find it (from Files, I selected Computer and did a search for xstartup). I did not install Gnome. When I installed Jessie the option "Standard desktop" is selected and "Standard utilities". I only deselected "Print server". I could have selected Gnome, KDE etc., but I didn't. So, I guess I'm on a really standard (minimal) desktop. For me it's no problem to do a clean install of xfce4.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5181
  • "Linux Merit Badge" Recipient
Re: Start only mediaserver at boot
« Reply #8 on: June 09, 2015, 08:58:43 am »

While you answered I already looked for the file xstartup, but I can't find it (from Files, I selected Computer and did a search for xstartup). I did not install Gnome. When I installed Jessie the option "Standard desktop" is selected and "Standard utilities". I only deselected "Print server". I could have selected Gnome, KDE etc., but I didn't. So, I guess I'm on a really standard (minimal) desktop. For me it's no problem to do a clean install of xfce4.

Wybe the standard debian desktop is Gnome: http://www.webupd8.org/2014/09/debian-switches-back-to-gnome-from-xfce.html

If you picked "standard desktop" you got gnome.  Does your desktop look like this: http://en.wikipedia.org/wiki/GNOME#/media/File:GNOME_Shell.png

.vnc is a hidden directory; you need to make sure that the file manager program is configured to show hidden files and folders.
Logged

Wybe

  • World Citizen
  • ***
  • Posts: 129
Re: Start only mediaserver at boot
« Reply #9 on: June 09, 2015, 09:20:31 am »

Yes, my desktop looks the same. I did select "Show hidden files", but no hits on a search for .vnc or xstartup.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5181
  • "Linux Merit Badge" Recipient
Re: Start only mediaserver at boot
« Reply #10 on: June 09, 2015, 09:58:04 am »

Yes, my desktop looks the same.

Ok we've confirmed that you're running Gnome (this will be important once we find your xstartup as every desktop environment must be launched differently).

Quote
I did select "Show hidden files", but no hits on a search for .vnc or xstartup.

I provided the path to it above, you might want to try browsing to it directly instead of using the search function.  Gnome's file manager does not (in my experience) have a particularly reliable search function when it comes to hidden files.  

To be clear, the .vnc directory will be in your user's home directory if you've run VNC as your user even once.  If you still can't see it in the file manager, try using the terminal; it's at ~/.vnc/xstartup, which is the same as /home/your-user-name/.vnc/xstartup.  If you have no .vnc directory, either you've been running it as root (Which you shouldn't) or there's something else is wrong with the setup.
Logged

Wybe

  • World Citizen
  • ***
  • Posts: 129
Re: Start only mediaserver at boot
« Reply #11 on: June 09, 2015, 04:17:09 pm »

I couldn't find the xstartup file and I decided, like you suggested, to install for Debian Jessie the LXDE enviroment. When installing tightvncserver, now I saw the xstartup file was created in my home directory. I went through the tutorials and got it working! Thanks! I assumed autologin has to work and found a solution, because by default the option "don't ask for password" is not selectable. Still there are some minor issues to solve: 1. after a (re)boot, there is always the message "no session for pid <x>" and 2. I can't reboot from the desktop enviroment (when I select the shutdown icon on the lower right side it opens, but when I select Shutdown or Reboot I get a message "access denied"), but only via the root terminal. I appreciate more help with Linux, but understand that your help has limits, because we're on a JRiver forum. Thanks anyway!
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5181
  • "Linux Merit Badge" Recipient
Re: Start only mediaserver at boot
« Reply #12 on: June 09, 2015, 04:57:08 pm »

I couldn't find the xstartup file and I decided, like you suggested, to install for Debian Jessie the LXDE enviroment. When installing tightvncserver, now I saw the xstartup file was created in my home directory. I went through the tutorials and got it working! Thanks! I assumed autologin has to work and found a solution, because by default the option "don't ask for password" is not selectable. Still there are some minor issues to solve: 1. after a (re)boot, there is always the message "no session for pid <x>" and 2. I can't reboot from the desktop enviroment (when I select the shutdown icon on the lower right side it opens, but when I select Shutdown or Reboot I get a message "access denied"), but only via the root terminal. I appreciate more help with Linux, but understand that your help has limits, because we're on a JRiver forum. Thanks anyway!

Glad you got it working.  Both of those issues (the no session pid error and the shutdown/reboot buttons not working correctly) are consequences of running LXDE in a virtual desktop (like tightVNC uses).  They're a side effect of the easy setup.  There are more complicated ways to setup remote access that avoid those issues, but with the "easy" way, they're expected outcomes (I see the same issues with LXDE, but not with all other desktop environments). 

As you figured out, you'll need to shutdown using the terminal with "sudo" (or using root terminal).

Ideally though, you won't have to turn off a headless server off too often  ;)
Logged
Pages: [1]   Go Up