juanfranblanco / rt-n56u

Automatically exported from code.google.com/p/rt-n56u
0 stars 0 forks source link

Swap is automatically deleted in RT-N56U_1.0.1.7f-p10_3 #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Update to RT-N56U_1.0.1.7f-p10_3
2. Start transmission, cron and castget
3. Wait for a short time

What is the expected output? What do you see instead? The swap file /opt/.swap 
is simply deleted. You can create it again, but, when the router is restarted 
it is simply deleted again. Without swap, transmission does not work properly.

What version of the product are you using? On what operating system?
RT-N56U_1.0.1.7f-p10_3 on Windows 7 and MacOS lion.

Please provide any additional information below.
I believe that it is a bug from the router.... after some time downloading 
torrents, the router stops. I believe it is a problem with memory.

Original issue reported on code.google.com by egcarr...@gmail.com on 2 Feb 2012 at 3:29

GoogleCodeExporter commented 9 years ago
Hello! Are you sure it is really deleted? Files which start with '.' are 
'invisible'...

Original comment by d...@soulblader.com on 2 Feb 2012 at 11:10

GoogleCodeExporter commented 9 years ago
No... I am sure of that. If I do ls -la it does not appear. Besides, if I make 
cat /proc/swaps it does not list any swap files.... it was not happen in the 
1.0.1.7f-p9.

I tried to start everything from scratch in order to test p10... I formatted my 
drive again and I configured everything again using the guide in the wiki 
session. It creates the swap file perfect, but after finishing my configuration 
(with transmission, cron and cast get) it is simply deleted.

Original comment by egcarr...@gmail.com on 2 Feb 2012 at 11:17

GoogleCodeExporter commented 9 years ago
Ok. Thanks. I'l' check it.

Original comment by d...@soulblader.com on 2 Feb 2012 at 11:19

GoogleCodeExporter commented 9 years ago
I solved the problem in the harder way... i restored the original asus firmware 
and the default setting.... then I upgraded to 1.0.1.7f.p10-4 and I configured 
the router again, step by step. Now it is working... however, I have noticed 
that sometimes, when I reboot the router, my swap is simply deleted. When it 
happens, I have to disable opt ware, recreate swap and reenable optware.

Thank you for your firmware. It rocks. 

Asus should hire you for building firmwares for them ;-) The original firmware 
sucks... and the download master is terrible!!!

Original comment by egcarr...@gmail.com on 6 Feb 2012 at 10:42

GoogleCodeExporter commented 9 years ago
Hi! Please, sorry! I completely forgot to check it.
I've done it now/ So, I've created swap file, switched it, then rebooted my 
router.
I can see it is mounted. So, it wasn't deleted.

Let's check if you're doing everything the right way:
1) what's the full path of swap you make?
2) how do you make it?
3) how do you mount it?

Original comment by d...@soulblader.com on 6 Feb 2012 at 1:52

GoogleCodeExporter commented 9 years ago
I am following the guide in 
http://code.google.com/p/rt-n56u/wiki/HowToConfigureOptware

However the command opt-mkswap was not working... then I have created it using:
# dd if=/dev/zero of=/media/AiDisk_a1/opt/.swap bs=1024 count=262144
# mkswap /media/AiDisk_a1/opt/.swap

Then I unwonted the driver, enabled opt ware and mounted it again... when I 
connect to it through SSH, everything is ok.... if I type free I can see the 
swap... the same happens with >cat /proc/swaps

However, sometimes, if I reboot the router, the swap file is deleted.... then I 
have to create it again manually, following the same procedure.

Original comment by egcarr...@gmail.com on 6 Feb 2012 at 2:09

GoogleCodeExporter commented 9 years ago
Have you installed any other applications from repository, besides transmission?
Could you please post here:

# ls -la /opt/etc/init.d

and attach your transmission start script, please.

Original comment by d...@soulblader.com on 6 Feb 2012 at 2:20

GoogleCodeExporter commented 9 years ago
Yes... I have installed three applications.... transmission, nano and cast 
get.... in that order!

Original comment by egcarr...@gmail.com on 6 Feb 2012 at 2:22

GoogleCodeExporter commented 9 years ago
Yes... I have installed three applications.... transmission, nano and cast
get.... in that order!

Original comment by egcarr...@gmail.com on 6 Feb 2012 at 2:22

GoogleCodeExporter commented 9 years ago
I'm not sure what is castget, but how do you start / stop it?..

Original comment by d...@soulblader.com on 6 Feb 2012 at 2:55

GoogleCodeExporter commented 9 years ago
You know, if you use only start options for this application and so not stop it 
before disk unmount / reboot, usb disk is not being unmounted. If it doesn't 
router reboots with mounted flash and maybe swap too. It may be the reason you 
loosing it. It is very dangerous, your disk can be seriously damaged!

Original comment by d...@soulblader.com on 6 Feb 2012 at 3:03

GoogleCodeExporter commented 9 years ago
castget is a small program for automatically download torrents through rss... 
it does not remain in memory... you call it, then it executes the process and 
it stops... it just checks for new torrents in the server...

But I forgot one package.. I also installed cron... cron is responsible for 
calling cast get at each 12 hours....

I am using the cron start script that you gave to me... I believe that this is 
the same that you use. Cron starts automatically with my router... I am using a 
S10cron script in /etc/init.d

Original comment by egcarr...@gmail.com on 6 Feb 2012 at 3:45

GoogleCodeExporter commented 9 years ago
Aaa, yeah, I remember that issue.. )
Ok, try to unmount disk via web iface (don't login via terminal or stop any 
program in terminal). Then look to syslog in web iface. Is it clean? I mean are 
there any messages like "can't unmount disk..." or smth. like that.

Original comment by d...@soulblader.com on 6 Feb 2012 at 4:30

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Ok... firstly I cleared my log in order to avoid unuseful messages... then I 
removed the HD via Web Interface... apparently it was ok... then I checked my 
log and it had the following messages:

Feb  6 22:07:00 NFS Server: nfsd daemon is stoped
Feb  6 22:07:00 Samba Server: smb daemon is stoped
Feb  6 22:07:00 FTP Server: daemon is stoped
Feb  6 22:07:00 Media Server DLNA: daemon is stoped
Feb  6 22:07:00 iTunes: daemon is stoped
Feb  6 22:07:00 opt-umount.sh: started [/dev/sda1 /media/AiDisk_a1]
Feb  6 22:07:01 transmission-daemon: Stopping transmission-daemon...
Feb  6 22:07:03 transmission-daemon[10379]: Closing session
Feb  6 22:07:03 opt-umount.sh: Deactivate swap file /opt/.swap SUCCESS!
Feb  6 22:07:03 opt-umount.sh: umount /opt FAILED! Device is busy?
Feb  6 22:07:04 opt-umount.sh: started [/dev/sda1 /opt]
Feb  6 22:07:04 opt-umount.sh: umount /opt FAILED! Device is busy?

As you can see it is not amounting the HD properly...

Besides, I have noticed that my swap file was deleted again!

Original comment by egcarr...@gmail.com on 7 Feb 2012 at 1:35

GoogleCodeExporter commented 9 years ago
Yes, I can see. So, the next thing you can do. Let it be mounted as usually by 
router.
It seems that transmission daemon and Media Server were stopped successfully. 
So stop all scripts with /opt/etc/init.d/S..... stop. Then cd to /. See what is 
mounted. And try to unmount : umount /media/AiDisk_a1. If it fails type: fuser 
-m /dev/sda1. It will show PIDs of processes, which use disk. If you could 
unmount it without any problems, then the problem is in one of scripts in 
/opt/etc/init.d

By the way, it is strange swap is being deleted, because it is being 
deactivated before the error...

Original comment by d...@soulblader.com on 7 Feb 2012 at 2:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Aha, here you go - the error should be here: 

do_stop()
{
## Make sure an instance of daemon is running
if [ -z "`pidof $daemon`" ] ; then
    echo -e "\v\t\033[1;37;41m ${daemon##*/} is not running! \033[0;0;0m\v"
    exit 1
fi

change with:
do_stop()
{
## Make sure an instance of daemon is running
if [ -z "`pidof ${daemon##*/}`" ] ; then
    echo -e "\v\t\033[1;37;41m ${daemon##*/} is not running! \033[0;0;0m\v"
    exit 1
fi

and here:
killall -15 ${daemon##*/} 2>/dev/null ; sleep 1

------
I hope will work now...

there is interesting line below:
Feb  7 00:44:47 Media Server DLNA: daemon is stoped

Are you on p10? =)

Original comment by d...@soulblader.com on 7 Feb 2012 at 4:16

GoogleCodeExporter commented 9 years ago
PS: Pls, sorry for this script, was in hurry!

Original comment by d...@soulblader.com on 7 Feb 2012 at 4:19

GoogleCodeExporter commented 9 years ago
I was wrong... It has not worked after stoping S10cron, S10iptables and 
S95transmission manually.

I rebooted the router and I tried to safetly remove the drive... it has not 
worked, as expected. Then I checked and the process of cron and transmission 
were automatically killed... I received the following process after using the 
commend fuser -m /dev/sda1

/home/root # fuser -m /dev/sda1
1 732 734 735 790 796 798 799 800 807 825 832 842 843 846 849 851 859 860 871 
874 877 892 949 1184 1185 
/home/root # ps
  PID USER       VSZ STAT COMMAND
    1 admin     2984 S    /sbin/init
  732 admin     2288 S    /sbin/syslogd -m 0 -S -O /tmp/syslog.log
  734 admin     2288 S    /sbin/klogd
  735 admin     2980 S    linkstatus_monitor
  790 nobody    1272 S    dnsmasq
  796 admin     2928 S    u2ec
  798 admin     2928 S    u2ec
  799 admin     2928 S    u2ec
  800 admin     1532 S    lpd
  807 admin     1156 S    miniupnpd
  825 admin     2288 S    udhcpc -i eth3 -p /var/run/udhcpc0.pid -s /tmp/udhcp
  832 admin     2212 S    /usr/sbin/pppd file /tmp/ppp/options.wan0
  837 admin        0 SW<  [scsi_eh_0]
  838 admin        0 SW<  [usb-storage]
  842 admin     1736 S    /usr/sbin/infosvr br0
  843 admin     2980 S    ots
  846 admin     2980 S    detect_internet
  849 admin     3044 S    httpd
  851 admin     2288 S    telnetd
  859 admin     2212 S    /usr/sbin/dropbear -W 65536
  860 admin     2980 S    watchdog
  871 admin     1744 S    networkmap
  874 admin     1516 S    lld2d br0
  877 admin     1468 S    rstats
  892 admin     2300 S    /bin/sh
  949 admin     2980 S    ntp
 1184 admin     2308 S    /usr/sbin/dropbear -W 65536
 1185 admin     2300 S    -sh

Original comment by egcarr...@gmail.com on 7 Feb 2012 at 4:21

GoogleCodeExporter commented 9 years ago
I'm sorry again there should be mount point, not device:

fuder -m /media/AiDisk_a1

-------
Attached corrected cron script.

Original comment by d...@soulblader.com on 7 Feb 2012 at 4:36

Attachments:

GoogleCodeExporter commented 9 years ago
I updated the S10cron script and I removed to HDD from webi. I had the 
following log:

Feb  7 09:56:17 NFS Server: nfsd daemon is stoped
Feb  7 09:56:17 Samba Server: smb daemon is stoped
Feb  7 09:56:17 FTP Server: daemon is stoped
Feb  7 09:56:17 Media Server DLNA: daemon is stoped
Feb  7 09:56:17 iTunes: daemon is stoped
Feb  7 09:56:17 opt-umount.sh: started [/dev/sda1 /media/AiDisk_a1]
Feb  7 09:56:17 transmission-daemon: Stopping transmission-daemon...
Feb  7 09:56:18 transmission-daemon[1060]: Closing session
Feb  7 09:56:19 Cron: was stopped succesfully
Feb  7 09:56:19 opt-umount.sh: Deactivate swap file /opt/.swap SUCCESS!

I believe that everything worked perfectly now. I restarted my router and my 
swap was there.. thank you very much.

Is there a way to make a full backup of my router? Everything that I want at 
now is working perfectly (transmission, cron, cast get, automatic download of 
tv shows, etc)...

Once again... thank you very much for your support

Original comment by egcarr...@gmail.com on 7 Feb 2012 at 1:06

GoogleCodeExporter commented 9 years ago
You are welkome! ) Try to stop applications in opt, then do:

# cd /
# tar -jcvf /media/AiDisk_a1/opt-backup.tar.bz2 opt

and copy it to local machine for example.

if you need  to restore, do almost the same:

# cd /
# tar -jxvf /media/AiDisk_a1/opt-backup.tar.bz2

Original comment by d...@soulblader.com on 7 Feb 2012 at 1:56

GoogleCodeExporter commented 9 years ago

Original comment by d...@soulblader.com on 9 Feb 2012 at 8:00