PDA

View Full Version : post-boot NOT executed (OLEG 1.9.2.7-8)



gerardwr
21-04-2008, 15:04
Hi,

I could you use your help, here.

I've been using my WL-HDD for years now with FW 1.2.3.0, but now I would like to add a webserver to my WL-HDD. Tweaking the builtin webserver does not seem possible so I installed the OLEG FW, so I could use busybox_httpd.

If I start busybox_httpd -p 8080 -h /tmp/harddisk/www the webserver (files are on the disk in the WL-HDD in the WWW directory) is running and I can use it with Internet Explorer. So far, so good.

To make sure that busybox_httpd is also restarted after a reboot I followed the instructions on this board and I:
- created a post-boot script in the /usr/local/sbin directory
- made it executable
- tested it (it works)
- saved it to flash using FLASHFS
Unfortunately after a reboot it seems like the post-boot is not started. The ECHO messages in the script that are supposed to enter some text in a file do not appear, and PS reveals that busybox_http is NOT running.

I've read MANY messages on this board and the internet, but to no avail. It's probably something "stupid" on my part.

Perhaps one of you would be so kind to peek at the information copied from the telnet sessiona glance, and spot the problem.

[admin@wl-hdd sbin]$ pwd
/usr/local/sbin
[admin@wl-hdd sbin]$ cat post-boot
#!/bin/sh
echo post-boot >>/tmp/harddisk/system/postboot.txt
date >>/tmp/harddisk/system/postboot.txt
busybox_httpd -p 8080 -h /www >>/tmp/harddisk/system/postboot.txt
[admin@wl-hdd sbin]$ flashfs save
tar: Removing leading '/' from member names
tmp/local/
tmp/local/sbin/
tmp/local/sbin/post-boot
tmp/local/sbin/post-firewall
tmp/local/root/
-rw-r--r-- 1 admin root 293 Jan 1 00:04 /tmp/flash.tar.gz
Check saved image and type "/sbin/flashfs commit" to commit changes
[admin@wl-hdd sbin]$ flashfs commit
.
Committed.
[admin@wl-hdd sbin]$ flashfs enable
[admin@wl-hdd sbin]$ post-boot
busybox_httpd: bind: Address already in use
[admin@wl-hdd sbin]$ reboot
[admin@wl-hdd sbin]$

gerardwr
22-04-2008, 12:17
Further investigation shows that:
- the post-boot IS executed, my mistake.
- the busybox_httpd command fails, probably because the internal harddisk is not yet mounted when post-boot runs. I think I have seen some posts about this here.

If I direct busybox_httpd to a directory on /usr/local/sbin the webserver is started at post-boot time. The test-code I used in post-boot is shown below.


[admin@wl-hdd sbin]$ cat post-boot
#!/bin/sh
date >>/usr/local/sbin/post-boot.txt
busybox_httpd -p 8080 -h /usr/local/sbin/www 1>>/usr/local/sbin/post-boot.txt 2>>/usr/local/sbin/post-boot.txt
echo post-boot ended >>/usr/local/sbin/post-boot.txt
[admin@wl-hdd sbin]$

Now I have to look into solving the "not mounted" issue, because the WL-HDD does not provide a lot of space for websites.

Feel free to drop a hint if you can.

al37919
22-04-2008, 12:28
"busybox_httpd: bind: Address already in use" means that some service is already sitting on the port 8080. Check it with:
netstat -na | grep LISTEN

To use netstat install net-tools first

gerardwr
22-04-2008, 20:37
"busybox_httpd: bind: Address already in use" means that some service is already sitting on the port 8080. Check it with:
netstat -na | grep LISTEN

To use netstat install net-tools first

Thanks for your input, but that's not the problem that's bothering me.

As I reported in my previous post busybox-http is now succesfully started by means of the post-boot script. The PS command shows that it is running, as long as it is pointing to a directory in the WL-HDD RAM (like /usr/local/sbin) If I direct it to a directory on the builtin harddisk the startup fails because apparently the disk is not mounted yet at post-boot time.

So if the busybox_http is started AFTER the harddisk is mounted all should be well. I just read on the OLEG pages that in addition to post-boot no also the post-mount is added to run at startup, AFTER external devices are mounted. I will give this a try, and report back.

gerardwr
22-04-2008, 21:49
WORKS!!

As indicated in my previous post I have moved the contents of my post-boot to post-mount. Now the busybox_http server is started, pointing at webcontent on the built-in harddisk. In IE the URL wl-hdd:8080 shows the content of my www directory. On port 80 of the wl-hdd the original website for configuration is available as usal.

For your reference, the telnet log below shows the location and content of my post-mount file.

Thanks to OLEG for his excellent firmware, thanks to the webmaster for the valuable contents in this forum.



[admin@wl-hdd sbin]$ pwd
/usr/local/sbin
[admin@wl-hdd sbin]$ ls -al post-mount
-rwxr-xr-x 1 admin root 253 Apr 22 20:29 post-mount
[admin@wl-hdd sbin]$ cat post-mount
#!/bin/sh
date >>/usr/local/sbin/post-mount.txt
mount >>/usr/local/sbin/post-mount.txt
busybox_httpd -p 8080 -h /tmp/harddisk/www 1>>/usr/local/sbin/post-mount.txt 2>>
echo post-mount ended >>/usr/local/sbin/post-mount.txt
[admin@wl-hdd sbin]$

The telnet log below shows the contents of the post-mount.txt file that is created by the post-mount command.

[admin@wl-hdd sbin]$ cat post-mount.txt
Tue Apr 22 20:31:23 UCT 2008
/dev/root on / type squashfs (ro)
none on /dev type devfs (rw)
proc on /proc type proc (rw)
ramfs on /tmp type ramfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/discs/disc0/part1 on /tmp/harddisk type vfat (rw,noatime)
post-mount ended
[admin@wl-hdd sbin]$

darius
15-07-2008, 14:53
Hi Gerhard,

could you kindly tell me how to start with busy-box httpd web server on my WL-500gP v2 ?
Is there any chance to use the original firmware by Asus and get root access
to edit some files, install busybox and more
or I should install firmware by Oleg .

Darius