Yes, I found that too. I just manually deleted reset and clear prior to installing the package.
I think adding the "-force-overwrite" option to ipkg will do the same thing...
- K.C.
Printable View
And now that we have all this, some cool applications to use, does some one knows some ?
Maybe with WEB interface,, :)
reboot the router, but the path's don't work..
where can I put this:
export PATH=/opt/bin:${PATH}
export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
for the router to read in the startup?
For rc.local, simply put it at the top. For an interactive bash shell, put the same lines into the .profile file located in your user account directory.
I don't think there's anything in ${PATH} or ${LD_LIBRARY_PATH} with an interactive shell login, so I fully configured mine in my .profile. I posted a copy of my .profile on the web page.
- K.C.
Ok, I'm doing someting wrong :)
first I put a file named ".profile" in /share/MYVOLUME1/opt/home/<username>
And added this lines
#
# Bash initialization script
#
PS1="[\u@\h \W]$ "
PATH=/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH=/opt/lib:/shares/lib
export PS1 PATH LD_LIBRARY_PATH
export PATH=/opt/bin:${PATH} export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
of course all edited with vi
My rc.profile file is locanted in /share/MYVOLUME1/
and contains this entries:
#!/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 /optcat /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}
export PATH=/opt/bin:${PATH}
# Start dropbear ssh server
if [ -x /opt/etc/init.d/S51dropbear ]; then
/opt/etc/init.d/S51dropbear
fi
fi
# Start utelnetd on local interface only!
/apps/bin/utelnetd -i br0 &
# Sleep for a little bit to not interfere with normal system startup
# before we kill a bunch of Asus processes.
sleep 5
# Kill processes I don't use. The killing of watchdog is necessary
# to allow the disk to spin down (watchdog is a horribly written hack
# anyway!)
killall -q -9 watchdog
killall -q usbcopymain
killall -q rcamdmain
killall -q waveservermain
# Restart the web server
killall thttpd
thttpd -dd /shares/${pool}/${share}/htdocs -p 8081 -i /var/run/t
# Do the necessary steps so the internal HDD will spin down
mount -o remount,noatime,nodiratime /shares/${pool}
hdparm -S 180 ${internal_hdd}
smartctl -dT ${internal_hdd}
fi
And that's it
If these two lines are indeed concatinated as shown, things won't work very well. Break them apart at the appropriate spots. The mount must work to get a functional /opt.
Also, you're multiply exporting PATH and LD_LIBRARY_PATH in both scripts. No harm, I think, but you only need to do it once.
Otherwise, things looked OK.
- K.C.
Hello,
thank to the new firmware I have flashed my router and now I have :
telnet 192.168.1.1
Trying 192.168.1.1...
Connected to 192.168.1.1.
Escape character is '^]'.
(none) login: admin
Password:
Login incorrect
I have tried to change the password/login in the web interface but all attempts fails.
Any idea ?
Great : it works now !!!
Thank you very much (that could be written somewhere...)
The .profile and last rc.local script I posted on the web page are exact copies of what's currently running on my router. Try using the .profile as-is along with the second rc.local script. If that runs OK, then proceed to modify as necessary.
If that doesn't work, please post your /etc/passwd file (with passwords removed, of course) and the output from the "set" and "mount" commands from a login shell.
- K.C.
Point 3.2 part 3
mount -o bind /shares/MYVOLUME1/opt /opt (didn't work)
mount -o bind /shares/MYVOLUME1/opt/ opt/ (did work)
I don't think there is any difference....:confused:
LK
P.S. Sorry KC I'm probably splitting hairs
Question: do i loose my hd content, when i do and firmware upgrade.
Sollie.
I tried it both ways on my Ubuntu linux system just now and they both worked. I assume it would be the same for the router.
I'd not recommend the second way without at least a "cd /" before the mount command since the mount point is relative.
Is it possible that /shares/MYVOLUME1/opt existed at boot-up and /opt was automatically mounted by the rc.local script before you manually attempted to run the command?
- K.C.
The rc.local file as posted is correct.
I had mistakely put /shares/MYSHARE1 instead of /shares/MYVOLUME1 at the location referred to by the message.
Since I've updated the web page, the post, and subequent reply, no longer have the correct context.
Putting opt within reach of the file sharing utilities at /shares/MYVOLUME1/MYSHARE1 could be very convenient, but also potentially insecure. I chose /shares/MYVOLUME1 because none of the canned Asus utilities can reach it.
- K.C.
Could someone have the same problem which can't kill httpd as me ?
The process of my route don't have thttpd process but those have two httpd process, and this process start by themself after i use "killall" command. It seem this process provide kernel level. Do i right? and how can i stop it?:mad:
===after i use killall the screen as below==
587 admin 304 S /opt/sbin/dropbear
907 admin 1388 S httpd 80 y
1033 herman 2776 S < /usr/local/samba/sbin/smbd
========cut. =================
As you noted, there are two http servers running on the router. The first one, httpd, is the one that serves up the routers web configuration pages on port 80. I see no reason why you would want to kill this one.
The second one, thttpd, is used to serve up your custom web content on port 8080. Incoming requests to port 80 on the WAN interface are redirected to the internal port 8080. You can easily kill and restart thttpd as demonstrated in this script:
http://home.comcast.net/~kfurge/rc.local_3
The "watchdog" process is very likely what's restarting the web servers after you kill them because it regularly pings them to see if they're still alive. I recommend a "killall -9" of the watchdog process. My router got substantially more stable after killing watchdog.
After reviewing the watchdog the source code provided in the 1.0.4.2 release it's easy to understand why... That watchdog code is not good at all.
- K.C.
first of all, thanks for improving the 700ge, it really needs some love.
anyways, I have some problems getting the brick to load rc.local at bootup.
I've ofcourse updated the firmware, it says it's successful, but I do not know how to check this. (tried both the way you've described and the 'ASUS' way)
I have then uploaded the first rc.local via ftp to the web folder, but when I reboot I still don't have telnet access. I can telnet into the box if I put '/apps/bin/utelnetd -i br0 &' in showmessage.cgi in the web folder. (it brings up the login screen where you type 'root') I've then tried to follow the rest of the instructions and moved the rc.local and it is still not loading. I can install all the different packages, but it is frustrating that I have to manually edit showmessages.cgi, then type in:
export PATH=/opt/bin:${PATH}
and
export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}
when I want to enter the 700ge
and last but not least: manually start my services :-/
besides the rc.local I have these problems:
in 5.3 I get an error at "chown /opt/home/<username> <username>"
but apparently it succeeds if I type "chown <username> /opt/home/<username>" (it gives no reply)
I also have a problem installing dropbear. I'm logged in as root, but it gives me:
mkdir: cannot create directory '/root': (Operation not permitted)
lastly I'm stuck at 5.6, I cannot find .profiles (tried find . name "*profiles*")
EDIT:
I found 'profile' but only after I installed 'Bash' which is not explained in the tutorial :)
Hope you guys can help me out :)
/regards
Henrik
The easy way to check is to cat /apps/bin/rcex and see if it contains the parts which execute rc.local at the end. Also, make sure you flashed the "02a" image because the initial "02" release had a bug which kept rc.local from executing in the web location.Quote:
I've ofcourse updated the firmware, it says it's successful, but I do not know how to check this.
Yep, documentation problem. Your second way is correct. Will fix, thanks.Quote:
in 5.3 I get an error at "chown /opt/home/<username> <username>"
I'll add an example passwd file to the web page.Quote:
in 5.4 I'm not sure were to edit:
Since Asus never expected you to log in, you won't find a .profile on your system. You must add it to your user account. I put a sample .profile on the web page. You'll have to rename it from profile to .profile.Quote:
Lastly I'm stuck at 5.6, I cannot find .profiles (tried find . name "*profiles*")
- K.C.
I am using the 02a image, and it IS successfully installed (checked with cat /apps/bin/rcex)
I have my rc.local in shares/MYVOLUME1/
and it is exactly the same as the 1st on the webpage...
you just answered while I was editing my last post :), but anyways I figured out some of the things and now I'm having problems with dropbear, see my last post
thx for the fast response,
/regards
Henrik
I'm in a real pickle here. I was lovin' all the great things that came from your recent firmware. Unfortunately after messing around with it, I rebooted it because dropbear wouldn't let me log in as root (even though i set a root pw and all, so I figured what the heck) and now the damn thing is in a constant state of reboot and never comes up. I've tried every trick listed in this forum for reflashing the firmware with the latest one from Asus. The firmware restoration tool appears to do it's job, but unfortunately that's not enough for it to come back up. I think it may have to do with my rc.local file, but I have no way of accessing the hard drive to remove it, since it's rebooting all the time.
My next question is...Since it's formatted with reiserfs, which linux distro will read the FS? My thought is to remove the HD, plug it into my PC, and attempt to mount the disk and remove the offending file(s). Another possibility I'm considering is dropping a different HD in it temporarily to get it back up and running, and hope doing the firmware restoration will get the drive up and running.
Any help would be appreciated, I'm very angry right now. :mad:
The script prefers the rc.local in /shares/MYVOLUME1 over the one located in the web directory. However, it's more picky about this one. Make sure rc.local has the execute bits set (chmod 755 rc.local). If the x bits aren't set, the script won't be executed. Maybe this is your problem?
- K.C.
Yikes! I had a similar problem with one of my scripts where the HDD was thrashing around and the router wouldn't boot past my script.
To fix it, I simply reflashed back to the stock Asus firmware. Since it knows nothing about rc.local, it started right up. I had to redo the telnet hack to get back in and fix things, but that was it.
One thing to try (it's a long shot)... I've found the boot-up behavior between using the switch on the front and actually unplugging the device from the wall is slightly different. One time, the only way I could get the router to boot properly was to cold-boot the router by yanking the power, holding the ez-setup button, reapplying power, then reflashing the Asus firmwar€e.
Please let us know how you progress.
- K.C.
I've tried that at least twice. still no luck. I'll take another stab at it.
I've got a 40 gig HD i can slap in it if I get real desperate and try that route until I can plug the 160 into my PC and see if I can mount the drive and remove the rc.local (and probably some other stuff). If all hope seems lost and I can get another HD to work in it, I'll trash the partition on the 160 and start from scratch. :(
Now that it's been unplugged for a while maybe it's feeling lonely and is more willing to cooperate now. :)
I followed the instructions (more or less) and I have the following to report:
(1) At first, login as normal user via telnet did not work for me. I checked /opt/home/<username> , I checked .profile within that directory, I checked /etc/passwd ... all looked OK. Eventually I fixed this by running "ipkg install bash" ... which doesn't appear in your instructions but is a required step befor user logins will work with the rest of your instructions.
(2) I did install dropbear, but I am unable to connect yet via ssh.
(3) programs man,less, mc and nano all install but seem to have problems with my terminal program (I'm running Konsole from KDE 3.5.5 under PCLinuxOS). I did install ncurses, ncursesw and termcap.
I am now going to install ctorrent and enhanced-ctorrent and see how that goes.
Later:
I got less and nano working partly OK. I edited my user .profile to read as follows:
mc still does not work. I get the following messages on startup:Code:#
# Bash initialization script
#
PS1="[\u@\h \W]$ "
PATH=/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH=/opt/lib:/shares/lib
export PS1 PATH LD_LIBRARY_PATH
export TERMINFO=/opt/share/terminfo
export TERM=vt100
... later still: I got mc working. I just needed to be patient.Code:Warning: file /opt/lib/mc/extfs/extfs.ini not found
Warning: file /opt/lib/mc/extfs/sfs.ini not found
ssh is still not connecting to dropbear.
when I login as a normal user via telnet, and I type "ps -aux", I can see that dropbear is running:
... but I cannot connect to that process from another machine on the LAN.Code:590 root 464 S /opt/sbin/dropbear
Does it need to be done via the WAN? Is there a setup file somewhere to configure this?
Later still:
I am trying a torrent download, via the web interface. I think this will use the new ctorrent I installed, rather than the one provided by default. I am trying to download the new openSuSe 10.2 DVD, which is a 3.6 GB file. I'll report on how this goes later.
I do have one suggestion for this router to improve on its "download without a PC" advertised capability, and that would be to get this project running on the router:
http://aria2.sourceforge.net/
I'm wondering if someone with some influence can persuade oleg about this?
hal2k1: thanks, nano didn't work for me either, until I made those fixes. but can you tell me what you did to make mc work?
[EDIT]: now I know what you mean about patience.... DOH!
K.C.
it seems after all that rc.local IS loaded, telnet didn't work because in your rc.local the command is '/apps/bin/utelnetd -i br0 &' but for me it is '/bin/utelnetd -i br0 &'... :)
keep up the good work.
/regards
Henrik
I had exactly the same problem (constant rebooting) and did what kfurge proposes:
- always reboot by unplugging the power cord (actually: power down, unplug, replug)
- flash Asus firmware
- telnet into router (flashed with Asus firmware) with telnet hack and delete all rc.local files
- flash kfurge firmware version 02a
My router works again, like a charm.
best regards,
theswissguy
Ok, here's what I've done repeatedly to no avail:
Assign a static IP to my computer
Unplug the router
plug it back in while holding down the EZ-Setup button
Wait for READY light to come on
Fire off Firmware Restoration tool with the Asus firmware (1.0.4.6)
Let it boot as normal afterwards
At that point it goes right back to going in circles rebooting over and over. I've even gotten it to the stage where I can use TFTP (hold the EZ-Setup button until the READY light starts flashing) with the split-up image file (using AsusExtractor) and flashing it with the flash file, and still nothing. I'm starting to wonder if it's even writing everything it needs to the hard drive properly. Because with the amount of times I've "successfully" flashed the Asus firmware to it, it still insists on constantly rebooting.
Something of the old configuration is still hanging around as well, even though at this point I should've damn near blitzed the NVRAM with the new image, yet it still hangs on to the IP I assigned the router, and not defaulting back to the old one. I'm guessing that flashing the firmware doesn't touch that part of the NVRAM, which is good otherwise we'd have to redo all our settings each time we flash it. :eek:
I'm at my wits end with it. I'm considering more drastic measures. First maybe to attempt to install another HD into the router, and flash the firmware that way and see if it'll take off. Then, take the HD from the router and plug it into my PC and attempt to mount it under Linux. If I can get it to mount, then I can go in and repair, or otherwise remove the offending file(s), put the HD back into the router and see what it does. Last ditch effort would be to nuke the partition on the router's HD, and force it to start over again. Which I would only do if I could get another HD to play nice with it. But I'm trying to do this without voiding the router's warranty.
UPDATE:
IT'S FIXED!!!!!! I did everything I had been doing, but this time I actually held down the RESET button for a good 10-12 seconds, and that apparently causes it to nuke the NVRAM and re-writes the default settings to it, and finally accepts the firmware. I was so happy to see the AIR light flashing, as I knew that was a good sign since I had turned off the radio weeks ago (don't use wireless). So to see it flashing told me it reset to defaults. Plus the IP address is now back to 192.168.1.1. Now that it's working again, it's time to reconfigure it and see WTF went wrong in the first place.
Now that everything is back up and running, I decided to tempt fate twice, and reflashed the kc2a firmware, after doing the telnet hack and replacing the FUBARed rc.local with a brand spankin' new rc.local.
BTW, for future reference and a word of advice to everyone, DO NOT USE WINDOWS TELNET! I believe this is what screwed me up in the first place. Now everything I do shell related with this router is being done in either OS X, or Fedora (running under Parallels in OS X, necessary when I need to use the blasted INSERT key in vi) But I digress..
Now I have a mostly functioning rc.local script (using #2 from your website KC), but I've noticed something. I've followed all the directions on the website to get it up and running with /shares/MYVOLUME1/opt and all the ipkg stuff, and that's all working fine. I manually punch in the mount and export commands to get /opt remounted and so on, so thats all working fine. But the problem I seem to be having with the rc.local script is this part:
The problem I'm having is this doesn't seem to run. The directory is there, but there's something about it that the 'if' statement isn't seeing, thus it won't run. Everything else about the script is fine, as telnet pops up and all that. So everytime I log in I have to punch in the mount and export commands to bypass all the default Asus/busybox stuff and use the fancy new stuff. I've even replaced '/shares/${pool}/opt' with '/shares/MYVOLUME1/opt' and it still isn't working.Code: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
Although I'm happy to see the router reboot and not get caught in a never-ending loop like before. :)
Any ideas what might be causing this? I may remove the 'if' statement from around those commands and make them run anyways. It's nice that it checks for it, but I know the stuff is there, so at this point I don't see why I need the 'if' statement there.
Awesome work BTW. I'm loving the world of possibilities that has opened up!
EDIT:
I've concluded that it is in fact mounting /opt like it's suppose to, but the export PATH and LD_LIBRARY_PATH aren't holding.. So when I telnet into the router, I have to manually run those each time.
Congratulations getting your router back! It would have made a very expensive doorstop! Thanks for posting your solution.
Regarding PATH and LD_LIBRARY_PATH sticking, yes, you're right, they don't stick from rc.local. They were sticking until I enabled login support. After that, no environment variables were inherited from rc.local. It makes sense from security viewpoint for login to clear the environment.
I solved the problem by setting both of these within my user account's .profile script and using bash as my login shell. I'll probably add a system wide profile into /etc (symlinked to /opt/etc/profile) in my next release.
Along those lines, I still need to learn how the filesystem that's packaged with the .nas file is generated. That way I can pre-load some of this stuff into the flash image.
- K.C.
To all who are telneting into their boxes and curious why their terminal support is lousy it's because utelnetd does not properly set the terminal type. No matter what you login from, your TERM environment variable will be set to 'linux' which probably won't work very well.
To solve this, you can either set it manually (if you know what it should be as demonstrated within hal2k1's .profile example) or login via dropbear with a good ssh client like openssh (linux) or putty (windoze) where it will be set correctly.
- K.C.
This is *very* strange. Interesting little Asus'ism here, stuffing two apparently identical binaries, with very different sizes, in an already full flash image! I think the only difference is that /bin/utelnetd is dynamically linked and /apps/bin/utelnetd is statically linked.
Is anyone else seeing this wierdness? If so, I'll change the default scripts to load /bin/utelnetd instead.
Thanks for the info.
- K.C.
The path '/apps/bin/utelnetd -i br0 &' from kfurge works for me, no problem with it. I also have bitchx (irc client) working. Thanks for your work kfurge.
But one question: i like to connect my telnet deamon over wan. How can i do that?
Sollie.
ps: i dont want to use a ssh deamon. Because i use xbmcscripts (xbox) to connect my telnet. Ssh wont work for me!
you can replace '/apps/bin/utelnetd -i br0 &' and change the 'br0' to one of the following
br0 is your LAN
other choices are:
'eth0' (WAN)
'eth1' (not sure)
if you manage to lock yourself out look here:
http://wl500g.info/archive/index.php/t-5762.html
/regards
Henrik
I figured out what was causing my router to flip out and go into a never end cycle of reboots. After I got it back up and running and started observing it's behavior with a working rc.local script in it, I realized that it never got around to running the rc.local script, because the READY light never came on. It would start booting, get to the point that it should've brought up the READY light, and would reboot, and keep doing so until I power it down.
After reflashing the kc2a image, and following KC's instructions, all was going great, and I would reboot it after a few changes to make sure everything was working fine. I then proceeded to enable UBSA mode to create a user account, and as soon as I would hit 'Apply', the hard drive would make some noises, and then it would reboot itself, and start the cycle of never ending reboots over again. Now when I had this problem originally, I was able to create a user name with it, and had started modifying the passwd file when I rebooted it and it began rebooting constantly. So there appears to be something about my router that doesn't like having user names. I've tried this a few different ways now. Once after I RESET it and flashed the 1.0.4.6 firmware (which it had probably already reverted to anyways after a RESET, as it wasn't running rc.local anymore), once after a fresh RESET (no settings changes, just enabling UBSA mode), and once after removing all customizations from /shares/MYVOLUME1, just in case it was still referencing that stuff. Everytime it would never get to the point that I could enter a new user, it would start rebooting non-stop until I stick something in the RESET hole.
This may be a legitimate complaint that I can ask Asus about, but for now I'm gonna have to come up with a Plan B for password protecting telnet, as dropbear is out of the question if I can't create another account on it.