Results 1 to 10 of 10

Thread: Rc.local problem

  1. #1

    Cool Rc.local problem

    I know there is probably a simple solution to this but:
    I don't think my rc.local is working properly. I installed it the way KC discribed in the firmware upgrade. But whenever i log into TELNET i have to type in:
    export PATH=/opt/bin:${PATH}
    export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
    in order to use Screen or enhanced-ctorrent.
    I have my Rc.local in /shares/MYVOLUME1/

    This is the coding in my rc.local:
    -----
    #!/bin/sh

    pool=`nvram get apps_pool`
    share=`nvram get apps_share`
    internal_hdd=/dev/ide/host2/bus0/target0/lun0/disc

    if [ \! -f /tmp/rc.local.done ]; then

    # Indicate we've already done this
    touch /tmp/rc.local.done

    #
    # Mount /opt and connect in various system files
    #
    if [ -e /shares/${pool}/opt ]; then
    mount -o bind /shares/${pool}/opt /opt

    cat /proc/mounts > /opt/etc/fstab

    ln -s /opt/etc/shells /tmp/shells
    ln -s /opt/etc/fstab /tmp/fstab

    export PATH=/opt/bin:/opt/sbin:${PATH}
    export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
    fi

    # Start utelnetd on local interface only!
    /apps/bin/utelnetd -i br0 &

    fi

    /opt/sbin/cron

    /opt/sbin/syslogd -m 0 -O /opt/var/log/messages -S

    /opt/sbin/thttpd -d /opt/share/www -c /cgi-bin/* -p 8008 -u root
    -------
    thanks thanks

  2. #2
    The $PATH and $LD_LIBRARY_PATH environment variables won't stick outside of rc.local.

    To fix that, install bash and make /opt/bin/bash your shell then add the $PATH and $LD_LIBRARY_PATH lines to the .profile file in your user directory.

    - K.C.

  3. #3

    cannot log-in to telnet now

    I installed bash, however when i restarted my router i can no longer log into telnet. Putty pops up for a second and then closes. I figured i messed up on the rc.local and tried to install the asus firmware then back to KC's and apply telnet hack and i still cannot log into router. What am i doing wrong, i didn't setup a password but my rc.local in directory /shares/MYVOLUME1/so i can't delete it. Please help! Is there anyway to scrub HD and start from scratch, i tried holding down reset and nothing, i also tried ezsetup and nothing. I can only log in through FTP and windows interface.

    Thanks
    ZZero

  4. #4
    To fix an rc.local problem:

    1. reflash with asus firmware
    2. Apply telnet hack
    3. Telnet in and delete rc.local
    4. reflash with custom firmware
    5. put working rc.local back on

    - K.C.

  5. #5

    Smile Thank you

    Thanks, it worked. Your a life saver

  6. #6
    Quote Originally Posted by kfurge View Post
    To fix an rc.local problem:

    1. reflash with asus firmware
    2. Apply telnet hack
    3. Telnet in and delete rc.local
    4. reflash with custom firmware
    5. put working rc.local back on

    - K.C.
    You could also use the poor-mans telnet enable hack... for quick fixes

    1) Enable (or re-enable) the built-in web site
    2) Modify the index.cgi in the shares/MYSHARE1/web/Layout_English/index.cgi and add "/apps/bin/utelnetd -i br0" (minus the quotes) to the last line and save (use the appropriate editor)
    3) Direct your web browser to the website (usually http://<ip>:8081)
    4) Telnet to your hearts content (and fix your rc.local)
    5) Make sure to remove the added line to index.cgi (or disable the website or whatever).

    Easier than a re-install when it works (saved me about a week ago).

  7. #7
    Quote Originally Posted by medsource View Post
    You could also use the poor-mans telnet enable hack... for quick fixes
    True, unless you mess up rc.local so bad that the router failes to even progress to the point of being able to service http requests. In that case, only the bullet-proof recipe works.

    - K.C.

  8. #8
    Quote Originally Posted by kfurge View Post
    True, unless you mess up rc.local so bad that the router failes to even progress to the point of being able to service http requests. In that case, only the bullet-proof recipe works.

    - K.C.
    Agreed, but it's also worth the 2 minutes effort to see if salvage is an option prior to starting over.

  9. #9
    Quote Originally Posted by medsource View Post
    You could also use the poor-mans telnet enable hack... for quick fixes
    [...]
    2) Modify the index.cgi in the shares/MYSHARE1/web/Layout_English/index.cgi and add "/apps/bin/utelnetd -i br0" (minus the quotes) to the last line and save (use the appropriate editor)
    [...]
    Could you please tell me what the appropriate editor is? I locked myself out of my shell (stupid I know), however, I cannot get this telnet hack to work for me.

    I use linux to get to the files (through nfs), but when I edit a .cgi file the editor messes up the ownership. Unfortunately, I am not allowed to change this back to 0:42000 (as it should be).

    As a result I get the source of the file displayed, in stead of it being parsed. So I'm still locked out. (A very safe situation, although it isn't the one I was hoping for...)

    How did you stop this ownership change from happening?

    Or is there an alternative? For instance, is it possible to reset the WL700 in such a way that it erases the rc.local file? Reflashing (at this moment) doesnt affect it at all.

    Thanks for any suggestions.
    Last edited by oclee; 07-05-2007 at 22:58.

  10. #10
    Join Date
    Aug 2007
    Location
    Austria
    Posts
    52
    Quote Originally Posted by oclee View Post
    Could you please tell me what the appropriate editor is?
    on Windows i'm using TextPad editor www.textpad.com
    which is able to keep unix linefeeds automatically

    I locked myself out of my shell (stupid I know), however, I cannot get this telnet hack to work for me.

    I use linux to get to the files (through nfs), but when I edit a .cgi file the editor messes up the ownership. Unfortunately, I am not allowed to change this back to 0:42000 (as it should be).

    As a result I get the source of the file displayed, in stead of it being parsed. So I'm still locked out. (A very safe situation, although it isn't the one I was hoping for...)

    How did you stop this ownership change from happening?

    ...
    had the same problem

    if you want to use the index.cgi-hack (/shares/MYSHARE1/web/Layout_English/index.cgi)
    it works best with ftp-access

    if you first delete and then copy a new version of index.cgi,
    then the execute permissions are lost (at least when using my ncftp client)

    better is to edit the index.cgi file first and to overwrite it,
    then the permissions are preserved

    to correct the premissions, i've created a user with full access to ftp,
    ftp'ed in with this user account. change the working directory to
    Code:
    cd /shares/MYSHARE1/web/Layout_English
    and the just run from your ftp client
    Code:
    chmod 777 index.cgi



    originally i wanted to set the permissions of my /shares/MYVOLUME1/rc.local
    which i forgot before i commented out utelnetd

    for this purpose i added the following command to the end of the index.cgi file
    Code:
    chmod 755 /shares/MYVOLUME1/rc.local
    then browsed to my Web-page once and restarted the WL700g
    which corrected the permissions, fixed and works

    hth

    --
    tiwag
    Last edited by tiwag; 09-08-2007 at 14:08.

Similar Threads

  1. Problem with Berkeley db utilities at execution
    By Rodion in forum WL-500g Q&A
    Replies: 0
    Last Post: 22-12-2006, 17:23
  2. WL-500gP and Asus support experience
    By Blezi in forum WL-500gP Q&A
    Replies: 6
    Last Post: 03-12-2006, 13:59
  3. Problem with dieing AIR-connection
    By BòóN in forum WL-500g Q&A
    Replies: 7
    Last Post: 26-10-2004, 13:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •