Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Tue Aug 14, 2018 7:28 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 20 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Fri Sep 14, 2012 1:32 pm 
Offline
Newbie

Joined: Thu Apr 07, 2011 4:35 am
Posts: 23
I am aware that the script are like batch file for DOS. I am just not understanding *why* the script runs fine if ran manually, but not on a reboot/restart.

I added the nohup and at least now when I run the script manually it exit out and won't kill BubbleUPnPServer.


Top
   
PostPosted: Fri Sep 14, 2012 11:54 pm 
Offline
Regular Member

Joined: Sun May 06, 2012 1:45 am
Posts: 186
OK, I've just installed this on my NAS and it works fine.

mbze430, you have multiple issues here.

1) The changes you made to launch.sh are incorrect and don't work.

2) You are assuming that the environment (i.e. $PATH) that you get when you run the script interactively is the same as when it is run on boot up. It's not, they are different.

3) Because the script doesn't run as a daemon (or "service" in Windows-speak) it needs to be run with nohup to stop it terminating straight away.


So, do the following:

1) Go back to the stock version of /usr/local/bubbleserver/launch.sh. It should look like this:

Code:
#!/bin/sh


HOMEDIR="$(dirname ${0})"
cd ${HOMEDIR}

if [ "x$JAVA_HOME" != "x" ]; then
    JAVA="$JAVA_HOME/bin/java"
else
    JAVA="java"
fi


# to make sure ffmpeg is found and used if present in start directory
export PATH=.:${PATH}

# -Xss256k: thread stack size. 256K reduces per-thread memory usage and may prevent "java.lang.OutOfMemoryError: unable to create new native thread" on some systems
# -Djava.awt.headless=true: required for image transcoding to work on headless systems (eg no X-Window libraries)

exec "${JAVA}" -Xss256k -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -jar BubbleUPnPServer.jar $*

2) Edit /etc/rc.d/extensions.d/S99_bubble.sh so that it looks like this:

Code:
#!/bin/sh

JAVA_HOME=/usr/local/jre
export JAVA_HOME

nohup /usr/local/bubbleserver/launch.sh >/dev/null 2>&1 &

3) Make sure launch.sh and S99_bubble.sh are executable.

Code:
chmod +x /usr/local/bubbleserver/launch.sh
chmod +x /etc/rc.d/extensions.d/S99_bubble.sh

4) Reboot


Top
   
PostPosted: Sat Sep 15, 2012 7:58 pm 
Offline
Newbie

Joined: Thu Apr 07, 2011 4:35 am
Posts: 23
ColinTaylor wrote:
OK, I've just installed this on my NAS and it works fine.

mbze430, you have multiple issues here.

1) The changes you made to launch.sh are incorrect and don't work.

2) You are assuming that the environment (i.e. $PATH) that you get when you run the script interactively is the same as when it is run on boot up. It's not, they are different.

3) Because the script doesn't run as a daemon (or "service" in Windows-speak) it needs to be run with nohup to stop it terminating straight away.




@ColinTaylor ~ you my friend is the bourne shell script master! IT WORKS! Maybe you can help me with a script to mount all my additional USB HDDs too and a new Samba script :D

Thanks a million!

PS: just for my own educational purposes. this line:

Code:
nohup /usr/local/bubbleserver/launch.sh >/dev/null 2>&1 &


I know '>/dev/null' send it to "nothing"... but what does '2>&1' do?


Top
   
PostPosted: Sat Sep 15, 2012 10:09 pm 
Offline
Regular Member

Joined: Sun May 06, 2012 1:45 am
Posts: 186
I'm glad you got it to work.

Code:
nohup /usr/local/bubbleserver/launch.sh >/dev/null 2>&1 &

nohup - Invoke command and ignore hangup signals. Terminal output is sent to nohup.out unless directed otherwise.

>/dev/null - Direct standard output (stdout / file descriptor 1) to /dev/null (i.e. nowhere)

2>&1 - Direct standard error (stderr / file descriptor 2) to the same place as file descriptor 1.

& = Run job in background


Top
   
PostPosted: Tue Jul 29, 2014 7:08 pm 
Offline
Total Newbie

Joined: Tue Jul 29, 2014 6:57 pm
Posts: 1
Hello,

I am also new to this topic, but have tried already since days without any success.

I own a Buffalo Linkstation Mini (LS-WSXL).

Code:
Linux Netzlaufwerk 3.3.4-88f6281 #1 Tue Jul 9 14:48:53 JST 2013 armv5tel GNU/Linux


I am trying to make BubbleUPnPServer work also via startup script and have done the same things as described on this page here.

One time the S99_bubble.sh script loaded the server automatically after reboot but then, the servers' web config UI was empty (no values in where some should be and are in when starting it manually either via ./S99_bubble.sh or ./launch.sh).

The code of my S99_bubble.sh script is as follows:

Code:
#!/bin/sh

JAVA_HOME=/opt/ejre1.7.0_60/
export JAVA_HOME

nohup /usr/local/BubbleUPnPServer/launch.sh >/dev/null 2>&1 &


Paths are adjusted to my setup - so they are correct. Otherwise the server wouldn't start after executing the script manually.

Also I set both scripts to
Code:
chmod +x
as well as the S99_bubble.sh to
Code:
chmod 755


As suggested, I have put the script into
Code:
/etc/rc.d/extensions.d
folder.

I don't know what I made wrong - perhaps you could help me even though this thread is quite old now.

I'd really appreciate it!

Thanks a lot in advance.

BR
Stefan


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 20 posts ]  Go to page Previous 1 2

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited