1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Announce] eD2K+KAD support for NAS200 running jac2b

Discussion in 'Cisco/Linksys Network Storage Devices' started by jackito, Apr 18, 2009.

  1. jackito

    jackito LI Guru Member

    I´m pleased to announce eD2K+KAD support for NAS200 running jac2b firmware.

    Using aMule you can download your ed2k links directly from NAS200 through a web interface.

    You can get the package here.

    Installation instructions for automatic startup:

    1. Connect to your NAS200 with SSH, NOT TELNET. If you launch rc.amule from TELNET IT WILL NOT WORK (thanks Pa0l0ne for the contribution)
    2. Unpack the tarball under your rc.d directory (/harddisk/volume_X/data/rc.d where X depends on your harddisk(s) configuration).
    3. Edit the amule.conf file under /harddisk/volume_X/data/rc.d/amule/aMule with the correct paths for your system
    4. Make sure that your home directory exist and is writable (ie: not root dir, "/") if it isn´t, change the home directory of the user to some path in the harddisk (ie: /harddisk/volume_X/conf/root) that can be writable (you can edit the passwd file to achieve this change and then relogin with ssh to get the new value). If you can´t asure this, please don´t continue because amule will not work.
    5. Execute rc.amule under /harddisk/volume_X/data/rc.d to run aMule
    6. Connect to aMule web interface with your favourite browser on http://your_nas200_ip_address:4711 (the default password is "changeme")

    How to change the default password for aMule web interface:

    aMule doesn´t use clear text passwords in the configuration file. Instead it uses a MD5 hash of the password you want to use.
    To achieve this execute:

    Code:
    $ echo -n password | md5sum
    56f491c56340a6fa5c158863c6bfb39f -
    Where password is the password you want to use and the MD5 hash (56f491c56340a6fa5c158863c6bfb39f) is what you need to copy and paste in the "Password=" parameter in the [WebServer] section of the config file.

    Last but not least, aMule support a lot of options and the configuration file used in this package is just a simple template with almost everything set by default. If you want to know more about them you can find information here. For more details about aMule please check aMule´s website.

    ADVICE: amule can be really heavy for the NAS200 CPU. So a good advice is to renice the amuled process after starting it. By "renicing" it you can low down the priority of amuled process so the rest of the services on the NAS can keep working. renice is available in my new version of busybox, check the thread about it.

    Enjoy it! :thumbup:

    BTW: please note the big size of the binaries. That is because in order to simplify everything I statically compile them, in order to get rid of libraries dependency.
     
  2. jackito

    jackito LI Guru Member

    There was a problem with the uploaded tarball.
    I have just uploaded it again and now is ok.
    Sorry for the incovenience.
     
  3. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    Hi, thanks for you work!
    ...but i have little problem:
    when i try to launch ./rc.amule i receive this error:

    amule.conf failed with error 2!
    ERROR: ERROR You request to run web server on startup, but the amuleweb binary cannot be run.Please install the package containing aMule web server, or compile aMule using --enable-webserver and run make install

    What's wrong??

    Thanks in advance for reply.
     
  4. jackito

    jackito LI Guru Member

    Hi, you are welcome. :)
    About your problem, I think is related to the start up script of amule.
    Please download this tarball and extract it in the same directory where the rc.amule file resides. It will replace the current rc.amule script with a new one.
    Let me know if this works, so I can upload a new package with the fix.
    Thanks.

    Fer
     
  5. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    Unfortunately the fix won't work :frown:
    The shell now give me this error:

    /bin/sh: ./rc.amule: not found
     
  6. jackito

    jackito LI Guru Member

    Please check the permissions of the file. They should be: -rwxr-x-r-x.
    You can check this by executing "ls -l" on the directory where rc.amule resides.
    If you need to change them execute "chmod 755 rc.amule" and try to run the script again.
    Thanks.

    Fer
     
  7. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    thanks for your patience,...but i have the same problem.
    The permission was previously set in 0777, now i have set in 0755 but the problem is the same: /bin/sh: ./rc.amule: not found

    This is what i do:

    telnet 192.168.0.33 (my nas200)
    cd harddisk
    cd volume_1
    cd data
    cd rc.d
    ./rc.amule

    The shell give me this error:

    /bin/sh: ./rc.amule: not found

    so i have tried to execute the content of the new scritp manually and i have launched:

    export PATH=$PWD:$PWD/amule:$PATH

    cd $PWD/amule

    ./amuled -c -f $PWD/aMule

    The shell give me this error:

    Unexpected parameter '/harddisk/volume_1/data/rc.d/amule/aMule'


    :frown::frown:

    What's wrong?
     
  8. jackito

    jackito LI Guru Member

    Sorry, my mistake. :rolleyes:
    I fixed the script again. Please download this new tarball, extract it in the same directory where rc.amule resides (again it will replace rc.amule).
    Try it and let me know if it works.
    Thanks!

    Fer
     
  9. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    You're the man! :)
    Now the script seems to be OK!

    ...but now i have 2 "little" problems:

    1) The web interface won't work because "a valid template has not be found"...

    If i launch a ps ax i receive this reguard amule:

    2119 root 5144 S ./amuled -f -c /harddisk/volume_1/data/rc.d/amule/aMule
    2121 root 4288 S amuleweb --amule-config-file=/harddisk/volume_1/data/rc.d/amule/aMule/amule.conf



    And this is my amule.conf:

    [WebServer]
    Enabled=1
    Password=4cb9c8a8048fd02294477fcb1a41191a
    PasswordLow=
    Port=4711
    WebUPnPTCPPort=50001
    UPnPWebServerEnabled=0
    UseGzip=1
    UseLowRightsUser=0
    PageRefreshTime=120
    Template=default


    2) How to stop amule if i want? (now i have to reboot my NAS200)



    Thanks for your work!!!!! (My NAS200 with jac2b and your amule is now very good!)
     
  10. jackito

    jackito LI Guru Member

    1) I´m working in a fix right now.

    2) Execute:
    Code:
    killall amuled
    This will end amuled and amuleweb also.

    Thanks for your feedback.

    Fer
     
  11. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    Seem's to be a related skin problem?
     
  12. jackito

    jackito LI Guru Member

    I think I solved the problems. :)
    Please download this tarball, extract it in the same directory where your rc.amule script resides to replace it. Run it and tell me if everything is fine now.
    Thanks.

    Fer
     
  13. jackito

    jackito LI Guru Member

    Somehow, in fact it is related to where the configuration directory should live. :wink:
     
  14. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    Now the problem is:

    $ ./rc.amule
    mv: cannot create directory `//.aMule': Read-only file system
    Configuration moved to user´s home directory
    Please check that you have a correct .aMule configuration directory under your home folder.
     
  15. jackito

    jackito LI Guru Member

    Great, because this one is a very easy to solve. :biggrin:
    Edit your "/etc/passwd" file and change the home directory of your user (ie: root) to some writable place. It seems that you are using "/" right now, that is read-only.
    For example if you are using root user you can do something like this:
    Code:
    mkdir /harddisk/volume_1/conf/root
    
    Then change the home directory for root in the passwd file to "/harddisk/volume_1/conf/root".
    Close your telnet/ssh session and open it again, then run rc.amule.
    You will see an error related to mv that can´t file a file or directory but you can discard it.
     
  16. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    this is the content of my psswd file:

    root:J0EK/vHr.beFQ:0:0:root:/:/bin/sh
    bin:x:1:1:bin:/bin:
    lp:x:4:7:lp:/share/spool:
    mail:x:8:12:mail:/var/spool/mail:
    ftp:x:14:50:FTP User:/:
    nobody:x:99:99:Nobody:/:
    ourtelnetrescueuser:sPuRQwXaya5YE:100:100::/home/user:/bin/sh
    guest:xqnMpE/plEnFs:501:501::/home/user/guest:/dev/null0
    admin:cgwvsHpJSf6XU:502:501::/home/user/admin:/dev/null1

    dream:scP50CBxm0XR.:2000:501:::/dev/null1


    How to edit it?? My Linux knowledge is poor, and this is very difficult now for me...

    p.s. i like to remember what jac2b said about NAS200:
    The telnet daemon is configured so that it doesn't require a user ID or password, so that we can get into the system without knowing the root password. Normally you would do this with the "passwd" command but this unfortunately is not enough: In the Linksys configuration, root's home directory is set to /root but this directory does not exist.
     
  17. jackito

    jackito LI Guru Member

    You can use vi to edit the file. First create the home directory for root as I told you in the previous post. Then:

    Code:
    vi /etc/passwd
    
    Then use the cursor keys to move inside the file. You only need to change the first line so use the right arrow until the cursor is under ":/:". Then press the "insert" key and change ":/:" to ":/harddisk/volume_1/conf/root:". Press "ESC" key to exit the edit mode and then type ":wq" to save the file and exit. If you make some mistake don´t worry. Press "ESC" key to exit the edit mode at any moment and then type ":q!" to exit without saving. Of course you should ommit the quotes in every command, I put them to make things more clear.
    Hope this helps.

    Fer
     
  18. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    i have created a directory named "root" in /harddisk/volume_1/data/conf with permission 0755, but now i have not idea how edit my /ect/passwd file. Using WinSCP if moving in /etc i see that passwd seems to be a "shortcut" and not a "real" file.....how to edit it?
    ....exscuse my poor knowledge.........


    ooops you have just reply me: now i use the VI...
     
  19. jackito

    jackito LI Guru Member

    Oh, you are using WinSCP, that´s a lot more easy! :biggrin:
    Then use WinSCP to edit the /etc/passwd file.
    Don´t worry if the file looks like a shortcut, just select and edit it.
    Change ":/:" in the first line of the file to ":/harddisk/volume_1/data/conf/root:" or to the directory that you created if it is different.
     
  20. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    Ok i've edited the file with WinSCP....but now WinSCP not connect anymore to NAS200 :frown::frown:
    He told me:
    Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended).

    ..even if i use the same SCP saved configuration in WinSCP

    I think that is a jac2b related problem like he said:

    Changing the root password
    [Edit]In order to log in through SSH, you have to know the root password. Unfortunately, the root password that Linksys initialized your NAS with, is unknown to anyone outside Linksys. And when you upgrade to this firmware, the Linksys upgrade software will keep all the accounts including the root account. So, we need to set it in another way.

    [Edit]The telnet daemon is configured so that it doesn't require a user ID or password, so that we can get into the system without knowing the root password. Normally you would do this with the "passwd" command but this unfortunately is not enough: In the Linksys configuration, root's home directory is set to /root but this directory does not exist.

    [Edit]The Linksys software has a fallback passwd file which is used whenever for some reason all account information is lost, or when you reset all user accounts from the Web GUI. I changed the default passwd file so that it contains a valid home directory and shell for root; also I changed the default root password to "root" (without the quotes). That means the easiest way to change the root password to something that's known is to use the Web GUI. However this also resets all other accounts in the system.

    [Edit]To reset the root password to "root" without changing any other accounts, connect via Telnet and paste the following commands:

    Code:

    # Enter following commands in Telnet to reset the root password to "root"
    egrep "^root:" /etc.default/passwd >/etc/x
    egrep -v "^root:" /etc/passwd >>/etc/x
    mv /etc/x /etc/passwd
    for x in /harddisk/volume_*/conf;do cp /etc/passwd $x;done
    # Don't forget to use the passwd command to change the password after this!
    # After you do that, remember to copy /etc/passwd to all conf partitions
    # using the "for" command shown above, or your password won't survive reboot.

    [Edit]After this, you can use the passwd command in the telnet session to change the password to something else, but you have to remember to copy the /etc/passwd directory to all configuration partitions using the "for" command from the code block above. The /etc/passwd file is normally a symlink to the file on one of the configuration partitions, but the "passwd" command changes the /etc/passwd file to a regular file and doesn't update the backup copy, from where it is restored at the next system startup. In other words, if you don't copy /etc/passwd to your configuration partitions using the "for" command, your new password won't survive a reboot.


    but how this is applicable for my case?


    P.S. I've riedited my /etc/passwd file in "original mode" with VI and now WinSCP is Functional but the problem with amule remain.....:frown::frown:
     
  21. jackito

    jackito LI Guru Member

    Sorry to hear that. Are you sure that you use the correct path to the directory that you create before???
    Did you backup the passwd file before editing it?

    The line that you edit should change from this:

    Code:
    root:J0EK/vHr.beFQ:0:0:root:/:/bin/sh
    To something like:

    Code:
    root:J0EK/vHr.beFQ:0:0:root:/harddisk/volume_1/data/conf/root:/bin/sh
    Anyway I can help you if you want. Send me a private message and I will reply with my MSN contact and we can continue over there.
    I need to leave but I be back in two hours.
     
  22. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    Ok seems the problem is the incorrect path:
    You said to edit the /etc/passwd file in this mode:

    root:J0EK/vHr.beFQ:0:0:root:/harddisk/volume_1/data/conf/root:/bin/sh

    But first we have created the root directory in this mode:

    mkdir /harddisk/volume_1/conf/root

    ..so the paths are not the same....(missing "data" directory)

    I have manually create a root directory in /harddisk/volume_1/data/conf/ and now it's seem that all ok.....but amule won't start... :

    Please check that you have a correct .aMule configuration directory under your home folder.

    if i try ps ax i don't see the amule daemon started.... any idea?
     
  23. jackito

    jackito LI Guru Member

    So all the problem was related to using TELNET instead of SSH.
    Telnet is not using the values from the passwd so I doesn´t set the home directory that you define in that file.
    I will add this to the announce and also upload a new package with the correct rc.amule script.
    Thanks Pa0l0ne for all your feedback!
     
  24. Pa0l0ne

    Pa0l0ne Addicted to LI Member

    So now i have an amule client "perfectly" work on my NAS200.....but the problems have not finished.....(what a fucd user am i?!!!).

    1) Seems the path that amule use for the downloaded files is:

    /harddisk/volume_1/data/rc.d/amule/aMule/Incoming (i have downloaded 1 file in this path)

    and not:

    /harddisk/volume_1/conf/root/.aMule/Incoming

    so why to move .aMule directory on home directory??:confused:


    2) I have tried to change my WebServer Template in chicane,litoral,default or php-default mode but the template still remain the same (default i think?!); for this to work i have tried to edit the amule.conf in all 2 path that i have mentioned above (because i don't know in wich path amule charge the configuration file..)
    This information is useful for all the possible edits on amule.conf and not only for the webskin.......(The Amule WebServer has not all the change that amule.conf has....:wink:)

    3) When amule connect to a server the connection is always in Low ID (but i have opened 4662 TCP Port and 4672 UDP Port on my Router and natted it on NAS200 fixed IP.How is it possible? (naturally if i use Emule on my WinBox with 4662 and 4762 ports natted on WinBox fixed IP the connetion is in HighID mode...:eek:) <-----I have cleared the file server.met and manually downloaded one from http://gruk.org/server.met and now my connection is in High ID....but why aMule doesn't do it automatically?(naturally the permission on aMule directory is set on 0777)



    4)I don't know where to search for KAD options (is KAD used on amule?):confused:

    5)Last but not least when i try to search files using amule webserver the search still remain blank....and to download files i have to manually insert ed2k link (this is not useful when the link of the file is unknow.....):confused:

    Have all the users of the NAS2000 aMule this problems?

    Thanks all for the feedback or for the solutions of these problems....
     
  25. jackito

    jackito LI Guru Member

    Wow a lot of items here. :)
    I will answer them tomorrow, after some testing.
     
  26. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    Is this stil supported on Jac3? I have the problem that the webpage's don't load :

    When i run ./rc.amule I'll get the following output :

    $ ./rc.amule
    Configuration directory present. Let´s run amuled...
    amuled: OnInit - starting timer
    Initialising aMuled 2.2.4 using v2.8.10
    Checking if there is an instance already running...
    No other instances are running.

    --------------------------------------------------
    Warning! You are running aMule as root.
    Doing so is not recommended for security reasons,
    and you are advised to run aMule as an normal
    user instead.
    --------------------------------------------------

    ListenSocket: Ok.
    amuled: forking to background - see you

    Which is telling me that amule is started and working in the background.

    But when I'll connect to the IP adres of the NAS200 (http://10.0.0.137:4711) I'll get a blank page.

    Here's my amule.conf file :

    [eMule]
    AppVersion=2.2.4
    Nick=http://www.aMule.org
    QueueSizePref=50
    VerboseDebug=0
    MaxUpload=10
    MaxDownload=240
    SlotAllocation=2
    Port=4662
    UDPPort=4672
    UDPDisable=0
    Address=
    Autoconnect=1
    MaxSourcesPerFile=300
    MaxConnections=500
    MaxConnectionsPerFiveSeconds=20
    RemoveDeadServer=1
    DeadServerRetry=3
    ServerKeepAliveTimeout=0
    Reconnect=1
    Scoresystem=1
    Serverlist=0
    AddServerListFromServer=0
    AddServerListFromClient=0
    SafeServerConnect=0
    AutoConnectStaticOnly=0
    UPnPEnabled=1
    UPnPTCPPort=50000
    SmartIdCheck=1
    ConnectToKad=1
    ConnectToED2K=1
    TempDir=/harddisk/volume_3/conf/root/.aMule/Temp
    IncomingDir=/harddisk/volume_3/conf/root/.aMule/Incoming
    ICH=1
    AICHTrust=0
    CheckDiskspace=1
    MinFreeDiskSpace=1
    AddNewFilesPaused=0
    PreviewPrio=0
    ManualHighPrio=0
    FullChunkTransfers=1
    StartNextFile=0
    StartNextFileSameCat=0
    FileBufferSizePref=16
    DAPPref=1
    UAPPref=1
    AllocateFullFile=1
    OSDirectory=/harddisk/volume_3/data/rc.d/amule/aMule/
    OnlineSignature=0
    OnlineSignatureUpdate=5
    EnableTrayIcon=0
    MinToTray=0
    ConfirmExit=1
    StartupMinimized=0
    3DDepth=10
    ToolTipDelay=1
    ShowOverhead=0
    ShowInfoOnCatTabs=1
    ShowRatesOnTitle=0
    VerticalToolbar=0
    ShowPartFileNumber=0
    VideoPlayer=
    VideoPreviewBackupped=1
    StatGraphsInterval=3
    statsInterval=30
    DownloadCapacity=300
    UploadCapacity=100
    StatsAverageMinutes=5
    VariousStatisticsMaxValue=100
    SeeShare=2
    FilterLanIPs=1
    ParanoidFiltering=1
    IPFilterAutoLoad=1
    IPFilterURL=
    FilterLevel=127
    IPFilterSystem=0
    FilterMessages=1
    FilterAllMessages=0
    MessagesFromFriendsOnly=0
    MessageFromValidSourcesOnly=1
    FilterWordMessages=0
    MessageFilter=
    FilterComments=0
    CommentFilter=
    ShareHiddenFiles=0
    AutoSortDownloads=0
    NewVersionCheck=0
    Language=
    SplitterbarPosition=75
    YourHostname=
    DateTimeFormat=%A, %x, %X
    AllcatType=0
    ShowAllNotCats=0
    SmartIdState=0
    DropSlowSources=0
    KadNodesUrl=http://emule-inside.net/nodes.dat
    Ed2kServersUrl=http://gruk.org/server.met.gz
    [Browser]
    DefaultBrowser=0
    OpenPageInTab=1
    CustomBrowserString=
    [Proxy]
    ProxyEnableProxy=0
    ProxyType=0
    ProxyName=
    ProxyPort=1080
    ProxyEnablePassword=0
    ProxyUser=
    ProxyPassword=
    [ExternalConnect]
    UseSrcSeeds=0
    AcceptExternalConnections=1
    ECAddress=10.0.0.137
    ECPort=4712
    ECPassword=*/changed in my personal pass md5 /*
    UPnPECEnabled=0
    ShowProgressBar=1
    ShowPercent=1
    UseSecIdent=1
    IpFilterClients=1
    IpFilterServers=1
    [WebServer]
    Enabled=1
    Password=*/changed in my personal pass md5 /*
    PasswordLow=
    Port=4711
    WebUPnPTCPPort=50001
    UPnPWebServerEnabled=0
    UseGzip=1
    UseLowRightsUser=0
    PageRefreshTime=120
    Template=default
    [Razor_Preferences]
    FastED2KLinksHandler=1
    [SkinGUIOptions]
    UseSkinFiles=0
    Skin=
    [Statistics]
    MaxClientVersions=0
    TotalDownloadedBytes=3177279
    TotalUploadedBytes=24091192
    [Obfuscation]
    IsClientCryptLayerSupported=1
    IsCryptLayerRequested=1
    IsClientCryptLayerRequired=0
    CryptoPaddingLenght=254
    CryptoKadUDPKey=-815723902
    [UserEvents]
    [UserEvents/DownloadCompleted]
    CoreEnabled=0
    CoreCommand=
    GUIEnabled=0
    GUICommand=
    [UserEvents/NewChatSession]
    CoreEnabled=0
    CoreCommand=
    GUIEnabled=0
    GUICommand=
    [UserEvents/OutOfDiskSpace]
    CoreEnabled=0
    CoreCommand=
    GUIEnabled=0
    GUICommand=
    [UserEvents/ErrorOnCompletion]
    CoreEnabled=0
    CoreCommand=
    GUIEnabled=0
    GUICommand=
    [Debug]
    Cat_General=0
    Cat_Hasher=0
    Cat_ED2k\ Client=0
    Cat_Local\ Client\ Protocol=0
    Cat_Remote\ Client\ Protocol=0
    Cat_Packet\ Parsing\ Errors=0
    Cat_CFile=0
    Cat_FileIO=0
    Cat_ZLib=0
    Cat_AICH-Hasher=0
    Cat_AICH-Transfer=0
    Cat_AICH-Recovery=0
    Cat_ListenSocket=0
    Cat_Credits=0
    Cat_ClientUDPSocket=0
    Cat_DownloadQueue=0
    Cat_IPFilter=0
    Cat_KnownFileList=0
    Cat_PartFiles=0
    Cat_SHAHashSet=0
    Cat_Servers=0
    Cat_Proxy=0
    Cat_Searching=0
    Cat_ServerUDP=0
    Cat_Client\ Kademlia\ UDP=0
    Cat_Kademlia\ Search=0
    Cat_Kademlia\ Routing=0
    Cat_Kademlia\ Indexing=0
    Cat_Kademlia\ Main\ Thread=0
    Cat_Kademlia\ Preferences=0
    Cat_PartFileConvert=0
    Cat_MuleUDPSocket=0
    Cat_ThreadScheduler=0
    Cat_Universal\ Plug\ and\ Play=0
    Cat_Kademlia\ UDP\ Firewall\ Tester=0
    Cat_Kademlia\ Packet\ Tracking=0
    Cat_Kademlia\ Entry\ Tracking=0

    Also a strange thing when i run ./amulecmd I' get the following error :

    This is amulecmd 2.2.4
    Enter password for mule connection:

    Creating client...
    Connection Failed. Unable to connect to localhost:4712

    There's something wrong but i can figure it out. Maby someone can help me get this working.
     
  27. beppes

    beppes Addicted to LI Member

    A little hel for compiling

    Jak,
    first of all thanks for your work!!!!!!!!!
    I would like to play with the new amule version (2.2.5)
    Can you suggest me a friendly environment (windows xp) for compilation?

    Thanks in advance

    Beppes
     
  28. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    Ok fixt the programm loads manualy now. the problem whas amule disliked the localhost instead of an IP adres. Only thing is I can not start it on boot
     
  29. DJ Soulfly

    DJ Soulfly Addicted to LI Member

    After all the things i've done to made amule running on my box i came into the next problem.

    When my box is running at least one day it's practically unreachable to manage or to get on one of it's share's trough samba when I run amule.

    I've reniced the amuled process and the amule web trough pidof amuled and pifof amuleweb with a value of 20 and limited the connections to 150 but It won't help.

    Perhaps have some of you run into the same problem. Now I have to continues kill the amuled process to get on my share's.
     

Share This Page