Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
* Problem:
When you install fun_plug in your DNS-323 or CH3SNAS box, it runs most of the programs from the mounted hard disks, so it prevents them from being unmounted cleanly.
You have this problem if your dmesg shows the following line:
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
* Solution:
Cleanboot will modify the reboot & shutdown process to overcome this issue, allowing you to cleanly reboot or shutdown your box.
* How to install cleanboot in fonz fun_plug 0.5:
telnet or ssh into your box, and issue the following commands:
# wget http://pof.eslack.org/dns323/cleanboot-2.1-ffp05.tgz
# funpkg cleanboot-2.1-ffp05.tgz
# /ffp/start/cleanboot.sh start
* How to upgrade cleanboot to new version 2.1 (2009-11-02):
telnet or ssh into your box, and issue the following commands:
# wget http://pof.eslack.org/dns323/cleanboot-2.1-ffp05.tgz
# funpkg -u cleanboot-2.1.tgz
# /ffp/start/cleanboot.sh start
* How to shutdown your box after cleanboot has been installed:
telnet or ssh into your box and issue the command 'shutdown' or 'halt'.
NOTE: at the moment this is the only way to cleanly shutdown, if you do it either via the web panel or by pressing the button, the hard drives will not be cleanly unmounted.
* How to reboot your box after cleanboot has been installed:
There are several ways to reboot, all of them will umount the hard drives properly:
1) telnet or ssh into your box and issue the command 'reboot'.
2) issue a 'system restart' through the web administration panel
3) point your browser to http://your_nas_ip/goform/System_restart
* How do I repair my filesystem if I already have the 'unchecked fs' warning:
There are two different methods to perform manual filesystem checks, choose the one you prefer:
1) http://dns323.kood.org/forum/t1708-Modi … nance.html
2) http://www.inreto.de/dns323/fsck/
ChangeLog
version-1.1 changes:
- replaced usual reboot, shutdown and halt commands by 'clean' ones
- properly set perms on mount points before halting
version-1.2 changes:
- fix: properly reboot the system (return reboot link to busybox when finished)
version-1.3 changes:
- extended list of binaries to SIGKILL (should not be necessary, but it doesn't hurt anyway)
- look for $FUNPLUGDIR environment variable instead of hardcoded path
version-2.0 changes:
- rewrote do_reboot in C, no longer depend on a patched binary
- all original do_reboot stuff moved to cleanboot external script
- merged shutdown and reboot scripts in a single file
version-2.0-ffp05 changes:
- this package is *only* for fonz fun_plug 0.5-experimental users
- updated startup script
- added config file in /ffp/etc/cleanboot.conf
version-2.1-ffp05 changes:
- merged all fixes done by SilentException, marinalink, silversurfer, EnricoM while i've been away:
- fix do_reboot on some CH3SNAS firmwares
- wakeup disks at the begining
- flush filesystem buffers
- included lsof for better kill handlink
- fix missing paths
- pid check before kill when killing daemons
- swapoff
- thank you guys
Enjoy ;-)
Last edited by pof (2009-11-02 17:16:58)
Offline
pof wrote:
# do_shutdown
Have you tried relinking /sbin/reboot (and/or the funplug versions in .../fun_plug.d/sbin/) to your scripts so that I can use the usual commands without having to remeber to use the special ones?
Offline
I see no problem, you can do for example:
# rm /sbin/reboot
# rm /mnt/HD_a2/fun_plug.d/sbin/reboot
# ln -s /usr/sbin/do_reboot /sbin/reboot
# ln -s /usr/sbin/do_reboot /mnt/HD_a2/fun_plug.d/sbin/reboot
This will allow you to cleanly reboot by using the 'reboot' command.
The same will apply for shutdown, but the link should point to '/usr/sbin/do_shutdown'.
Offline
There's another thing that would be great on shutdown/reboot (haven't seen that in your scripts):
chmod 0777 /mnt/HD_a2 chmod 0777 /mnt/HD_b2 (if present)
This has bitten me several times. See also
http://dns323.kood.org/forum/t407-Runni … THIS..html
Offline
pof wrote:
* Problem:
When you install fun_plug in your DNS-323 or CH3SNAS box, it runs most of the programs from the mounted hard disks, so it prevents them from being unmounted cleanly.
You have this problem if your dmesg shows the following line:Code:
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
Hi Pof,
My installation of (minimal) fun_plug does not run any programs from mounted disks after startup, and thus I am able unmount all disks through TELNET. I still get the EXT2-fs warnings.
Even if fun_plug is not installed, it seems the DNS-323 does not shutdown cleanly. In this case, cleanboot would be useful even if fun_plug is not installed?
Jaya
Offline
jayas wrote:
Even if fun_plug is not installed, it seems the DNS-323 does not shutdown cleanly. In this case, cleanboot would be useful even if fun_plug is not installed?
Yes, it will also be useful in this case, but you will need a "minimal" fun_plug to start cleanboot. If you don't have a standard fun_plug installation, make sure to edit the scripts to fit your needs (ie: manually kill running daemons, fix some hardcoded file paths, etc...).
What cleanboot does, is replacing the intenal 'do_reboot' command with a patched one which will hook up a script in the midlde of the reboot process. If the hooked script touches /tmp/shutdown after the processes have been killed, then it will perform as a shutdown (chkbutton daemon will take care of it), otherwise it will act just as a normal reboot.
Offline
Hi Pof,
I notice that you have provided a patched version of do_reboot. I cannot seem to find the source in the GPL distribution from D-LINK. Could I ask where you got the source from, or if you reverse engineered it from scratch. The script it generates and run seems simple.
Jaya
Offline
I would recommend some changes to the scripts:
1. in pof-clean*. , first run through the stop scripts and then kill the daemons that are still running with kill -9. Maybe you could extent that list also a bit (upnp, rsyncd, unfsd)
2. make /mnt/HD_a2/fun_plug.d changeable in a central place. i have installed it in /mnt/usbstick
Offline
@oxygen:
Theoretically you shouldn't need to kill daemons (only mt-daapd, because that's what I patched on the original binary) because do_reboot and chkbutton take care of that for you. But stopping services properly and then do the kill -9, just in case something failed seems a good idea
Thanks for the feedback, I take note of your suggestions for next version...
Offline
When i type in the first command in the telnet window, I get the following error message:
wget: bad address 'pof.eslack.org'
any suggestions? I run funplug 0.4
Last edited by knireis (2008-03-12 21:29:06)
Offline
@knireis: make sure you have internet connection available (gateway & dns server) set in your DNS323 configuration. Otherwise you can just download the .tgz and place it in your storage through the network instead of using wget.
Offline
Thanks for the patch.
Offline
I have released cleanboot 2.0 (see first post) which includes the following changes:
It no longer depends on the patched do_reboot binary which is not available in dlink or conceptronic GPL sources, I disassembled the do_reboot using radare and found it's pretty simple to implement the same functionality in C. So I rewrote it and put all its functionality in a shell script (/sbin/cleanbot.sh) instead of a binary program, so it should be easily customizable for advanced users.
For those interested in seeing the source it's here:
http://pof.eslack.org/dns323/cleanboot-2.0-src.tar.gz
Instructions to upgrade from 1.x to 2.0 are also in the first post
Last edited by pof (2008-03-13 16:57:09)
Offline
Hi - I've tried to use version 2 for fp 0.4 but I'm not sure that it's working.
After following the install instructions I telneted to my device and ran "reboot". The telnet session is killed but not much happens in the way of an actual reboot happening. After leaving it for a few minutes I can no longer telnet until I restart via the web UI.
funplug.log shows (below) that the script is starting
"* Running /mnt/HD_a2/fun_plug.d/start/cleanboot.sh start ...
Setting up cleanboot... "
Any idea what I might have got wrong?
RAP
Offline
@Rap:
If you have additional software in your fun_plug installation which is not ran through an start/stop script, try adding it to the list of programs to kill in /mnt/HD_a2/fun_plug.d/share/cleanboot/cleanboot.sh
For example, if you have mldonkey installed, add "$(pidof mlnet)" at the end of the "/bin/kill -9" command. You can identify the name of the additional program to kill by issuing the command 'ps ax'.
Offline
I think the only thing I'm running that is not a start script is mediatomb so I'll have a look at that.
Cheers
RAP
Offline
Hi - I edited the section of the file as below but it is still not working
/bin/kill -9 $(pidof mt-daapd) $(pidof ftpd) $(pidof pure-ftpd) \
$(pidof telnetd) $(pidof dropbear) $(pidof svnserve) \
$(pidof smbclient) $(pidof smbd) $(pidof nmbd) \
$(pidof wget) $(pidof btget) $(pidof sftp-server) \
$(pidof SyncMms) $(pidof getMsg) $(pidof lpd) \
$(pidof upnp) $(pidof rsyncd) $(pidof unfsd) \
$(pidof mediatomb)
Any other ideas?
RAP
Offline
No, shutdown doesn't work either.
I'm using he latest stock firmware I could find - 1.04
As I do not see, to have much luck with it, what's the best way to remove the script?
RAP
Offline
rap wrote:
No, shutdown doesn't work either.
I'm using he latest stock firmware I could find - 1.04
As I do not see, to have much luck with it, what's the best way to remove the script?
RAP
To remove script you only have to delete cleanboot.sh from your ${FUNPLUGDIR}/start, and also remove ${FUNPLUGDIR}/share/cleanboot directory... restart your NAS and that's all...
Offline