Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WD MyCloud and Minimserver
07-02-2018, 16:40
Post: #51
RE: WD MyCloud and Minimserver
(04-02-2018 22:18)simoncn Wrote:  ...

Please try removing the PATH line and creating a minimstart.conf file as described in this post (using the correct path to the java executable on your system). If you do this together with the S99 change, does this enable MinimServer to start automatically?

Hmm.. no, that appears not to work (but I can test something else, if you can figure it out)

MyBookLive:~# ls -tral /shares/Public/Minim/minimserver/etc/minimstart.conf <-- check I made it right...
-rw-rw-rw- 1 root root 47 Feb 7 13:40 /shares/Public/Minim/minimserver/etc/minimstart.conf
MyBookLive:~# tail -100 /shares/Public/Minim/minimserver/etc/minimstart.conf <--- list the contents...
JAVA=/shares/Public/Java/ejre1.7.0_75/bin/java
MyBookLive:~# ls /shares/Public/Java/ejre1.7.0_75/bin/java
/shares/Public/Java/ejre1.7.0_75/bin/java <-- yes, this is where java is.
MyBookLive:~# ls -tral /shares/Public/Minim/minimserver/data/minimserver-out.log
-rw-rw-rw- 1 root root 79 Feb 7 15:08 /shares/Public/Minim/minimserver/data/minimserver-out.log
MyBookLive:~# tail -100 /shares/Public/Minim/minimserver/data/minimserver-out.log <-- log contents after reboot. (minim not started.)
/shares/Public/Minim/minimserver/bin/startd: line 125: java: command not found
MyBookLive:~# /etc/rc2.d/S99minimserver start <--- yep. That still works in the shell environment...
MyBookLive:~# which java <-- check where java really is...
/usr/local/bin/java
MyBookLive:~# ls -tral /usr/local/bin/java
lrwxrwxrwx 1 root root 41 Jan 31 11:45 /usr/local/bin/java -> /shares/Public/Java/ejre1.7.0_75/bin/java
MyBookLive:~#
Find all posts by this user
Quote this message in a reply
07-02-2018, 18:33
Post: #52
RE: WD MyCloud and Minimserver
Your minimstart.conf file should contain java= (lower case), not JAVA=.
Find all posts by this user
Quote this message in a reply
07-02-2018, 19:17
Post: #53
RE: WD MyCloud and Minimserver
(07-02-2018 18:33)simoncn Wrote:  Your minimstart.conf file should contain java= (lower case), not JAVA=.

Ah yes - that helps. It works now.

Let me know if you want me to try out the out-of-the-box installation.

Also, I found http://manpages.ubuntu.com/manpages/prec...c.d.8.html which helps explain how to customize the init process, and seems like a safe (but complex!) way to set things up - mybooklive has this update-cr.d command and the .legacy-bootordering is an empty file. There is no insserv command.

Hope that helps more than it confuses...
Find all posts by this user
Quote this message in a reply
07-02-2018, 19:56
Post: #54
RE: WD MyCloud and Minimserver
Thanks for confirming this. The only other difference is the S99 change. This appears to default to S01 if NN is not specified as an argument to update-rc.d, which would cause MinimServer to be started earlier in the boot process than with S99. Some descriptions of update-rc.d don't mention the NN argument, so I am not sure whether I can rely on this working for all platforms. If you could try "out of the box" (which I presume would use S01), I would appreciate it.

I am not familiar with either .legacy-bootordering or insserv. MinimServer doesn't use either of these.
Find all posts by this user
Quote this message in a reply
08-02-2018, 12:28
Post: #55
RE: WD MyCloud and Minimserver
(07-02-2018 19:56)simoncn Wrote:  Thanks for confirming this. The only other difference is the S99 change. This appears to default to S01 if NN is not specified as an argument to update-rc.d, which would cause MinimServer to be started earlier in the boot process than with S99. Some descriptions of update-rc.d don't mention the NN argument, so I am not sure whether I can rely on this working for all platforms. If you could try "out of the box" (which I presume would use S01), I would appreciate it.

I am not familiar with either .legacy-bootordering or insserv. MinimServer doesn't use either of these.


To try and unravel the update-rc.d knot a little, I tried the following:

MyBookLive:~# update-rc.d -n minimserver defaults
Adding system startup for /etc/init.d/minimserver ...
/etc/rc0.d/K20minimserver -> ../init.d/minimserver
/etc/rc1.d/K20minimserver -> ../init.d/minimserver
/etc/rc6.d/K20minimserver -> ../init.d/minimserver
/etc/rc2.d/S20minimserver -> ../init.d/minimserver
/etc/rc3.d/S20minimserver -> ../init.d/minimserver
/etc/rc4.d/S20minimserver -> ../init.d/minimserver
/etc/rc5.d/S20minimserver -> ../init.d/minimserver


The default priority of 20 is obviously arbitrary, and anyway not appropriate for the corresponding shutdown stages (the K's - which should be at 100-the S's priority), but this result describes which rcN.d links are created. Note that the -n option is for 'don't actually do anything'

Instead, I tweaked the command and tested out the following:

MyBookLive:~# update-rc.d minimserver start 85 2 3 4 5 . stop 15 0 1 6 .
Adding system startup for /etc/init.d/minimserver ...
/etc/rc0.d/K15minimserver -> ../init.d/minimserver
/etc/rc1.d/K15minimserver -> ../init.d/minimserver
/etc/rc6.d/K15minimserver -> ../init.d/minimserver
/etc/rc2.d/S85minimserver -> ../init.d/minimserver
/etc/rc3.d/S85minimserver -> ../init.d/minimserver
/etc/rc4.d/S85minimserver -> ../init.d/minimserver
/etc/rc5.d/S85minimserver -> ../init.d/minimserver


Priority 85 is what is used by another (ahem) media server on my installation.

This can't be a global (all unixes) solution, since - as described here - BSD distributions don't have the rcN.d directories, and some other Linux's have them, but not the update-rc.d command. Could you test for the presence of the command?
Find all posts by this user
Quote this message in a reply
09-02-2018, 15:36
Post: #56
RE: WD MyCloud and Minimserver
This command (specifying SS=85 and KK=15) is working for you because the WD MyCloud has a /etc/init.d/.legacy-bootordering file. I tried the same command on a Debian system that uses dependency-based boot sequencing and it created all the links as S01 and K01. With dependency-based boot sequencing, it isn't possible to specify absolute SS and KK numbers but it is possible to specify $all in the service file to force the service to start last and stop first (presumably suitable for MinimServer).

So a possible approach would be:

Code:
if update-rc.d exists then
    if .legacy-bootordering exists then
        use update-rc.d to create start links as 99 and stop links as 01
    else
        use update-rc.d with $all in the service file
    fi
fi

There is already some special code for certain systems without update-rc.d and I don't propose to change this at present because of the risk of breaking things.
Find all posts by this user
Quote this message in a reply
20-02-2018, 23:27
Post: #57
RE: WD MyCloud and Minimserver
I have made this change in a test build. Please check your PMs for details of how to download the test build. Many thanks!
Find all posts by this user
Quote this message in a reply
22-02-2018, 12:06
Post: #58
RE: WD MyCloud and Minimserver
(20-02-2018 23:27)simoncn Wrote:  I have made this change in a test build. Please check your PMs for details of how to download the test build. Many thanks!

The test build works well. Thanks.

As a way of providing multiple versions of my content files (my TV only understands mp3 files) I set up a second minimserver and found it installed an appropriate additional startd command in /etc/init.d/minimserver so extra applause is due for this Cool

See PM reply for more feedback.
Find all posts by this user
Quote this message in a reply
16-03-2018, 22:06 (This post was last modified: 16-03-2018 22:12 by Soli.)
Post: #59
RE: WD MyCloud and Minimserver
(04-02-2018 13:09)Tbanks103 Wrote:  I can't see that new thread, but I have made the init process on my MyBookLive kick off the minimserver.

Here's the net effect of what I did (see below for the twists along the way):

Create the attached file as /etc/init.d/minimserver - note that it refers to the location of the minimserver installation - this may need editting. Then, at the comand prompt:

MyBookLive:~# chmod 755 /etc/init.d/minimserver
MyBookLive:~# ln -s ../init.d/minimserver /etc/rc2.d/S99minimserver


This creates a link from /etc/rc2.d to the executeable file in /etc/init.d
Executeables in rc2.d are run at the second phase of reboot and S99... files are invoked at the last gasp (ie 99th out of 99).

After creating the file & permission & link, the command:

MyBookLive:~# /etc/rc2.d/S99minimserver start

Will start minimserver, and this will be invoked at reboot.

Now the twists: at first, I created the /etc/init.d/minimserver file with the contents "cd /shares/Public/Minim/minimserver/bin && ./startd ; cd -" and on running it for the first time, got the message
Migrating autostart configuration
This is issued by minim, and the file is replaced with contents close to the attached file. However, the PATH doesn't contain Java, so I put this in: "PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

Thanks to all for helping make this work, special thanks to Simon.
Greetings. I forgot all about it. I just logged in today to start a new thread and saw this.
What I did was to verify that mybooklive actually did parse SYSV files. After I did that, I knew that wasn't the reason Minimserver didn't automatically start.
Earlier in the thread someone just made a symlink to java. (if /opt/Java is where you extracted java, and the version is ejre1.7.0_75) "ln -s /opt/Java/ejre1.7.0_75/bin/java /usr/local/bin/java". For some reason that works fine when manually starting Minimserver but not automatically. There probably a technical reason for that, but I don't really care. (but it was probably the path missing in either the SYSV file or conf)

The solution is simple:
Install our custom java the normal way!
#update-alternatives --install /usr/bin/java java /opt/Java/ejre1.7.0_75/bin/java 100

That's all!

To verify
#update-alternatives --display java

Then just run the Minimserver startd command if you haven't already

#/opt/minimserver/bin/startd

No need to mess around with anything else whatsoever.

I'm also running a pure Debian 8 on my newer MyCloud gen2, it too works perfectly with Minimserver!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)