Support > User Customizations
Installing TwonkyMedia Server on cache drive
aht961:
A guide for the beginner (from a beginner)
First of all read the previous threads concerning twonkymedia server installation on UnRAID:
#1) http://lime-technology.com/forum/index.php?topic=729.0
#2) http://lime-technology.com/forum/index.php?topic=6438.0
Background Info
After installing according to the #1, the server installs and runs. However, 2 serious problems occur. Firstly, the server installs from your /flash disk, but after the first run, the -ini file (twonkymedia-server.ini) and all your database are built and run at RAM under 2 directories "/twonkymedia" and "/var/twonkymedia". Secondly, after next reboot of your server, all your settings including the license number are gone and you need to start over. The solution to the problem of loosing license number and settings is suggested in #2 above, however, the database (music, video, photos), cache and all related data are lost once again and need to be built all over. I have checked few options and come to the following solution. In case if another novice needs to go through the same torture of "trial and error" step, these guides may prove handy. Do it on your own risk, though.
We will use cache drive and an invisible path to keep the inifile and all twonky related material untouched during a reoot. Instead of cache drive, I assume any another drive off the array (S.N.A.P. etc) can be used as well. (Your boot Flash disk too, but we will not be willing too many writes/deletes to the flash mount).
In Part 1, we will download, adjust and start using the TwonkyMedia server (version 6.0.32) as a uPnP and in Part 2 we will enable the background video transcoding options.
Part 1
XXXX PREPARE CACHE DRIVE XXXX
1. Make a directory at /mnt/cache with the name starting with a "." : e.g ".packages/twonkyserver" (/mnt/cache/.packages/twonkyserver)
Under this directory we will download the TwonkyMedia Server and reinstall from this directory after each reboot.
2. Make another dir at /mnt/cache/.packages/tms/twonkymedia
(In future, here we will keep the content of server's database and INI file - originally this path is /var/twonkymedia at RAM)
3. And another dir at /mnt/cache/.packages/twonkymedia
(In future, here we will keep the content of media - originally this path is /twonkymedia at RAM)
XXXX DOWNLOAD and INSTALL TWONKYMEDIA SERVER at your CACHE DRIVE XXXXXX
4. From http://www.twonkyvision.com/
Download the Linux x86(manual install) file, currently named "twonkymedia-i386-glibc-2.2.5-6.0.32.zip" (http://www.twonkyvision.com/upfiles/twonkymedia-i386-glibc-2.2.5-6.0.32.zip).
Unzip >> you will have "twonkymedia-i386-glibc-2.2.5-6.0.32". For the sake of brevity, change the name of this folder to "twonkyserver".
Copy TWONKYSERVER's content to your cache drive at /mnt/cache/.packages/twonkyserver" (remember we have created this #1), where you should have the following:
- cgi-bin
- initial_keystore.dat
- Linux-HowTo.txt
- plugins
- radio.m3u
- resources
- RevisionHistory
- twonkymedia
- twonkymedia-server-dafault.ini
- twonkymedia.sh
- twonkymediaserver
5. Give the correct privileges by using the following command in /mnt/cache/.packages/twonkyserver:
chmod 700 twonkym* cgi-bin/* plugins/*
XXXXXXXX FIRST RUN XXXXXXX
6. Open your GO script and add the following line (or use the command line):
"/mnt/cache/.packages/twonkyserver/twonkymedia/twonkymedia" and reboot your server.
7. Now you can make the necessary adjustments (defining the directories of the media, entering the license number and etc.) using the TwonkyMedia server web browser at "http://tower_or_its_IP:9000". Let it build the database and this can take an hour or two depending on how much media you have to share.
This could be the end of the story if we had not have the problems above (server runs at RAM and it will be cleared after next reboot). So we need to continue with the following.
XXXXXXXX COPY ALL DATABASE AND THE NEW INI FILE TO THE PERMANENT DIRECTORY at CACHE DISK XXXXX
Remember, we have already built the directories above ("/mnt/cache/.packages/tms/twonkymedia" and "/mnt/cache/.packages/twonkymedia"). Now we will do some copying!
8. Copy ALL from "/var/twonkymedia/" TO "/mnt/cache/.packages/tms/twonkymedia"
You need this command: cp -r /var/twonkymedia/* /mnt/cache/.packages/tms/twonkymedia/
9. Copy ALL from "/twonkymedia/" TO "/mnt/cache/.packages/twonkymedia"
You need this command: cp -r /twonkymedia/* /mnt/cache/.packages/twonkymedia/
As a consequent, you should now have 3 subdirectories (music, picture, videos) at "/mnt/cache/.packages/twonkymedia"
and plenty under "/mnt/cache/.packages/tms/twonkymedia"
XXXXXXXX MODIFY THE SERVER.INI FILE ACCORDING TO YOUR LIKING XXXXXXX
After this step, following the next boot, your database, cache and all related will be built to your CACHE disk and the -ini file will be read from there.
10. Open the ini file "/mnt/cache/.packages/tms/twonkymedia/twonkymedia/twonkymedia-server.ini" with your editor and change a few lines (I will try to go trough these next). To be precise, 8 lines need to be modified:
# directory for cached/transcoded files
cachedir=/mnt/cache/.packages/tms/twonkymedia/twonkymedia/db/cache
# directory where metadata database is stored
dbdir=/mnt/cache/.packages/tms/twonkymedia/twonkymedia/db
# directory where server managed music folders are stored, like uploaded and mirrored songs, subfolder names are created based on strings from language files
servermanagedmusicdir=/mnt/cache/.packages/twonkymedia/music/TwonkyMedia
# directory where server managed picture folders are stored, like uploaded and mirrored photos, subfolder names are created based on strings from language files
servermanagedpicturedir=/mnt/cache/.packages/twonkymedia/pictures/TwonkyMedia
# directory where server managed video folders are stored, like uploaded and mirrored videos, subfolder names are created based on strings from language files
servermanagedvideodir=/mnt/cache/.packages/twonkymedia/videos/TwonkyMedia
# directory where downloaded online items are cached
onlinedir=/mnt/cache/.packages/tms/twonkymedia/twonkymedia/twonkymedia-server-online-data
# directory where statistics are stored
mediastatisticsdir=/mnt/cache/.packages/tms/twonkymedia/twonkymedia/media-statistics/
# removable media home drive
rmhomedrive=/mnt/cache/.packages/tms/twonkymedia/twonkymedia/db
XXXXXXXX ALMOST THERE XXXXXXXXXXXXX
We need to tell the application where the INI file is.
11. Change the start line in your GO script from (above #5)
"/mnt/cache/.packages/twonkyserver/twonkymedia" TO
"/mnt/cache/.packages/twonkyserver/twonkymedia -inifile /mnt/cache/.packages/tms/twonkymedia/twonkymedia/twonkymedia-server.ini"
Reboot. Wait the database to built (another one hour) go and fetch some coffee or beer! Hope this helps.
XXXXXXXX CLEAN SHUT DOWN XXXXXXXXXXX
In order to be able to start/stop the server and have the unRaid shut down/reboot we will use unMenu and the user scripts. Otherwise the unRaid willnot be able to unmount the drives since TMS will be using them. Go and get the included scripts here, remove the .txt suffix and drop them at /boot/unmenu. As a result you will have "Start Twonky" and "stop twonky" options at "users' scripts" page in unMenu.
kizer:
Is there a free Twonky version you can try? I'd like to try playing with this as well since I'm trying to setup a buddy with a PS3 and I didn't have the greatest luck with PS3MediaServer. Of course nothing says I can't try again, but I just haven't.
S80_UK:
--- Quote from: kizer on March 16, 2011, 03:02:33 PM ---Is there a free Twonky version you can try? I'd like to try playing with this as well since I'm trying to setup a buddy with a PS3 and I didn't have the greatest luck with PS3MediaServer. Of course nothing says I can't try again, but I just haven't.
--- End quote ---
Yes - Twonky gives you a free trial (30 days, if I recall) before it requires a license key. The trial is fully functional.
I also use it - not yet with the databases on the cache drive, but that looks like a good next step.
@aht961 - many thanks for the info on setting that up.
aht961:
Please refer to the FIRST message!
--- Quote from: S80_UK on March 16, 2011, 06:03:53 PM ---..
@aht961 - many thanks for the info on setting that up.
--- End quote ---
You're welcome.
I have tested the above setting and it is functioning as it was meant to. One "small" problem, though. While twonky is running, if you try to "reboot" the unRaid, it seems that it takes ages trying to unmount "/mnt/cache" drive and reboot fails.
I wrote two scripts (attached here). Remove the .txt suffix and put them in /boot/unmenu/. You will be able to run them using the "user scripts" in unMenu. The first one will start the twonkyserver and the other one will stop it properly so you can shut down the unRaid properly.
PS: I have edited this message. Therefore the following message by Joe is assuring that these scripts would do the job.
Joe L.:
--- Quote from: aht961 on March 19, 2011, 03:24:38 AM ---
--- Quote from: aht961 on March 19, 2011, 02:31:46 AM ---
--- Quote from: S80_UK on March 16, 2011, 06:03:53 PM ---..
@aht961 - many thanks for the info on setting that up.
--- End quote ---
You're welcome.
I have tested the above setting and it is functioning as it was meant to. One "small" problem, though. While twonky is running, if you try to "reboot" the unRaid, it seems that it takes ages trying to unmount "/mnt/cache" drive and reboot fails.
Could some body write/suggest a small script which once needed could KILL the twonkymedia server properly, so unRaid could cleanly power down? This could then be added e.g. to the list of user scripts in unMenu. I could not find any option in the twonkymedia servers admin GUI where you could shut down the server (there is only an option to "restart" the server).
--- End quote ---
I am answering myself :( I wrote two scripts and added to /boot/unmenu.. Now, you can start and stop twonkymedia via the "user scrpts" page in unmneu. I enclose both here (remove the .txt suffix). Still would be very nice if an experienced linux member kindly checks/improves out the commands. Thank you.
--- End quote ---
They should work.
Navigation
[0] Message Index
[#] Next page
Go to full version