WD Twonky setup changes via SSH root having no effect

So, standing on the shoulders of giants on this forum (and others) I made some changes to my WD configuration via SSH login as root, but sadly, they have had no effect; anybody know what I’m doing wrong?
Firstly, a few days ago I modified the /etc/contentdir file from the original ‘+A|Public’ to ‘+M|Public/MUSIC’ (which is where my music lies in sub-directories organised by type FLAC, AIF etc.) which I believe is “used by Twonky to set the default server folder/share upon reboot (firmware upgrade)”. However this file has ended up being overwritten with the original values…
Now, last night I did 2 reboots because I made progressive edits to ‘the’ crontab file (see below), and after the first reboot, I’m certain it had worked when I checked the Twonky GUI, but after the second reboot it has definitely overwritten the file and Twonky has reverted to Public and all file types. The only thing I can think of is that I made a backup file called ‘contentdir.bak’ (see below list) and it’s read that instead – but OS’s don’t work like that do they?
drwxr-xr-x 2 root root 4096 Sep 27 2013 calendar
-rw-rw-r-- 1 root root 10 Apr 7 20:01 contentdir
-rw-rw-r-- 1 root root 10 Apr 3 19:40 contentdir.bak
drwxr-xr-x 2 root root 4096 Jan 12 00:21 cracklib
Secondly, I only share music files so I had successfully stopped the Photo indexing processes like this:
/bin/sh /etc/rc2.d/S86wdphotodbmergerd stop
/bin/sh /etc/rc2.d/S85wdmcserverd stop
and wanted to stop them returning after a reboot/upgrade via crontab entries, as below :
root 9747 9666 0 20:08 pts/0 00:00:00 ps -ef
WDMyCloud:~# crontab -l

For more information see the manual pages of crontab(5) and cron(8)

m h dom mon dow command

@reboot /bin/sh /etc/rc2.d/S86wdphotodbmergerd stop
@reboot /bin/sh /etc/rc2.d/S85wdmcserverd stop
WDMyCloud:~#

However after 1 reboot and a ‘ps –ef’, I could still see:
usr/local/wdmcserver/bin/wdmcserver –x off
usr/local/wdmcserver/bin/wdphotodbmerger

But I note there is no ‘d’ at the end of the name…
So I thought I’d add ‘@reboot /bin/sh /etc/rc2.d/S50netatalk stop’ to the crontab to stop the Apple service and reboot again (via the WD GUI), but I can still see the netatalk (as below) and indexing services.

/usr/sbin/netatalk –F /etc/netatalk/afp.conf
/usr/sbin/afpd –d –F /etc/netatalk/afp.conf
/usr/sbin/cnid_metad –d –F /etc/netatalk/afp.conf

The crontab file was empty when I started - is there more than 1/do I need to login differently?

So I achieved nothing – can anyone spot where I’ve misunderstood the processes or is this not possible anymore? (I installed the latest upgrade about 2 weeks ago)

Sorry this is such a long post but you now have all the facts I hope!

Did you have Twonky running when you made this change? I can’t remember whether I changed the settings in Twonky first, and then changed the /etc/contentdir to reflect these changes. I’ve never had the contentdir file overwritten, except by firmware upgrade. It’s possible that stopping Twonky causing the contentdir file to be overwritten with the values from the Twonky UI.

What firmware are you running?

I don’t use cron to sort out the reboot mess with indexing, etc; I use the /CacheVolume/user-start file, because it’s the last thing called during the startup process.

Here’s my user-start file. It stops the indexing and thumbnailing tasks, stops Twonky, copies the Twonky settings files from a ‘safe’ store in share space, and then restarts Twonky. This seems to be working well.

#!/bin/sh
# User startup script
# should run automatically after every reboot, and be unaltered by firmware upgrades
# so should sort out the mess caused by firmware upgrades

# stop and disable indexing services
/etc/init.d/wdmcserverd stop
/etc/init.d/wdphotomergerd stop
update-rc.d wdmcserverd disable
update-rc.d wdphotomergerd disable

# sort out Twonky settings
#	stop Twonky server
/etc/init.d/twonky stop
#	copy saved content directory settings
cp /DataVolume/shares/Public/Software/MyCloud/contentdir /etc/contentdir
#	copy saved Twonky configuration file
cp /DataVolume/shares/Public/Software/MyCloud/twonkyserver.ini /CacheVolume/twonkymedia/twonkyserver.ini
#	restart Twonky server
/etc/init.d/twonky start

# stop RESTSDK server daemon
#	for OS3 only
#/etc/rc2.d/S20restsdk-serverd stop

# stop unwanted wakeups
#mount -o remount,noatime,nodiratime /dev/root /

The firmware version is: 04.04.02-105

Yes, Twonky was probably running when I made the change - I didn’t consider that. Bu**er!

So I should have stopped the Media Sharing in the My cloud GUI/Settings/Media first?

Thanks for sharing your user-start file. I would like to use that please but there is no such file in my /CacheVolume dir…

WDMyCloud:/CacheVolume# ll
total 72
drwxr-xr-- 3 root root 4096 Mar 8 2015 WDPROT
-rw-rw-rw- 1 www-data www-data 108 May 30 2015 alert_notify_time
drwxrwxrwx 3 root root 4096 Sep 4 2014 cake
-rw-r–r-- 1 root root 0 Oct 3 2015 device_users_updated
drwxr-xr-x 3 root root 4096 Feb 22 2015 netatalk
-rw-r–r-- 1 root root 2 Oct 3 2015 orion_cm_enabled
-rwxr-xr-x 1 root root 1077 Sep 24 2015 share_acl_backup
drwxr-xr-x 2 root root 4096 Jul 12 2012 transcodingcache
drwxrwxrw- 6 root root 4096 Apr 7 20:28 twonkymedia
-rw-r–r-- 1 root root 34265 Mar 26 13:33 update.log
drwxr-xr-x 3 root root 4096 Mar 26 13:29 upgrade
WDMyCloud:/CacheVolume#

Do I simply add a file of that name and include your script? And give it the right permissions (complicated?)

Many thanks for your help again

Yes.
chmod 777 user-start

@cpt_paranoia, can you post an example of your twonkyserver.ini so others can see what changes you’ve made to it if any? Or expound on the changes you made so others can understand what changes they should make on their end to the twonkyserver.ini.

Also what is the purpose of copying the /etc/contentdir? Under the single bay My Cloud running the latest v4.x firmware I don’t appear to have a /etc/contentdir directory.

I haven’t made many changes to the .INI file, apart from those mentioned in the FAQ. These are to do with the aggregation folders.
I copy the saved versions of the files ‘just in case’; they shouldn’t normally be needed.

Also what is the purpose of copying the /etc/contentdir? Under the single bay My Cloud running the latest v4.x firmware I don’t appear to have a /etc/contentdir directory.

Really? [sigh] Have they mucked about with it? I found that location because the Twonky startup script calls writeTwonkyContentDir.sh, which uses that file.

I’m still running 04.01.01-413. But maybe that’s changed too. I haven’t checked for some time, because everything is working… Obviously, I have the file because I copy it there.

Ah: the OP says their version gets overwritten, so theirs is obviously still in use. In 04.04.02-105

Do you have the gen 1 or gen 2 My Cloud. A gen 1 should have a file in /etc/rc2.d/S98user-start which is a symbolic link to /CacheVolume/user-start.

RAC

It’s v4 f/w, so Gen1.

It’s a file, not a directory.


Actually the question was for DNO. Since he is missing the user-start file.
But a question for you is why do you do the update-rc.d wdmcserverd disable? You have already stopped the process. Doesn’t the update disable the script until you enable it again? If you were to rename the user-start file and reboot. The system would not be in the original condition. Since those two processes would not be running.

RAC

Ooops your right, just noticed that. :slight_smile:

Actually the question was for DNO.

And my reply was on his behalf: I’d already asked him what firmware he was using as a shortcut to identify which generation it was.

why do you do the update-rc.d wdmcserverd disable?

To cope with firmware upgrades. Very belt and braces, and I don’t claim to be an expert in this stuff. But it works…

Wow, thank you all for the responses last night (Friday is beer and curry night so I didn’t check in…). A lot for me to understand here. I wouldn’t have known what Gen my unit is RAC - thanks ctp.

So, I think what I need to do is:

  1. make sure the share setting is as I want them in the Twonky GUI

  2. stop Twonky - turn off Media Sharing in the My Cloud GUI?

  3. modify (if needed) the contentdir file to suit

But, I’m not sure about the user-start after your input rac8006, so I’ve just been to /etc/rc2.d and there is a link, as you say, to a user-start as below:

lrwxrwxrwx 1 root root 26 Jan 12 00:22 S96onbrdnetloccommd -> …/init.d/onbrdnetloccommd
lrwxrwxrwx 1 root root 23 Jan 12 00:21 S98user-start -> /CacheVolume/user-start
lrwxrwxrwx 1 root root 23 Jan 12 00:21 S99wdAppFinalize -> …/init.d/wdAppFinalize
WDMyCloud:/etc/rc2.d#

And now I’m really confused:worried:, I got to /CacheVolume and the user-start file has just appeared by magic!

WDMyCloud:/etc/rc2.d# cd /CacheVolume
WDMyCloud:/CacheVolume# ll
total 72
drwxr-xr-- 3 root root 4096 Mar 8 2015 WDPROT
-rw-rw-rw- 1 www-data www-data 108 May 30 2015 alert_notify_time
drwxrwxrwx 3 root root 4096 Sep 4 2014 cake
-rw-r–r-- 1 root root 0 Oct 3 2015 device_users_updated
drwxr-xr-x 3 root root 4096 Feb 22 2015 netatalk
-rw-r–r-- 1 root root 2 Oct 3 2015 orion_cm_enabled
-rwxr-xr-x 1 root root 1077 Sep 24 2015 share_acl_backup
drwxr-xr-x 2 root root 4096 Jul 12 2012 transcodingcache
drwxrwxrw- 6 root root 4096 Apr 7 20:28 twonkymedia
-rw-r–r-- 1 root root 34265 Mar 26 13:33 update.log
drwxr-xr-x 3 root root 4096 Mar 26 13:29 upgrade
-rw-rw-rw- 1 root root 0 Apr 9 08:24 user-start

How did that happen? You can see by the ll earlier in this post, and the attributes I’m not making it up - honest.

So the link thing still puzzles me - can I just edit this ‘new’ user-start now?

The more I find out, the less I know.

You can edit using either file name. Not sure why it was not it was not visible before.

RAC

Thank you RAC. I’ll have a go now.

Well, I’ve truly gone and screwed it up now. After my last changes to the user-start file I initiated a reboot from the GUI, and after a while it was stuck at flashing/continuous white LED, while the GUI says Initializing. So I went to bed after a few cans and a bottle of wine. But it was still the same this morning but my head is worse. So I pulled the power and held in the reset button while re-attaching power and held it for 40+ seconds, and it’s still the same white flashing LED.

Oddly, I can navigate to it through the windows file explorer and see my music files, but the WD GUI still says Initializing. Anything else I can do or do I buy a Synology or something…

Did you try accessing SSH again and remove the changes you made to the user-start file then reboot to see if that fixes the white LED issue?

Yes, sorry, I should have said that I did SSH again and cleared out the user-start file this morning before the reset.

SSH into the device and check the log file for errors.

RAC