DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#26 2008-03-30 19:40:53

aeronet
Member
Registered: 2008-03-30
Posts: 14

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

Hi,

I have another way to let the box do the right job at shutdown,reboot (umount the filesystem on your big disk).

If you have installed additional tools like utelnetd which are not shipped with the original dlink firmware then you
have the problem with the umount.

The dns-323 shutdown script from dlink does things like this kill $(pidof mt-daapd), $(pidof smbd),... etc.
But does not kill $(pidof utelnetd) that launched from the /mnt/HD_a2 mount point.
The result is, the shutdown script can not umount the /mnt/HD_a2 mount point because it's still in access.

The easiest way to solve this problem (not the best but it works wink) is to rename the additional tools like the
original firmware services e.g. rename utelnetd to mt-daapd.

e.g.:
$ mv /mnt/HD_a2/lnx_bin/utelnetd /mnt/HD_a2/lnx_bin/mt-daapd

### optional: to identify what's the utelnetd you can create subdirectories
$ mkdir /mnt/HD_a2/lnx_bin/utelnetd
$ mv /mnt/HD_a2/lnx_bin/mt-daapd /mnt/HD_a2/lnx_bin/utelnetd
### optional

and now edit your startup files for telnet etc...

Last edited by aeronet (2008-03-30 19:43:15)

Offline

 

#27 2008-03-31 02:20:28

jayas
Member
Registered: 2008-01-24
Posts: 151

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

Hi Aeronet,

aeronet wrote:

I have another way to let the box do the right job at shutdown,reboot (umount the filesystem on your big disk).
...
The easiest way to solve this problem (not the best but it works ;)) is to rename the additional tools like the
original firmware services e.g. rename utelnetd to mt-daapd.

What happens if the DNS-323 needs to access mt-daapd?

Jaya


H/W=B1 F/W=1.04; RAID1: SAMSUNG HD501LJ T166 (500GB, SATA 3.0Gb/s 16MB)

Offline

 

#28 2008-04-02 21:12:54

aeronet
Member
Registered: 2008-03-30
Posts: 14

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

jayas wrote:

Hi Aeronet,

aeronet wrote:

I have another way to let the box do the right job at shutdown,reboot (umount the filesystem on your big disk).
...
The easiest way to solve this problem (not the best but it works wink) is to rename the additional tools like the
original firmware services e.g. rename utelnetd to mt-daapd.

What happens if the DNS-323 needs to access mt-daapd?

Jaya

Nothing,
The mt-daapd shipped with the original firmware is a complete other binary located on a complete other place.
The original mt-daapd is located in /usr/sbin/mt-daapd and your renamed telnet daemon is located e.g. in /mnt/HD_a2/lnx_bin/mt-daapd. The Dlink startup script will only launch the iTunes Server mt-daapd located in /usr/sbin.

The name of the binaries is the same, but the function is completely different.

On shutdown the DNS-323 kill both daemons and cleanly umount the filesystem. This is the benefit.

Andre

Last edited by aeronet (2008-04-02 21:13:38)

Offline

 

#29 2008-04-18 16:08:01

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

There's a tiny bug in share/cleanboot/cleanboot.sh on line 47:

Code:

if [ -e /mnt/HD_b2 ]; then /bin/chmod 0777 /mnt/HD_a2 ; fi

I believe it should say "HD_b2" at the end as well.
I currently only have 1 drive in my NAS, so I haven't noticed any problems with this, but others might.

I use cleanboot with ffp-0.5.

Offline

 

#30 2008-04-19 07:39:27

jayas
Member
Registered: 2008-01-24
Posts: 151

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

Hi Andre

aeronet wrote:

Nothing,
The mt-daapd shipped with the original firmware is a complete other binary located on a complete other place.
The original mt-daapd is located in /usr/sbin/mt-daapd and your renamed telnet daemon is located e.g. in /mnt/HD_a2/lnx_bin/mt-daapd. The Dlink startup script will only launch the iTunes Server mt-daapd located in /usr/sbin.

I understand well how you are interepting mt-daapd invocation but that assumes you know about all instances (at least the purposes) of mt-daapd calls and arguments originating from D-LINK scripts and programs.

Your solution is fine if mt-daapd is only invoked from startup script and not elsewhere and killed terminated using SIGKILL.  I wonder what happens if is terminated using SIGTERM (that cannot be caught) and then restarted.

Jaya


H/W=B1 F/W=1.04; RAID1: SAMSUNG HD501LJ T166 (500GB, SATA 3.0Gb/s 16MB)

Offline

 

#31 2008-05-18 16:28:13

Bertoliati
New member
Registered: 2008-05-18
Posts: 1

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

Hello all,

I had some problems by installing cleanboot-2.0 on CH3SNAS(firmware 1.03) /funplug-0.4.
Following is happening

When I run .../start/cleanboot.sh the script hangs
"* Running /mnt/HD_a2/fun_plug.d/start/cleanboot.sh start ...
Setting up cleanboot... "

When I push enter it is saying:
   "Cannot remove: Read only filesystem"

This is coming from the rule
   rm /usr/sbin/do_reboot 2>/dev/null
so /usr/sbin seems to be read only.

After the installation i run reboot. The script is working because it is unmounting the drives but it will not reboot the NAS because it is looping with the following messages:

$Shutting down SMB services: ....
$Shutting down NMB services: ....
umount: /mnt/HD_a*: not found
Refresh Shared Name Table version v1.04
Refresh Shared Name Table versi ...
...
Refresh Shared Name Table version v1.04
umount: /mnt/HD_b*: not found
Refresh Shared Name Table version v1.04
...
repeat

Only method to reboot after this is to switch the power off and reboot.
Any idea to fix this??

Thx

Offline

 

#32 2008-05-19 08:34:30

monkeymajiik
New member
Registered: 2007-12-02
Posts: 2

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

I am having the same problems as RAP.

shutdown tells me it's stopping telnet and ntpd (if i'm using it at the time) and my telnet drops out.  But the box stays on, and I can log on with the webui.

I havent got anything running that's not in /start.

FW1.03 FFP 0.5

Where do I start to troubleshoot?

Last edited by monkeymajiik (2008-05-19 08:49:35)

Offline

 

#33 2008-05-19 17:26:35

bfg100k
Member
Registered: 2007-09-15
Posts: 55

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

monkeymajiik wrote:

I am having the same problems as RAP.

shutdown tells me it's stopping telnet and ntpd (if i'm using it at the time) and my telnet drops out.  But the box stays on, and I can log on with the webui.

I havent got anything running that's not in /start.

FW1.03 FFP 0.5

Where do I start to troubleshoot?

Make that one more to the list of "reboot/shutdown just hangs there after telnet/ssh session is dropped".

Offline

 

#34 2008-06-02 20:26:22

toxite
New member
Registered: 2007-11-28
Posts: 3

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

I unfortunately don't have any advice for the people whose DNS-323s are hanging on shutdown.

Just a question: what about the /sbin/poweroff symlink?  It's not handled explicitly by cleanboot, but would it be safe to add to the list of symlinks to POF's cleanboot startup script?  I'm not up on the distinction between halt, shutdown, and poweroff, but I'm assuming they all server pretty much the same purpose on the DNS-323.  Yeah?

Offline

 

#35 2008-06-03 17:48:37

EnricoM
Member
From: Netherlands
Registered: 2008-06-03
Posts: 77

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

Bertoliati wrote:

Hello all,

I had some problems by installing cleanboot-2.0 on CH3SNAS(firmware 1.03) /funplug-0.4.
Following is happening

When I run .../start/cleanboot.sh the script hangs
"* Running /mnt/HD_a2/fun_plug.d/start/cleanboot.sh start ...
Setting up cleanboot... "

When I push enter it is saying:
   "Cannot remove: Read only filesystem"

This is coming from the rule
   rm /usr/sbin/do_reboot 2>/dev/null
so /usr/sbin seems to be read only.

I have the same error (read only filesystem) on my CH3SNAS with the following command from the cleanboot script
  rm /usr/sbin/do_reboot 2>/dev/null

When I checked /usr/sbin it appeared to be linked to /sys/crfs/sbin
And /sys/crfs is squashfs. Squashfs is a compressed read-only filesystem for Linux.

I tried CH3SNAS firmware 1.03Final, 1.03BETA6a, 1.04RC1
I tried Fonz fun_plug 0.4 and 0.5beta
None of them seem to work...

I guess cleanboot will never work with the recent CH3NAS firmware. Can somebody confirm this? Or is there another way to make it work?


Hardware: Conceptronic CH3SNAS, FW1.03 - 2x Samsung Spinpoint F1 750 MB, no RAID  - Imation Whizz 4GB USB Flash Drive
Software:  Fun_plug 0.5 beta, SSH, Samba recycle bin, Firefly, hellanzb, nzbget, cleanboot, chrooted etch, optware, midnight commander, rsnapshot

Offline

 

#36 2008-06-26 09:33:36

boxed
New member
Registered: 2008-06-26
Posts: 1

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

I can confirm the error EnricoM has.

I have a CH3SNAS with firmware version 1.03 final 2 and use ffp 0.5.
Cleanboot gives me the error 'Cannot remove: Read only filesystem' when 'Setting up cleanboot...'.

Would this problem be with the firmware version 1.03+ of with funplug 0.5+?

Offline

 

#37 2008-07-05 19:31:19

panda71
Member
Registered: 2008-07-03
Posts: 5

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

One more CH3SNAS user with the non working cleanboot as mentioned above.

Panda

Offline

 

#38 2008-07-05 21:53:05

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

here another one

Offline

 

#39 2008-07-06 20:02:24

TomSluyts
Member
Registered: 2008-06-26
Posts: 14

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

same here, it does not work on the conceptronic

Offline

 

#40 2008-07-09 20:27:44

kikkeraap
Member
Registered: 2008-03-19
Posts: 17

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

same issue here on a CH3SNAS

Offline

 

#41 2008-07-09 20:34:21

EnricoM
Member
From: Netherlands
Registered: 2008-06-03
Posts: 77

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

A work around for CH3SNAS users is posted here: http://dns323.kood.org/forum/t2131-clea … ng%3F.html

Last edited by EnricoM (2008-07-09 20:35:16)


Hardware: Conceptronic CH3SNAS, FW1.03 - 2x Samsung Spinpoint F1 750 MB, no RAID  - Imation Whizz 4GB USB Flash Drive
Software:  Fun_plug 0.5 beta, SSH, Samba recycle bin, Firefly, hellanzb, nzbget, cleanboot, chrooted etch, optware, midnight commander, rsnapshot

Offline

 

#42 2008-07-09 21:50:36

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

EnricoM wrote:

A work around for CH3SNAS users is posted here: http://dns323.kood.org/forum/t2131-clea … ng%3F.html

After applying your workaround i get the following log messages:

Setting up cleanboot...
rm: /usr/sbin: is a directory
mkdir: cannot create directory '/usr/sbin': File exists
ln: /usr/sbin/HDDStrCmp: File exists
ln: /usr/sbin/SetTimeZone: File exists
ln: /usr/sbin/addtbl: File exists
ln: /usr/sbin/auto_prescan: File exists
ln: /usr/sbin/chg_hostname: File exists
ln: /usr/sbin/chg_raid_tbl: File exists
ln: /usr/sbin/chk_fun_plug: File exists
ln: /usr/sbin/chk_mtdaapd_path: File exists
ln: /usr/sbin/chk_openssl: File exists
ln: /usr/sbin/chk_sysfile: File exists
ln: /usr/sbin/chk_upnpav_path: File exists
ln: /usr/sbin/chkbutton: File exists
ln: /usr/sbin/daylight: File exists
ln: /usr/sbin/ddns-start: File exists
ln: /usr/sbin/deltbl: File exists
ln: /usr/sbin/detect_char_encode: File exists
ln: /usr/sbin/djpeg: File exists
ln: /usr/sbin/email: File exists
ln: /usr/sbin/ex_goweb: File exists
ln: /usr/sbin/ex_opserver: File exists
ln: /usr/sbin/ex_tr069: File exists
ln: /usr/sbin/ez-ipupdate: File exists
ln: /usr/sbin/fancontrol: File exists
ln: /usr/sbin/fanspeed: File exists
ln: /usr/sbin/fdiskok: File exists
ln: /usr/sbin/ff_disk: File exists
ln: /usr/sbin/format_ide: File exists
ln: /usr/sbin/getdhcp: File exists
ln: /usr/sbin/hd_verify: File exists
ln: /usr/sbin/hddinfo: File exists
ln: /usr/sbin/ins_codepage: File exists
ln: /usr/sbin/insmod: File exists
ln: /usr/sbin/lsmod: File exists
ln: /usr/sbin/mac_read: File exists
ln: /usr/sbin/mac_write: File exists
ln: /usr/sbin/mdadm: File exists
ln: /usr/sbin/mfg_search: File exists
ln: /usr/sbin/mt-daapd: File exists
ln: /usr/sbin/op_server: File exists
ln: /usr/sbin/prescan: File exists
ln: /usr/sbin/raidlevel_parser: File exists
ln: /usr/sbin/raidstart: File exists
ln: /usr/sbin/raidstop: File exists
ln: /usr/sbin/raidsync: File exists
ln: /usr/sbin/raidsync_time: File exists
ln: /usr/sbin/raidtab: File exists
ln: /usr/sbin/raidtab_parser: File exists
ln: /usr/sbin/rmmod: File exists
ln: /usr/sbin/rtc: File exists
ln: /usr/sbin/scsiproc_parser: File exists
ln: /usr/sbin/scsistart: File exists
ln: /usr/sbin/scsistop: File exists
ln: /usr/sbin/set_ddns: File exists
ln: /usr/sbin/sharedname_sort: File exists
ln: /usr/sbin/sntp: File exists
ln: /usr/sbin/stime: File exists
ln: /usr/sbin/swapup: File exists
ln: /usr/sbin/temperature: File exists
ln: /usr/sbin/upnpav_sf: File exists
ln: /usr/sbin/write_create_raid: File exists
ln: /usr/sbin/write_hd_info: File exists
ln: /usr/sbin/write_raidtab: File exists
ln: /usr/sbin/write_spare_dsk: File exists

Any ideas what went wrong?

Offline

 

#43 2008-07-09 23:50:34

EnricoM
Member
From: Netherlands
Registered: 2008-06-03
Posts: 77

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

knireis wrote:

Any ideas what went wrong?

No... I have the same problem at the moment and I lost my Telnet/SSH connection to my NAS.  I have restored the connection. It seems that the /usr/sbin folder can not be removed by the script, although it is possible to do it manually from the command line with these commands.

Update:
I have got it working now.
Use rm -r sbin instead of rm sbin

My changes to /ffp/start/cleanboot.sh are as follows:

Code:

....
cleanboot_start()
{
        echo "Setting up $name..."
        cd /usr
        rm -r sbin
        mkdir /usr/sbin
        ln -s /sys/crfs/sbin/* /usr/sbin/
        rm /usr/sbin/do_reboot 2>/dev/null
        rm /sbin/reboot 2>/dev/null
        rm /sbin/shutdown 2>/dev/null
        rm /sbin/halt 2>/dev/null
        rm /ffp/sbin/reboot 2>/dev/null
        rm /ffp/sbin/halt 2>/dev/null
        rm /ffp/sbin/shutdown 2>/dev/null
        chmod 0755 /ffp/share/cleanboot/*
        cp /ffp/share/cleanboot/do_reboot.pof /usr/sbin/do_reboot
        cp /ffp/share/cleanboot/cleanboot.sh /sbin/cleanboot.sh
        ln -s /usr/sbin/do_reboot /sbin/shutdown
        ln -s /usr/sbin/do_reboot /sbin/halt
        ln -s /usr/sbin/do_reboot /sbin/reboot
}
....

Last edited by EnricoM (2008-07-10 14:06:40)


Hardware: Conceptronic CH3SNAS, FW1.03 - 2x Samsung Spinpoint F1 750 MB, no RAID  - Imation Whizz 4GB USB Flash Drive
Software:  Fun_plug 0.5 beta, SSH, Samba recycle bin, Firefly, hellanzb, nzbget, cleanboot, chrooted etch, optware, midnight commander, rsnapshot

Offline

 

#44 2008-07-21 09:40:12

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

EnricoM wrote:

knireis wrote:

Any ideas what went wrong?

No... I have the same problem at the moment and I lost my Telnet/SSH connection to my NAS.  I have restored the connection. It seems that the /usr/sbin folder can not be removed by the script, although it is possible to do it manually from the command line with these commands.

Update:
I have got it working now.
Use rm -r sbin instead of rm sbin

I inserted your new code and i don't get the error message anymore but when i type the command 'reboot' nothing happens.
I restarted cleanboot.sh after modifying.

Offline

 

#45 2008-07-21 10:30:02

EnricoM
Member
From: Netherlands
Registered: 2008-06-03
Posts: 77

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

Knireis wrote:

I inserted your new code and i don't get the error message anymore but when i type the command 'reboot' nothing happens.

Do you use fun_plug 0.5?


Hardware: Conceptronic CH3SNAS, FW1.03 - 2x Samsung Spinpoint F1 750 MB, no RAID  - Imation Whizz 4GB USB Flash Drive
Software:  Fun_plug 0.5 beta, SSH, Samba recycle bin, Firefly, hellanzb, nzbget, cleanboot, chrooted etch, optware, midnight commander, rsnapshot

Offline

 

#46 2008-07-21 11:00:28

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

yes i do

Offline

 

#47 2008-07-21 14:58:20

EnricoM
Member
From: Netherlands
Registered: 2008-06-03
Posts: 77

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

Hmmm, I have no problems at all. Try the following commands and check where you have a difference:
root@MEDIASERVER:/# which reboot
/sbin/reboot
root@MEDIASERVER:/# ls -l /sbin/reboot
lrwxrwxrwx    1 root     root           19 Jul 19 14:35 /sbin/reboot -> /usr/sbin/do_reboot
root@MEDIASERVER:/# ls -l /usr/sbin/do_reboot
-rwxr-xr-x    1 root     root         3632 Jul 19 14:35 /usr/sbin/do_reboot
root@MEDIASERVER:/#

You could also start the scipt manually (/ffp/start/cleanboot.sh start) and check if the script runs without errors

P.S. I assume you run Firmware 1.03, is that correct?

Last edited by EnricoM (2008-07-21 15:01:13)


Hardware: Conceptronic CH3SNAS, FW1.03 - 2x Samsung Spinpoint F1 750 MB, no RAID  - Imation Whizz 4GB USB Flash Drive
Software:  Fun_plug 0.5 beta, SSH, Samba recycle bin, Firefly, hellanzb, nzbget, cleanboot, chrooted etch, optware, midnight commander, rsnapshot

Offline

 

#48 2008-07-21 16:07:24

knireis
Member
Registered: 2007-12-10
Posts: 231

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

My results are a bit different:

root@CH3SNAS:~# which reboot
/sbin/reboot
root@CH3SNAS:~# ls -l /sbin/reboot
lrwxrwxrwx    1 root     root           12 Jul  1 04:57 /sbin/reboot -> /bin/busybox
root@CH3SNAS:~# ls -l /usr/sbin/do_reboot
-rwxrwxrwx    1 root     root         3860 Jul  1 04:57 /usr/sbin/do_reboot
root@CH3SNAS:~#

And i use fw 1.04rc4, so that might be the reason.

Offline

 

#49 2008-07-21 17:52:45

EnricoM
Member
From: Netherlands
Registered: 2008-06-03
Posts: 77

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

The script fails, but I don't know where exectly (the problem is that reboot is still linked to busybox instead of do_reboot).
If you type the commands manually one by one (don't type the '2>/dev/null' part of the commands), then you might be able to see where the script fails.

Could you also post the output of 'mount' and 'ls -l /bin/busybox'? I am just curious if there is a change between FW1.03 and 1.04 and to see if this might be the cause.


Hardware: Conceptronic CH3SNAS, FW1.03 - 2x Samsung Spinpoint F1 750 MB, no RAID  - Imation Whizz 4GB USB Flash Drive
Software:  Fun_plug 0.5 beta, SSH, Samba recycle bin, Firefly, hellanzb, nzbget, cleanboot, chrooted etch, optware, midnight commander, rsnapshot

Offline

 

#50 2008-07-21 19:14:04

silversurfer
Member
Registered: 2008-07-20
Posts: 95

Re: cleanboot 1.0 for DNS-323 / CH3SNAS

I can at least say that it is not because of the firmware or funplug.

I have a CH3SNAS myself with firmware 1.04RC4 and funplug 1.05. That's the same as knireis' system.

If you like you can try my cleanboot installation. I attached it to this post. Copy the cleanboot-2.0.5-ffp05.tar to your /ffp directory and then do:

"cd /ffp"
"tar -xvf cleanboot-2.0.5-ffp05.tar"

This will unpack the files to their respective directories ( etc, share and start ).

Please keep in mind that I don't have to use the "rm -r sbin" but instead use only "rm sbin" in my script.


Attachments:
Attachment Icon cleanboot-2.0.5-ffp05.tar, Size: 20,480 bytes, Downloads: 768

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB