Reply
Advisor
jives11
Posts: 15
Registered: ‎10-23-2011
0
Accepted Solution

failing to change twonky default contendir - ini file always recreated

Hi,

 

I'm trying to give twonky an easier life by restricting the directories it has to crawl and index.

 

Instead of

 

# Content Locations
contentdir=+A|/Public

 

I would like to have

 

contentdir=+M|/Public/Shared Music,+V|/Shared Videos,+P|/Shared Pictures

 

 

1) If I make changes to the shares via the web ui on port 9000, these are not saved . next time I restart twonky they revert to default

 

2) if I change what *appears* to be the master set of defaults at /usr/local/twonkymedia-5/twonkymedia-server-default.ini

and restart twonky , no change

 

3) If I clear out the /CacheVolume/twonkymedia/ directory and restart twonky. My changes at 2) are not reflected in the new twonkymedia-server.ini that is recreated in /CacheVolume/twonkymedia directory

 

4) If I stop twonky, edit the ini file in /CacheVolume/twonkymedia, then restart twonky, guess what. It gets overwritten within minutes.

 

My problem is I have media which I want twonky to index and I have some sysmtem backups , which may contain media but I don't want twonky to index. They both share a common root of /Public. I'm trying to reduce the amount of content twonky needs to crawl , yet for all my efforts it seems like it always defaults

 

I'm wondering if I need to modify /etc/init.d/twonky and specify a new ini file on the command line, but before I do that I wanted to check and see if anyone else has had this problem ?

Honored Contributor
ThePizzaMatrix
Posts: 3,444
Registered: ‎10-13-2010
0

Re: failing to change twonky default contendir - ini file always recreated

I think having Twonky scan the Public share is something that can't be changed with the stock version that comes with the MBL, what if you follow the instructions in here to update Twonky?

Click the Kudos star to say thank you for helpful posts and 'Accept as Solution' under options for the post that solved your issue.
Advisor
jives11
Posts: 15
Registered: ‎10-23-2011
0

FIXED: Re: failing to change twonky default contendir - ini file always recreated

OK - looking closer at /etc/init.d/twonky it appears that no matter what in in the .ini file, this is later overwritten by the values in /etc/contentdir

 

once I changed that to

 

+M|/Public/Shared Music,+V|/Shared Videos,+P|/Shared Pictures

 

those changes were retained and reflected in the webUI

Regular Advisor
mybookW2
Posts: 74
Registered: ‎09-21-2011
0

Re: FIXED: Re: failing to change twonky default contendir - ini file always recreated

this is interesting as having Twonky mapped to just /public seems to cause lots of people including myself issues with the drive not sleeping.

Advisor
jives11
Posts: 15
Registered: ‎10-23-2011
0

Re: FIXED: Re: failing to change twonky default contendir - ini file always recreated

Yes - I think the problem is that if you have both media and other content in /Public (in my case complete incremental  backups of 2 PC's), then twonky will be continuously re-indexing as files inevitably get updated.

 

I wanted to limit twony's scope to just those folders with media.

 

I had thought about stopping and starting twonky from cron , for example through the night, just to try to get the MBL to a very quiet state.

 

I have to admit that the code on the MBL to determine when to sleep the device would appear to generate a good deal of IO, I'm erring toward reducing the worload to the minimum, while never actually sleeping the disks

My last MBW was never spun down, yet lasted 4 years

Regular Advisor
mybookW2
Posts: 74
Registered: ‎09-21-2011
0

Re: FIXED: Re: failing to change twonky default contendir - ini file always recreated


jives11 wrote:

OK - looking closer at /etc/init.d/twonky it appears that no matter what in in the .ini file, this is later overwritten by the values in /etc/contentdir

 

once I changed that to

 

+M|/Public/Shared Music,+V|/Shared Videos,+P|/Shared Pictures

 

those changes were retained and reflected in the webUI


Could you post a quick walk though on how to do this please.

Advisor
jives11
Posts: 15
Registered: ‎10-23-2011

Re: FIXED: Re: failing to change twonky default contendir - ini file always recreated

[ Edited ]

Sure

 

1) You need to enable ssh access to your MBL.

 

2) You need to edit a text file called /etc/contentdir

 

3) this file is owned by root, so you have 3 choices depending on how Linux familiar you are :

 

  • You can ssh into the server as a regular user and sudo nano /etc/contentdir - This is safest
  • You can ssh into the server as a regular user and su to root, then nano /etc/contentdir
  • You can ssh into the server as the root user. the default password is welc0me, then nano /etc/contentdir

Remember root can do everything including remove files which could brick the MBL, so take care.

 

4) You can edit this file with an editor of choice. I think nano is safest as it's easier for novice users and I noticed some tools already use it (crontab -e). vi is my old friend and I used it

 

5) the file (/etc/contentdir)  has only one line in it. I made a copy of it first (/etc/contentdir.safe) using the cp (copy) command first

 

6) I edited the file and replaced the existing entry with the line below:

 

+M|/Public/Shared Music,+V|/Public/Shared Videos,+P|/Public/Shared Pictures

 

This is the supported syntax from the  .ini files, and would seem to auto add the full directory path to the fron of each entry within twonky , so /shares is effectively an auto-basedir. If you are only interested in one kind of media,  then only add the part above for that type i.e if you only use Music then put

 

+M|/Public/Shared Music

 

7) Save the file back to /etc/contentdir

 

8) Once done I restarted twonky with

 

# /etc/init.d/twonky stop

# /etc/init.d/twonky start

 

9) confirm the changes via the webUI in your desktop web browser (http://mybooklive:9000/config) then go to Sharing. You should see the directories you stated listed not /Public

 

10 ) if you run the top command in your shell you will see twonky consume the most CPU for a while but eventually settle down to doing very little, going from 99% CPU use to around 0.3% once setteled down.

Regular Advisor
mybookW2
Posts: 74
Registered: ‎09-21-2011
0

Re: FIXED: Re: failing to change twonky default contendir - ini file always recreated

Thanks for that i will give this a try tonight, i have only tried SSH from the mac via terminal but could switch to linux, via virtual box.

Advisor
jives11
Posts: 15
Registered: ‎10-23-2011
0

Re: FIXED: Re: failing to change twonky default contendir - ini file always recreated

terminal from the MAC is fine, that's how I did it. My coment about Linux is because that is the OS of the MBL, so once you are SSH'd into the MBL you are in a Linux environment

Regular Advisor
mybookW2
Posts: 74
Registered: ‎09-21-2011
0

Re: FIXED: Re: failing to change twonky default contendir - ini file always recreated

I see that makes sense, just a quick question as I have not had time to look yet how do you get it to open the file.


jives11 wrote:

terminal from the MAC is fine, that's how I did it. My coment about Linux is because that is the OS of the MBL, so once you are SSH'd into the MBL you are in a Linux environment


 

Forums | Ideas | News and Announcements | Register | Sign in | Help | Forum Guidelines
Copyright © 2001 - 2010 Western Digital Corporation, All rights reserved. | Trademarks | Privacy | Terms of Service | Terms of Use | Copyright | Contact WD