INTERACT FORUM

Please login or register.

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

Author Topic: JRiver on Raspberry Pi disappears  (Read 7727 times)

PSH

  • Recent member
  • *
  • Posts: 23
JRiver on Raspberry Pi disappears
« on: September 02, 2016, 08:06:36 am »

I have been running Version 21 on a Raspberry Pi reasonably successfully for some time now.  However, every few days it does somehow manage to disappear (crash?).  I can login remotely and start it up again but it would be far better if it just carried on running continuously.  Does anyone have any ideas what I should be looking for?
Many thanks.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5162
  • "Linux Merit Badge" Recipient
Re: JRiver on Raspberry Pi disappears
« Reply #1 on: September 02, 2016, 08:11:40 am »

I have been running Version 21 on a Raspberry Pi reasonably successfully for some time now.  However, every few days it does somehow manage to disappear (crash?).  I can login remotely and start it up again but it would be far better if it just carried on running continuously.  Does anyone have any ideas what I should be looking for?
Many thanks.

I've seen similar periodic crashes a while back, and I wasn't able to identify the cause.  Eventually I stopped having the problem for ewqually mysterious reasons.  The most likely cause is an out of memory condition; make sure you've set the thumbnailing priority to "low" under options as that's a major culprit. 

A workaround is to run a script on a timer that checks to see if MC is running and restarts it if it isn't.  I used to run a script like that and it works great (you can find an example in the Pi quick start guide in teh second post).
Logged

PSH

  • Recent member
  • *
  • Posts: 23
Re: JRiver on Raspberry Pi disappears
« Reply #2 on: September 02, 2016, 10:09:10 am »

Many thanks for your swift reply and suggestions.
I've changed the thumbnail priority so I'll wait and see what happens.
Your script idea sounds excellent and I'll move on to that if the above doesn't solve the problem.
I am a bit baffled though about the script as I'm using RDP a la Hilton.  I found your restart script in that thread but I think the way it is presented assumes that the reader (i.e. me) has a level of programming expertise that I certainly don't have.  Any further hints would be gratefully received.
Thanks again.
Logged

PSH

  • Recent member
  • *
  • Posts: 23
Re: JRiver on Raspberry Pi disappears
« Reply #3 on: September 04, 2016, 11:54:05 am »

Aaargh! It's gone again - so the thumbnail option didn't do the trick.
I've upgraded from version 21 to 22 to see whether that might do it.
If not, I'll be back to you about your magic script!
Logged

PSH

  • Recent member
  • *
  • Posts: 23
Re: JRiver on Raspberry Pi disappears
« Reply #4 on: September 07, 2016, 05:30:04 am »

OK - so upgrading to version 22 hasn't solved it.
Studying the startup script instructions makes me realise that I had in fact implemented the start at boot script but it never in fact worked............so the periodic check doesn't work either.
I'm wondering whether this is because crontab is in a strange place.  In my system it is at /tmp/crontab.qGKSmc/crontab.
Any comments gratefully received.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5162
  • "Linux Merit Badge" Recipient
Re: JRiver on Raspberry Pi disappears
« Reply #5 on: September 07, 2016, 04:56:26 pm »

OK - so upgrading to version 22 hasn't solved it.
Studying the startup script instructions makes me realise that I had in fact implemented the start at boot script but it never in fact worked............so the periodic check doesn't work either.
I'm wondering whether this is because crontab is in a strange place.  In my system it is at /tmp/crontab.qGKSmc/crontab.
Any comments gratefully received.

How did you edit the crontab?  Do me a favor and provide the output of the following two commands:
Code: [Select]
crontab -l
sudo crontab -l

Also, assuming the script is called something like "headless" the output of:
Code: [Select]
cat ~/headless
ls -la ~

That should help us get to the bottom of it.
Logged

BryanC

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2550
Re: JRiver on Raspberry Pi disappears
« Reply #6 on: September 08, 2016, 10:18:14 am »

This could probably be better handled by a systemd script with Restart=Always. If you need me to write one, let me know.

https://www.freedesktop.org/software/systemd/man/systemd.service.html
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5162
  • "Linux Merit Badge" Recipient
Re: JRiver on Raspberry Pi disappears
« Reply #7 on: September 08, 2016, 10:43:53 am »

This could probably be better handled by a systemd script with Restart=Always. If you need me to write one, let me know.

https://www.freedesktop.org/software/systemd/man/systemd.service.html

I agree; I actually use a systemd service instead of a cron entry at home (I use restart=on-failure instead of restart=always so I can still manually close MC through the UI). 

The reason I used a cron entry in the guide was because a significant portion of the pi installed base was (is?) on wheezy (old-stable) which doesn't use systemd.  I wanted a solution that would work regardless of init system and required relatively little fiddling.  At some point I'll probably substitute the systemd unit and tell Wheezy users they're on their own, but figured I'd wait for Stretch when Wheezy is officially unsupported.
Logged

PSH

  • Recent member
  • *
  • Posts: 23
Re: JRiver on Raspberry Pi disappears
« Reply #8 on: September 09, 2016, 06:49:15 am »

Many thanks for the assistance mwillems - greatly appreciated.
I was interested in the subsequent comment about systemd but I'm sticking to your original diagnostics regarding crontab.

crontab -l opens the file where I entered * * * * *  /etc/MC21start.sh > /dev/null.  It is the only active line in that file.

sudo crontab -l gives a no crontab for root message

cat /etc/MC21start.sh displays its contents as follows:

export USER=pi
ps -e | grep x11vnc || x11vnc :0 -localhost -geometry 1920x1080
export DISPLAY=':0'
ps -e | grep mediacenter || mediacenter22 /mediaserver

Your ls command modified to ls -la /etc contains the line:

-rw-r--r--  1  root  root  154  Sep  7  11:02  MC21start.sh

I am assuming that this is the line that might help but I could be wrong.
The file names and locations above are different to yours as originally I followed Hilton's instructions for RDP.
Apologies for the mash up of file names etc using both "21" and "22" - it's because I upgraded from 21 to 22 in the middle of this forum exchange.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5162
  • "Linux Merit Badge" Recipient
Re: JRiver on Raspberry Pi disappears
« Reply #9 on: September 09, 2016, 02:29:01 pm »

Many thanks for the assistance mwillems - greatly appreciated.
I was interested in the subsequent comment about systemd but I'm sticking to your original diagnostics regarding crontab.

crontab -l opens the file where I entered * * * * *  /etc/MC21start.sh > /dev/null.  It is the only active line in that file.

sudo crontab -l gives a no crontab for root message

cat /etc/MC21start.sh displays its contents as follows:

export USER=pi
ps -e | grep x11vnc || x11vnc :0 -localhost -geometry 1920x1080
export DISPLAY=':0'
ps -e | grep mediacenter || mediacenter22 /mediaserver

Your ls command modified to ls -la /etc contains the line:

-rw-r--r--  1  root  root  154  Sep  7  11:02  MC21start.sh

I am assuming that this is the line that might help but I could be wrong.
The file names and locations above are different to yours as originally I followed Hilton's instructions for RDP.
Apologies for the mash up of file names etc using both "21" and "22" - it's because I upgraded from 21 to 22 in the middle of this forum exchange.

Ok I've identified a few issues.  You put the script in an unusual location (/etc), instead of in the /home/pi directory.  By itself that's not necessarily an issue, but items in /etc have different default permissions (umask) than items in user's home directories, and however you put it there the permissions are not currently correct.  You might've skipped the chmod line in the intstructions?  In any case, the script is currently not executable for any user and is owned by root, so no one can run the script at all right now, and your user doubly can't run it.

I'd advise moving it or recreating it in your /home/pi directory for tidiness, reassigning ownership to your user (chown) and fixing the permissions (chmod).  It would probably be easiest to start over with the directions in the quick start guide, but if you want the absolute quickest fix, just chmod the script to 777, i.e. something like
Code: [Select]
sudo chmod 777 /etc/MC21start.sh

That will mark it as executable for all users and should allow the crontab entry to execute.  Another thing to make sure of: if you're not using x11vnc, be sure to remove that line.  If you are using x11vnc, no worries.
Logged

PSH

  • Recent member
  • *
  • Posts: 23
Re: JRiver on Raspberry Pi disappears
« Reply #10 on: September 10, 2016, 05:31:45 am »

I stand corrected regarding my sloppy implementation.
I will try the quickest fix first and then, as you suggest, rework in line with your best practice.  At the same time I will rationalise the nomenclature which currently is a bit embarrassing.
The use of x11vnc is linked to Hilton's method that allows RDP to be used.
Thank you very much for your great support.
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5162
  • "Linux Merit Badge" Recipient
Re: JRiver on Raspberry Pi disappears
« Reply #11 on: September 10, 2016, 06:06:32 am »

I stand corrected regarding my sloppy implementation.
I will try the quickest fix first and then, as you suggest, rework in line with your best practice.  At the same time I will rationalise the nomenclature which currently is a bit embarrassing.
The use of x11vnc is linked to Hilton's method that allows RDP to be used.
Thank you very much for your great support.


No worries;  Linux file permissions can be kind of baffling until you're used to them.  There's nothing wrong with x11vnc (and some definite advantages), I just wanted to make sure that part of the script was doing its job.
Logged
Pages: [1]   Go Up