|
Post by mmattel on Jun 6, 2008 2:15:45 GMT 7
Hello all,
Just started with a brand new 5200BR Pro with 5 disks. FW 2.00.08
The 5200 is in the ADS and works fine.
I want to edit the smb.conf to manually tune parameters. To do so I installed SYSUSER and SSHD. To change the file I use WinSCP. According to the Thecus Wiki I changed it at: /tmpfs/tmp/smb.conf But after a reboot, everything was changed back. I tried it at following locations but always with the same result when rebooting: (links cleared)
/tmp/smb.conf /raid0/sys/smb.conf
When I write the changed file down and reopen it, everything is ok.
questions: - why are there two locations for the file (which are by the way the same but not linked) - where do I need to change the file to make it persistant - do I have another mistake or is there something overseen
Best regards Martin
|
|
|
Post by peterfu on Jun 6, 2008 4:32:46 GMT 7
The configuration file which is used from samba is the one at /raid0/sys - have no idea for waht the /tmp/smb.conf is. The reason why it is overwritten during reboot is because the N5200 rebuilds the samb.conf on every reboot new, so every change You do is lost on reboot - this You can check if You call after a change of the smb.conf the samba startup script (img/bin/rc/rc.samba) and give as parameter restart - then all changes are away. One way to make the changes persistant is to install the META module and use a script then during restart or boot, which does the required changes for YOu in the smb.conf and restarts the samba server, but without usage of the rc.samba tartup script. br Peter
|
|
|
Post by mmattel on Jun 13, 2008 21:44:01 GMT 7
thanks peter, what do you mean with "rebuild" the smb.conf. I guess thinking about how the storage could work is, that all configurations are stored in the floppy-flash and are written back to disk ony every boot. yes I could use the meta module and parse the smb.conf with perl and modify parameters... it would be a great idea of thecus to split the samba web config into share access and general parameters. and it would also be a great thing adding sub folder shares... could also be done with meta, but a web gui... martin
|
|
|
Post by drewy on Jun 13, 2008 23:21:07 GMT 7
you don't "have to" use perl, a little liberal use of sed/awk should allow you to modify/add parameters from a shell script reasonably simply.
|
|
|
Post by mmattel on Jun 14, 2008 2:40:05 GMT 7
If someone has made a startup script to modify smb.conf before and could post it, we (sorry I) would not be in need to reinvent the wheel...
so please do not hesitate
mm
|
|
|
Post by drewy on Jun 15, 2008 3:45:56 GMT 7
look at :
#!/bin/sh # pdrew 2-feb-08 #change samba parameters if an effort to get disk spindown working on thecus 5200pro #set up smb.conf how we want it! while ! ps | grep -v grep | grep smbd > /dev/null do sleep 5 done sed -e 's/local master = yes/local master = no/g' /tmp/smb.conf > /raid/smb.conf.tmp sed -e 's/lock directory = \/raid\/data\/tmp\/var/local master = \/tmpfs\/var/g' /raid/smb.conf.tmp > /tmp/smb.conf #restart samba without rebuilding smb.conf # stop samba kill -15 `ps | grep smbd | awk '{print $1}'` kill -15 `ps | grep nmbd | awk '{print $1}'` kill -15 `ps | grep winbindbd | awk '{print $1}'` sleep 2 # start samba /opt/samba/sbin/smbd /opt/samba/sbin/nmbd /opt/samba/sbin/winbindd
as an example. This script was to get spindown working on an earlier firmware release, it did this by changing 2 of the configuration settings in smb.conf The script is run by the META module (look at the doc for that to see where to place your script to get it to run on startup). The above script then waits for samba (smbd) to be running i.e. the auto rebuild to smb.conf to be finished. It then use a couple of sed/awk lines e.g.
sed -e 's/local master = yes/local master = no/g' /tmp/smb.conf > /raid/smb.conf.tmp
to change the settings in smb.conf and then kills the samba processes and restarts them, so that they pick up the altered smb.conf file.
Note that while the 5200 is up and running if you make any changes to the shared folders, acl's or add/remove users etc. this causes a smb.conf rebuild to take place...so this would remove the changes you have made with the above script. In this advent you'd need to manually re-run your script or simply re-boot the 5200.
Good luck.
|
|
|
Post by omega on Jun 16, 2008 20:57:38 GMT 7
This script should do the same drewys script but is a little bit easier to read....
#!/bin/sh
smbconf=/etc/samba/smb.conf
while ! ps | grep -v grep | grep smbd &>/dev/null ; do sleep 1 done
sed -i \ -e 's|^\( *local *master *=\).*$|\1 no|g' \ -e 's|^\( *lock *directory *=\).*$|\1 /tmpfs/var|g' \ $smbconf
/img/bin/rc/rc.samba restart 1
exit 0
|
|