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

#1 2008-12-25 03:25:46

dP21
Member
Registered: 2008-11-29
Posts: 33

Updated Samba - how to include it on reboot

I've updated Samba using fun_plug 0.5 and it's working well.  So well in fact that I'd like to go permanent on it.  How can I add it to one of the shell scripts so that it is run while the D-Link Samba is stopped?  I've tried adding a stop command to the D-Link Samba within my ./samba.sh in /ffp/start but that hasn't worked.  The only way I've been able to succeed is to ssh into the DNS-323 and then manually running the stop and start commands.

Help!

Offline

 

#2 2008-12-25 11:03:17

bomaroast
Member
Registered: 2008-05-30
Posts: 11

Re: Updated Samba - how to include it on reboot

You'll want to save your new smb.conf to somewhere permanent, like /mnt/HD_a2.  Then create a script in /ffp/start that will run on startup does the following:

Code:

cp /mnt/HD_a2/smb.conf /etc/samba/smb.conf
smb restart

Care to share your improvements?

Last edited by bomaroast (2008-12-25 11:03:41)

Offline

 

#3 2008-12-25 16:22:41

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: Updated Samba - how to include it on reboot

dP21 wrote:

I've updated Samba using fun_plug 0.5 and it's working well.  So well in fact that I'd like to go permanent on it.  How can I add it to one of the shell scripts so that it is run while the D-Link Samba is stopped?  I've tried adding a stop command to the D-Link Samba within my ./samba.sh in /ffp/start but that hasn't worked.  The only way I've been able to succeed is to ssh into the DNS-323 and then manually running the stop and start commands.

Help!

I stop D-Links SAMBA through commands placed in the /ffp/etc/fun_plug.local file;

#########################################################################################################
# We're using Samba from ffp; stop built in smbd and nmbd deamons in preparation for starting ffp Samba #
#########################################################################################################
echo "* Stopping Samba Services"

/bin/kill `pidof nmbd`
/bin/kill `pidof smbd`
sleep 3

#########################################################################################################

The  fun_plug (or your) samba.sh script needs to be in the /ffp/start directory and it's permissions set to 755 in order to start fun_plugs SAMBA servies


Bob Blackwell
Pickering, ON

Offline

 

#4 2008-12-27 04:22:46

dP21
Member
Registered: 2008-11-29
Posts: 33

Re: Updated Samba - how to include it on reboot

bomaroast wrote:

You'll want to save your new smb.conf to somewhere permanent, like /mnt/HD_a2.  Then create a script in /ffp/start that will run on startup does the following:

Code:

cp /mnt/HD_a2/smb.conf /etc/samba/smb.conf
smb restart

Care to share your improvements?

Yup, I already had copied the info from the smb.conf that I needed, and have now made a very sparse one specific to my needs.

I upgraded to the fun plug Samba since it allowed me to use Vista File sync (which I've since realized wasn't worth it afterall).  Nonetheless I'll keep the fun plug version since it supports SWAT (web based admin) which makes administration so much easier.

Offline

 

#5 2008-12-27 04:27:41

dP21
Member
Registered: 2008-11-29
Posts: 33

Re: Updated Samba - how to include it on reboot

rcblackwell wrote:

dP21 wrote:

I've updated Samba using fun_plug 0.5 and it's working well.  So well in fact that I'd like to go permanent on it.  How can I add it to one of the shell scripts so that it is run while the D-Link Samba is stopped?  I've tried adding a stop command to the D-Link Samba within my ./samba.sh in /ffp/start but that hasn't worked.  The only way I've been able to succeed is to ssh into the DNS-323 and then manually running the stop and start commands.

Help!

I stop D-Links SAMBA through commands placed in the /ffp/etc/fun_plug.local file;

#########################################################################################################
# We're using Samba from ffp; stop built in smbd and nmbd deamons in preparation for starting ffp Samba #
#########################################################################################################
echo "* Stopping Samba Services"

/bin/kill `pidof nmbd`
/bin/kill `pidof smbd`
sleep 3

#########################################################################################################

The  fun_plug (or your) samba.sh script needs to be in the /ffp/start directory and it's permissions set to 755 in order to start fun_plugs SAMBA servies

Thanks for the info. 

After some troubleshooting I determined that my previous command of "smb stop" was not working since I was referencing the incorrect path.  I updated it (and added sleep) to my fun_plug.local file and all works.  See below for my code.  Out of curiosity, what is the rationale for putting the sleep 3 command? Does waiting 3 seconds do anything rather than just letting the script file proceed after the smb stop command?

Code:

# Stop DNS-323 Samba server
/usr/bin/smb stop
sleep 3

Last edited by dP21 (2008-12-27 05:18:42)

Offline

 

#6 2008-12-27 16:33:31

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: Updated Samba - how to include it on reboot

dP21 wrote:

Out of curiosity, what is the rationale for putting the sleep 3 command? Does waiting 3 seconds do anything rather than just letting the script file proceed after the smb stop command?

sleep 3 allows time for the kill commands to execute and complete before moving on. It may not be necessary in your case.


Bob Blackwell
Pickering, ON

Offline

 

#7 2009-05-26 14:42:09

erickous
New member
Registered: 2009-05-26
Posts: 2

Re: Updated Samba - how to include it on reboot

I've been looking for a solution to get the FFP Samba running from start-up but for some reason haven't had success using the instructions here.  My fun_plug.local file is currently:

Code:

#!/ffp/bin/sh
PATH=/ffp/sbin:/ffp/bin

# Kill DNS-323 Samba daemons
/bin/kill `pidof nmbd`
/bin/kill `pidof smbd`
sleep 3

# Start SWAT on port 901
echo 'swat 901/tcp' >>/etc/services
sh /ffp/start/inetd.sh restart 1>/dev/null 2>/dev/null</blockquote>

I've also tried replacing the /bin/kill lines with /usr/bin/smb stop and killall nmbd, killall smbd with no luck.  The samba.sh and inetd.sh files in /ffp/start are chmod'd to 777.

The script manages to get SWAT working fine, but the Samba that runs on start-up is the firmware version.  If I run fun_plug.local manually after boot, then the FFP Samba starts running no problem. 

When I have the script output written to a log file (this is from using killall commands), I get the following messages:

killall: nmbd: no process killed
killall: smbd: no process killed

Which makes it look like the firmware Samba daemons aren't running when fun_plug.local is executed?

Any thoughts on what I could be missing so that I can get FFP running from start-up?

Last edited by erickous (2009-05-26 14:51:14)

Offline

 

#8 2009-05-26 16:39:23

RichTJ99
Member
Registered: 2009-01-09
Posts: 49

Re: Updated Samba - how to include it on reboot

Hi,

I was just curious, how is the ffp samba different than the original samba?

Thanks,
Rich

Offline

 

#9 2009-06-02 00:56:15

kramed
Member
Registered: 2009-06-02
Posts: 34

Re: Updated Samba - how to include it on reboot

RichTJ99 wrote:

Hi,

I was just curious, how is the ffp samba different than the original samba?

Thanks,
Rich

I too would be interested to know.

Offline

 

#10 2009-06-02 03:52:54

dP21
Member
Registered: 2008-11-29
Posts: 33

Re: Updated Samba - how to include it on reboot

I initially wanted it so I could use the Windows Vista Sync feature which the original DNS Samba did not support, but did not end up using it. 

One of the features I appreciate is better access control list (ACL) via a web based interface (SWAT).  Full feature list can be found on the Samba release note page.

Last edited by dP21 (2009-06-02 03:54:54)

Offline

 

#11 2011-03-13 15:42:18

aredo3606gif
New member
Registered: 2011-03-13
Posts: 2

Re: Updated Samba - how to include it on reboot

I installed this Samba package "http://www.inreto.de/dns323/fun-plug/0.5/contrib-packages/samba-3.4.6/" on my CH3MNAS running fun_plug 0.5 .. I added the inetd.conf file with the suggested script lines and I added a fun_plug.local file (which didn't exist) to kill the older NAS default SAMBA version.
I copied the smb.conf of the old SAMBA to the /ffp/etc/samba and the new SAMBA 3.4.6 is running and I can access folders as per set rules on smb.conf in SHARE mode.
However.. I can't login on SWAT web server. I keep getting "401 Bad Authorization" trying accessing from my main pc at 192.168.0.2 on my LAN despite the fact that I added users and passwords with "smbpasswd -a root" followed by "smbpasswd -e root" and then I tried adding "smbpasswd -a admin" "smbpasswd -e admin" but it's not working on SWAT.  Why?
I can't figure it out.
On smb.conf I changed from SHARE to USER and then when trying to access CH3MNAS thru the LAN it asked for user/password and the added "admin" and "root" worked as they should. But SWAT is not accepting the passwords.
I restarted both samba and inetd with "sh /ffp/start/samba.sh restart" and "sh /ffp/start/inetd.sh restart" multiple times and I tried rebooting the CH3MNAS too but nothing changed.
Could anyone help me with this?
I'd like to be able to use SWAT to reconfigure the smb.conf from any pc in the LAN from browser without having to access thru telnet and modify smb.conf by hand to add options,shares and so on (which is quicker despite many don't like SWAT)

Thank You.

Last edited by aredo3606gif (2011-03-13 17:24:04)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB