Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
Background info.
On startup DSM-G600 will run /etc/rc.sh which will mount the various filesystems and initialize the drive.
... touch /tmp/boot_finished /usr/sbin/chk_fun_plug &
/usr/sbin/chk_fun_plug will check for file called fun_plug on the disks root and then executes it.
#!/bin/sh sleep 30 Dir_Len=28 Filename_Len=26 CUSTOMIZEHDPATH=/sys/custom/shared_name/HD file=$(find "$CUSTOMIZEHDPATH"/*) HD_Path=`expr substr "$file" "$Dir_Len" "$Filename_Len"` HD_Path=$HD_Path"a2" if [ -e /mnt/$HD_Path/fun_plug ]; then echo "function plug enable" /mnt/$HD_Path/fun_plug fi
Using fun_plug.
*Install new unformatted hard drive to your DSM-G600.
*Boot-up.
*Go into http://<insert dsm-g600 ip here>/
*Press format.
*When finished, shutdown DSM-G600.
*Take hard disk out of DSM-G600 and mount it into your (nix based, ext3 supported) computer.
*Execute these commands.
touch /mnt/<insert dsm-g600 disk mount point here>/fun_plug chmod 777 /mnt/<insert dsm-g600 disk mount point here>/fun_plug
*Edit /mnt/<insert dsm-g600 disk mount point here>/fun_plug with your favorite text editor. For example, you can test fun_plug with following lines.
#!/bin/sh dmesg > /mnt/HD_a2/dmesg.out
*Put hard disk back to your DSM-G600.
PS: I have heard that chmoding fun_plug to executable over ftp will also work. But method described here is foolproof
Offline
I edit fun_plug from Windows using vim and seems to work fine. I have Cygwin (www.cygwin.org) installed so chmod is available.
* Format the drive by clicking on the Format button
* Create a share point
* From Windows, type: net use G: \\192.168.0.1\HDD_a /user:admin
Then enter the password
* Edit fun_plug using: vim G:\fun_plug
* Don't forget to make the file UNIX format by typing: :set fileformat=unix
* Using chmod that comes with Cygwin: cd G:; chmod +x fun_plug
* From web interface, reboot DSM-G600
--
Quang
Offline
I am confirming that it's possible to edit the fun_plug from Mac OS X using vim (or any other editor i expect), as well. The steps are similar to above:
* After formatting, mount as a SMB share (In the "Connect To..." Finder window enter "smb://192.168...")
* Edit the fun_plug
* chmod 777 fun_plug
* reboot the routr
The biggest gotcha I had was determining that the hard drive was being mounted as HD_a2. I was trying to redirect to HDD_a because that is the name of my hard drive through the web interface and the name of the smb mount
Thanks for the tutorial - sala and quang.
- Joe
Offline
qn1234 wrote:
I edit fun_plug from Windows using vim and seems to work fine. I have Cygwin (www.cygwin.org) installed so chmod is available.
* Format the drive by clicking on the Format button
* Create a share point
* From Windows, type: net use G: \\192.168.0.1\HDD_a /user:admin
Then enter the password
....
--
Quang
Thanks Quanq, I tried this, but I cannot log me in with the password I use to configure the Web Front-End. I also tried to smb-connect with admin as user, after I tried my pw once i got 192.168.0.1\guest as login possibility.
What did i do wrong?
And by the way, can someone please post a step by step fun_plug possibility of ushare?
Thanks a lot in advance guys,you are doing a great job
Offline
Whats "my password"? Try not add any passwords to your share and try again.
Offline
Ok, without a user in the share, and without a password it worked. Thanks!
Offline
Hiya fellow NAS modders,
I'm waiting for my DNS-323 to arrive, just ordered it. I can imagine the possibililties, as it's based on GPL and can host a large set of files. I guess the tricky part is to recompile the firmware, to allow new services such as SSH, TELNET, IPSEC (would be great to secure file transfers from remote sites) and a second WEBSERVER. A bittorrent client would be awesome. Another thing i'm curious about is to add ports (maybe PATA) and futher RAID configurations (RAID5 and above).
Props to the people who opened this site !!
I'll keep an eye on the forum and share my experiences and mods with you.
/eko
Offline
eko wrote:
Hiya fellow NAS modders,
I'm waiting for my DNS-323 to arrive, just ordered it. I can imagine the possibililties, as it's based on GPL and can host a large set of files. I guess the tricky part is to recompile the firmware, to allow new services such as SSH, TELNET, IPSEC (would be great to secure file transfers from remote sites) and a second WEBSERVER. A bittorrent client would be awesome. Another thing i'm curious about is to add ports (maybe PATA) and futher RAID configurations (RAID5 and above).
Props to the people who opened this site !!
I'll keep an eye on the forum and share my experiences and mods with you.
/eko
You're welcome
We have also separate forum section for DNS-323!
http://dns323.kood.org/forum/f3-General-Discussion.html
Offline
I did add a wiki article about fun plugging. If you see some nonsense or you like to add something then please do it!
http://dns323.kood.org/dsmg600/howto:fun_plug
Offline
Hi,
As a complete novice, I tried to follow your wiki-instructions for fun_plug.
It seemed simple.
I created a fun_plug file copy-pasting the two lines as in your example:
#!/bin/sh
dmesg > /mnt/HD_a2/dmesg.out
I copied that to /HD_a2 using WS_FTP
I changed the rights of fun_plug to 777 using WS_FTP
I can check the rights of /HD_a2/fun_plug really are 777
From web front-end I rebooted the system
Result: nothing. No file "dmesg.out" at /HD_a2.
What have I done wrong here?
My firmware version is 1.02eu
Thank you very much in advance!!
Offline
Common mistake is that people think HD_a2 is a directory that you can create. But it is not, it is mount point and you don't see it from ftp. You can see real HD_a2 only from shell using telnet.
Long story short - fun_plug must be placed at the root of your hard disk.
Offline
sala wrote:
Long story short - fun_plug must be placed at the root of your hard disk.
I am running firmware 1.02 us. after carefully following the steps in the wiki how to page, fun_plug did not work for me.
Did google and found a post mentioned problem with firmware 1.02 http://forum.openwrt.org/viewtopic.php?pid=32760 second post in the page.
Does it mean fun_plug is no longer working in the new firmware?
Thanks
Offline
lhg wrote:
Does it mean fun_plug is no longer working in the new firmware?
No it means you made an error ...
is fun_plug under /mnt/HD_a2/ ? (the root of share when you get the dsm out of the box)
is fun_plug with execute rights ?
is fun_plug valide script ?
did you get all the needed exec from the download section ? (for exemple for telnet you need busybox and sed)
have the execs the execute rights ?
did you mke a typo somewhere like Fun-Plug ?
Offline
BertrandB wrote:
No it means you made an error ...
There was no error, I just used the test script.
#!/bin/sh
dmesg > /mnt/HD_a2/dmesg.out
Left the unit overnight an it worked without any change, which is strange. Thanks anyway
Offline
Hi all!
After several hours of pulling my hair I finally figured it out and thought I'd post a little tip.
Create the fun_plug file using UltraEdit and save it directly to the DSM-G600 using the "File | FTP/Telnet | Save as to ftp..." option, permissions can be set here aswell.
Works like a charm. Telnet is up aswell thanks to UltraEdit.
The Permissions won't stick using a ordinary ftp client.
Thanks and good luck.
Offline
First: The Wiki article was very helpful Thank you!
Next: To get the chmod command to work while using windows ftp you need to use the literal command. The literal command sends the command directly to the remote server without validating it first, this is needed because Windows FTP does not support chmod. So the command from Windows FTP is "literal site chmod 777 fun_plug". I changed the Wiki site to reflect this.
Thanks again for the info on fun_plug
-Mike
Last edited by mppkll (2007-08-21 10:04:08)
Offline
Hello. I ve spent some time trying to fun_plug, with no success. Now I m stuck, so I ll try to ask here. Maybe somebody will help me out.
So, I m quite bad at soldering, so my goal is to leave kernel (firmware for that matter) untouched, and get a linux distro (gentoo or debian, doesnt matter) thru fun_plug and chroot. But for now I cannot fun_plug or, for that matter, telnet.
I got G600 with no ide HDD inside, and attached external usb 2.0 WD HDD of 1Tb.
I have created the file fun_plug in the root of the HDD.
c:\>ftp 192.168.1.18 Connected to 192.168.1.18. 220 korobochka1 FTP server (Version wu-2.6.2(48) Mon Aug 21 14:08:09 CST 2006) User (192.168.1.18:(none)): anonymous 331 Guest login ok, send your complete e-mail address as password. Password: 230 Guest login ok, access restrictions apply. ftp> ls 200 PORT command successful. 150 Opening ASCII mode data connection for directory listing. total 1792 drwxrwxrwx 3 root root 32768 Jul 14 17:36 . drwxrwxrwx 3 root root 32768 Jul 14 17:36 .. -rwxrwxrwx 1 root root 804 Jul 13 21:42 .ftpaccess -rwxrwxrwx 1 root root 21 Jul 14 17:36 .ftpshare -rwxrwxrwx 1 root root 107 Jul 14 17:36 .smb.ses -rwxrwxrwx 1 root root 515228 Aug 18 2006 busybox -rwxrwxrwx 1 root root 127 Jul 14 17:33 fun_plug -rwxrwxrwx 1 root root 133630 Oct 13 2006 sed drwxrwxrwx 4 root root 32768 Jul 13 22:52 video 226 Transfer complete. ftp> pwd 257 "/" is current directory.
the contents of fun_plug is:
#!/bin/sh touch /mnt/HD_a1/a1.txt touch /mnt/HD_a2/a2.txt touch /mnt/HD_a3/a3.txt touch /mnt/HD_a4/a4.txt dmesg > ./dmesg.txt
or in hex, so that you can see LF is UNIX style:
0000000000: 23 21 2F 62 69 6E 2F 73 │ 68 0A 74 6F 75 63 68 20 #!/bin/sh◙touch 0000000010: 2F 6D 6E 74 2F 48 44 5F │ 61 31 2F 61 31 2E 74 78 /mnt/HD_a1/a1.tx 0000000020: 74 0A 74 6F 75 63 68 20 │ 2F 6D 6E 74 2F 48 44 5F t◙touch /mnt/HD_ 0000000030: 61 32 2F 61 32 2E 74 78 │ 74 0A 74 6F 75 63 68 20 a2/a2.txt◙touch 0000000040: 2F 6D 6E 74 2F 48 44 5F │ 61 33 2F 61 33 2E 74 78 /mnt/HD_a3/a3.tx 0000000050: 74 0A 74 6F 75 63 68 20 │ 2F 6D 6E 74 2F 48 44 5F t◙touch /mnt/HD_ 0000000060: 61 34 2F 61 34 2E 74 78 │ 74 0A 64 6D 65 73 67 20 a4/a4.txt◙dmesg 0000000070: 3E 20 2E 2F 64 6D 65 73 │ 67 2E 74 78 74 > ./dmesg.txt
on reboot none of the files appear.
Question: What am I missing? How do i fun_plug?
btw, what is the easiest and most straight forward way to have torrent client on the box? I ve read most of the treads on this forum and it is not clear which is the best way to go.
Offline
Ok, i got it working after installing an internal HDD. It was not said anywhere in howto that you do need to fun_plug from internal HDD only. So beware.
Offline