Bekijk de volledige versie : Kamikaze - tranmission and other stuff

23-01-2008, 21:45

Id like to get a complete info about howto get transmission to work on kamikaze.
After I will get mine to work stable I will try to get a noob howto for all this.

As I am at very early stage of doing stuff I can 'log' all what Ive done here and with others here maybe we can get my router to work and get a noob howto for kamikaze with transmission.

At the moment Ive managed to flash it to kamikaze install Xwrt,qos,nano,install USB/ext2 stuff,ipkg-opt,transmission,gnuplot.
The 3 things that come in handy. As for QoS I havent configured everything nicely to filter traffic but my goal will be working VOIP while leeching torrents.

Kamikaze is a very nice system. As for me I had stock/oleg/Whiterussian/ and kamikaze is the most 'logical' one there is. Im pretty much a noob so everything I do is with howtos/tutorials/forums with the uber tool known as 'SEARCH'.
What you need to know before you get your hands on putty and start messing is:
A - The startup system is diffrent and messing with it too much may result with a softly bricked router. There is no flash bla bla thing here just plain and easy script files that do/set the stuff.This means if you overdo stuff in /etc/init.d/ or /etc/rc.d you might end up with serial connecting the router to save it.
Therefore I suggest fallowing a retarded rule to 1st get proper scripts into init.d and testing with start/stop/restart commands if everything is working like a charm.
How it works is 1st you need to put a your script in proper kamikaze format to
/etc/init.d - this doesnt mean that unplugging/restarting the router (accident?wife?power failure? anything...) just after you placed your BAD script into init.d will leave you with a lot of trouble and waste of time to get it back to default state. It wont start up these scripts unless you tell it to with '/etc/init.d/scriptname enable'.
To test simply issue '/etc/init.d/scriptname start' then change 'start' option to 'stop' and 'restart'. After you review your kernel log with Xwrt and be sure that everything works like a charm and for example your HDD is mounting/unmounting properly you can finally enable the script with the mentioned above '/etc/init.d/scriptname enable'
How should a startup script look like ?
Take a look with vi/nano at other scripts in init.d.
Basicly you kinda need all the lines till STOP=XX line.
START means when the script is started. Important if you have some stuff on your HDD and want it to run at boot. You have to remember when your HDD gets mounted so the stuff is available when your application script starts.
Stop is the other way around (as I understand ^^) at shutdown/reboot I guess. Also it is important to fallow the scheme of start() {..} stop() {..} etc.
For specific scripts that you want you can try to use SEARCH.
Also post it here with info what you wanted to do and how you did it. Will help spread the knowledge.

1. For getting kamikaze up it was easy for me as I already had WhiteRussian.
Fallow http://wiki.openwrt.org/OpenWrtDocs/Hardware/Asus/WL500GP?highlight=%28wl500%29
To get it to work with kamikaze and have qos,wifi,usbhdd.
(If u havent put stuff inside your router you need the brcm2.4 thing)

More information on usb howto ( a little outdated but it wont hurt you to read)

2. To get a webif fallow manual installation section here

3. To get ipkg-opt fallow
I skipped the part with "libpthread and libstdcpp for some Optware packages".
EDIT : Don't skip anything! You need this for transmission

For now everything works but most likely youll need it so dont be as lazy as I am and install it.
Somehow I couldnt get it to install with 'install' 'ipkg.sh install' so I found my own noobish way of adding the repository to Xwrt and installing it from there ^^.
4. To get samba to work Install it with ipkg-opt (you need a HDD or a stick for this as it takes MiBytes). Reading the tutorial here helps http://wl500g.info/showthread.php?t=10761

My startup scripts for usb HDD, swap,samba look like

#!/bin/sh /etc/rc.common


echo -n "Testing USB Partition: "
e2fsck -p /dev/scsi/host0/bus0/target0/lun0/part1 &
sleep 5
echo -n "Mounting USB drive: "
mount -t ext2 -o noatime /dev/scsi/host0/bus0/target0/lun0/part1 /opt
echo "Done."
echo -n "Umounting USB drive: "
umount /dev/scsi/host0/bus0/target0/lun0/part1
echo "Done."

#!/bin/sh /etc/rc.common

echo "mounting swap...."
swapon /dev/scsi/host0/bus0/target0/lun0/part2
echo "done with swap"

#!/bin/sh /etc/rc.common



echo -n "Starting samba "
/opt/sbin/nmbd -D
/opt/sbin/smbd -D
echo "Done."
echo -n "Stopping samba: "
killall smbd
killall nmbd
echo "Done."
sleep 2

As it is stated above Im stuck with getting busybox http to load transmission.
I keep spamming one guys PM box all the time but I think hes tired of me :)
So if anybody knows how to get transmission up on kamikaze from this point it would be nice if you keep this going.
Also remember to post everything you've done on Kamikaze and WL500gp.
It is always nice to find a complete or at least essential howto post around to go on.

30-01-2008, 08:39
I've just noticet this thred. I am running T on K from day one. I am using thttpd instead of busybox_thttpd. You do not need logrotate for syslog. I am using size limitied 100k stock syslog. Installed webif for easy managmend and that's it. You could also use Kamikaze httpd instead!

You can ask further questions here. Thread watched.

30-01-2008, 11:21
Error while starting watchdog

/opt/sbin/transmission_watchdog: ulimit: 304: error setting limit (Operation not permitted)


Jan 30 12:00:47 (none) daemon.info thttpd[27664]: spawned CGI process 29339 for file 'cgi-bin/transmission.cgi'
Jan 30 12:00:51 (none) daemon.info thttpd[27664]: spawned CGI process 29360 for file 'cgi-bin/transmission.cgi'
Jan 30 12:00:57 (none) user.info transmissiond[29379]: Transmission daemon 1.01+ (4684) started - http://transmission.m0k.org/ at port 65534
Jan 30 12:00:57 (none) user.crit transmissiond[29379]: /var/run/transmission.pid - Permission denied
Jan 30 12:00:57 (none) user.warn transmission_watchdog: Transmission daemon restarted!
Jan 30 12:00:58 (none) user.notice transmissiond[29379]: Starting torrent /opt/samba/TEST/torrent/work/....torrent

Tried to change /var/run/transmission.pid from /opt/var/run/transmission.pid
But I dont think thats it. Reverting back to /opt/..

Also after update pressed

tail: read error: Is a directory

30-01-2008, 12:07
I am using


Probably you are running under another name than ROOT that is lacking permissions.

30-01-2008, 12:33

Needed root in thttpd.conf and transmission.conf

What is tail: read error: Is a directory

Gnuplot missing some lib :
gnuplot: can't load library 'libiconv.so.2'

Also Im having trouble with a noob startup script for thttpd

#!/bin/sh /etc/rc.common


echo -n "Starting thttpd.."
/opt/sbin/thttpd -C /opt/etc/thttpd.conf
echo "Done."
echo -n "Stopping all thttpd.."
killall thttpd
echo "Done."

start/stop works but when restart it kills but doesnt start it. Tried sleep 1-5.

30-01-2008, 13:02
Some systems needs libiconv package to be installed!
I will correct that in next gnuplot package.

tail message means that your syslog is not a file but a directory!

There is a optware procided /opt/etc/init.d/S80thttpd that looks like


if [ -n "`pidof thttpd`" ]; then
killall thttpd 2>/dev/null

/opt/sbin/thttpd -C /opt/etc/thttpd.conf

30-01-2008, 14:20
Downloading http://ipkg.nslu2-linux.org/feeds/optware/openwrt-brcm24/cross/unstable//libiconv_1.11-2_mipsel.ipk
pkg_run_script: ERROR: uninstalled package libiconv has a NULL tmp_unpack_dir
An error ocurred, return value: 1.
Collected errors:
unpack_pkg_control_files: Failed to create temporary directory '(null)': No space left on device
Aborting installation of libiconv

Should I install the one from kamikaze repository ? Edit : installed with ipkg from kamikaze. works.

Also should I change it from Circular to File and point to /opt/var/log/messages?

30-01-2008, 15:06
yes, from circular to file and then 100k size.

ipkg-opt uses /opt as temporary directory! How could you fill up /opt?
If there are some temporary /opt/ipkg-???? files you can safely delete it.

30-01-2008, 15:46
Yeah more and more I start to guess that my HDD is faulty.
1st that thing with filled up space now I got some errors with the HDD in log.

30-01-2008, 16:17
Ok. Seems that it works 'for now' but the drive is giving a lot of errors with e2fsck, maybe its because I used ext2 instead of ext3.

Syslog appears to be writing to /opt/var/log/messages but Xwrt doesnt read the file in its syslog view.
Also what happens to messages at boot time before HDD gets mounted ? Is it smart enough to buffer it ?

Some trouble with cron.

cron works : 20534 root 428 S crond -c /etc/crontabs

cron table as I understood must be put into /etc/crontabs as another file ie root ?

Cron Jobs : root





# ---------- ---------- Default is Empty ---------- ---------- #

# m h dom mon dow user command

30 * * * * root nice transmission_watchdog

* * * * * echo "Testing crond..."

31-01-2008, 07:32
Oh yes, cron. I am using Kamikaze provided cron.
Just run crontab -e and enter line

*/30 * * * * /opt/sbin/transmission_watchdog
This runs every half an hour. I preffer running cron once an hour. Eg.

5 * * * * /opt/sbin/transmission_watchdog

And for fsck trouble I suggest to shorten USB cable to 25cm. It seems that it helps.
I've also wrote tutorial how to write startup for optware.
See http://www.dd-wrt.com/wiki/index.php/Optware for idea on that.

31-01-2008, 09:40
Jan 31 10:21:27 OpenWrt user.notice transmissiond[27219]: Stopping torrent /opt/samba/TEST/torrent/work/xxxx.DVD.SCREENER.XViD-PUKKA/Bee.Movie.DVD.SCREENER.XViD-PUKKA.torrent
Jan 31 10:21:27 OpenWrt user.notice transmissiond[27219]: Closing torrent /opt/samba/TEST/torrent/work/xxxx.DVD.SCREENER.XViD-PUKKA/xx.DVD.SCREENER.XViD-PUKKA.torrent
Jan 31 10:21:30 OpenWrt user.err transmissiond[27219]: Couldn't open '/opt/samba/TEST/torrent/work/xxxx.2007.DVDScr.xVID-LRC/Tx.2007.DVDScr.xVID-LRC/CD2/lrc-tgcb.r31': Input/output error
Jan 31 10:21:30 OpenWrt user.notice transmissiond[27219]: Previous message repeated 1 times
Jan 31 10:21:30 OpenWrt user.notice transmissiond[27219]: Stopping torrent /opt/samba/TEST/torrent/work/xxxx.2007.DVDScr.xVID-LRC/x.2007.DVDScr.xVID-LRC.torrent
Jan 31 10:21:31 OpenWrt user.notice transmissiond[27219]: Closing torrent /opt/samba/TEST/torrent/work/xxxxx2007.DVDScr.xVID-LRC/x.2007.DVDScr.xVID-LRC.torrent
Jan 31 10:21:36 OpenWrt user.notice transmissiond[27219]: Stopping torrent /opt/samba/TEST/torrent/work/xxx2007.DVDRip.XviD-FLAiTE/x.DVDRip.XviD-FLAiTE.torrent
Jan 31 10:21:36 OpenWrt user.notice transmissiond[27219]: Closing torrent /opt/samba/TEST/torrent/work/zxx.DVDRip.XviD-FLAiTE/xx.2007.DVDRip.XviD-FLAiTE.torrent

Getting spammed by this. What about the syslog not being displayed in Xwrt?

Hmm couldnt find an entry for samba nmbd because of this spam I guess.
Process crashed during night. Tho smbd still worked.

31-01-2008, 12:37
You've got problems with filesystem. I recommend you that you delete all work files and start with fresh torrent. Of course, assure that your file system is without corruption before you start.
Here is mine /etc/init.d/custom-user-startup

#!/bin/sh /etc/rc.common
# place your own startup commands here
# REMEMBER: You *MUST* place an '&' after launching programs you
# that are to continue running in the background.
# i.e.
# BAD: upnpd
# GOOD: upnpd &
# Failure to do this will result in the startup process halting
# on this file and the diagnostic light remaining on (at least
# for WRT54G(s) models).

wlc radio 1

start () {
if [ -e /dev/discs/disc0/part1 ]; then
swapon /dev/discs/disc0/part2
e2fsck -y /dev/discs/disc0/part1
mount -t ext3 -o noatime /dev/discs/disc0/part1 /opt
e2fsck -y /dev/discs/disc0/part3
mount -t ext3 -o noatime /dev/discs/disc0/part3 /home
if [ -d /opt/etc/init.d ]; then
for f in /opt/etc/init.d/S* ; do
[ -x $f ] && $f start
) > /tmp/optware-boot.log 2>&1

Assure with tune2fs that you have disabled time checking on partitions and that you have for example 10 mounts before forced fsck. This is done with

tune2fs -i 0 -c 10 /dev/discs/disc0/part1
tune2fs -i 0 -c 10 /dev/discs/disc0/part3

The you can add ffsck function to /etc/profile to force fsck on next boot with

ffsck() {
tune2fs -C 10 /dev/discs/disc0/part1
tune2fs -C 10 /dev/discs/disc0/part3

You will always get Optware startup log in file /tmp/optware-boot.log in case you are impatient and waiting for fsck for an hour and so, if you have 500GB+ storage.

If you are keen enough than you could also make cron job to fsck the server every month or so. Mine server is quite stable. It can run for a month and more without any problem. No dmesg troubles reported from kernel. Of course I have wl500gx with RAM upgraded to 64MB.

31-01-2008, 17:57

Im having definite problems with HDD will try to remake partitions and check after it.

You use ext2 or ext3 ?

Can you please post your qos-script configuration ?
Would be really cool to leech +voip+gaming.

31-01-2008, 19:48
If you have stable system then ext2 is somewhat better. In your case ext3 seems to be a way to go. I do not use mine server for routing. I have another wl500gx that does NAT and handles oleo.ath.cx website on USB key.
# QoS configuration for OpenWrt

config interface wan
option classgroup "Default"
option enabled 1
option upload '380'
option download '2000'
option overhead '1'

config classify
option target "Bulk"
option ipp2p "all"
config classify
option target "Bulk"
option layer7 "edonkey"
config classify
option target "Bulk"
option layer7 "bittorrent"
config classify
option target 'Express'
option ports '34000'
option proto 'tcp'

config classify
option target 'Priority'
option ports '22,53'
config classify
option target 'Normal'
option ports '20,21,25,80,110,443,993,995'
option proto 'tcp'

config default
option target "Express"
option proto "udp"
option pktsize "-500"
config reclassify
option target "Priority"
option proto "icmp"
config default
option target "Bulk"
option portrange "1024-65535"
config reclassify
option target 'Bulk'
option srchost ''

config reclassify
option target 'Bulk'
option srchost ''

# Don't change the stuff below unless you
# really know what it means :)

config classgroup "Default"
option classes "Priority Express Normal Bulk"
option default "Normal"

config class "Priority"
option packetsize 300
option packetdelay 10
option maxsize 400
option avgrate 40
option linksharing 75
config class "Priority_down"
option packetsize 1500
option avgrate 20

config class "Express"
option packetsize 1300
option packetdelay 15
option maxsize 800
option avgrate 30
option linksharing 80

config class "Normal"
option packetsize 1500
option packetdelay 150
option avgrate 20
option linksharing 30
config class "Normal_down"
option avgrate 30

config class "Bulk"
option linksharing 10
config class "Bulk_down"
option avgrate 15
option limitrate 85

config "classify" ""
option target 'Priority'
option proto 'tcp'
option mark '!Bulk'
option tcpflags 'SYN'
option pktsize '-128'

config "classify" ""
option target 'Priority'
option proto 'tcp'
option mark '!Bulk'
option tcpflags 'ACK'
option pktsize '-128'

31-01-2008, 22:48
I figured out what was the hdd problem.
My bro disconnected it during night and most likely errors occurred.

Anyways do you have any advice on how to set the qos without the help of second router for transmission + for example voip at once ?
Also I still cannot read /opt/var/log/messages from webif.
Are you using wifi having some occasional disconnects/ signal loss.

31-01-2008, 23:28
I am using this router also for long distance link: green line RSSI on my router. Other link is is 1km apart!
See last week log with rrdtool.

Not seeing syslog in webif seems to be bug in Xwrt not handling files but rather circular. I do not bother with such things.

Stock QOS should suffice. Except of course with some technologies that you want to use and are not standard.

01-02-2008, 22:14
Well basically this thread concludes everything to get transmission going on kamikaze.
One thing that should be added is to add a line in thttpd.conf : 'cgipat=\cgi-bin\*'

06-02-2008, 15:45

Ive got a problem after hard unplug of the HDD.
Cant mount nor fdisk it.

PCI: Enabling device 01:03.2 (0000 -> 0002)
ehci_hcd 01:03.2: PCI device 1106:3104
ehci_hcd 01:03.2: irq 2, pci mem c0202000
usb.c: new USB bus registered, assigned bus number 1
EHCI: Enabling VIA 6212 workarounds
ehci_hcd 01:03.2: USB 2.0 enabled, EHCI 1.00, driver 2003-Dec-29/2.4
hub.c: USB hub found
hub.c: 4 ports detected
SCSI subsystem driver Revision: 1.00
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
USB Mass Storage support registered.
hub.c: new USB device 01:03.2-1, assigned address 2
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: Maxtor 6 Model: Y120P0 Rev: YAR4
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 234375000 512-byte hdwr sectors (120000 MB)
Partition check:
/dev/scsi/host0/bus0/target0/lun0:<6>device wl0 entered promiscuous mode
wl0: attempt to add interface with same source address.
br-lan: port 2(wl0) entering learning state
br-lan: port 2(wl0) entering forwarding state
br-lan: topology change detected, propagating
scsi: device set offline - not ready or command retry failed after bus reset: host 0 channel 0 id 0 lun 0
SCSI disk error : host 0 channel 0 id 0 lun 0 return code = 50000
I/O error: dev 08:00, sector 0
I/O error: dev 08:00, sector 2
I/O error: dev 08:00, sector 0
unable to read partition table
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2

Doesnt see partitions in lun0/disc just disc

06-02-2008, 16:27
What a man can do?
Test both components separately.
Plug in USB key, Mount disk on linux PC.
Recommended thing to do: Shorten USB cable to 30cm.

06-02-2008, 23:01

Well I dont really feel that I need to shorten the cable because it worked for more than a year like that without probs.
I remember that disconnecting the HDD during work was always a problem but I never encountered a complete partition loss !!!

As Ive said before it was an accident. Stuff happens and it got unplugged during work. Does this mean that every time an 'accident' occurs I need to reinstall and loose everything ?

The only thing I got now is a pink 'disc' in scsi. Cant even run fdisk on it :S.

06-02-2008, 23:21
After 4th or 5th reboot it worked. Strange ?

20-02-2008, 16:52

How do I password protect thttpd stuff ?

20-02-2008, 16:56

Use global .htpasswd file that is created with command htpasswd.