Overwriting custom smb.conf

Status
Not open for further replies.

Scine

Dabbler
Joined
Nov 18, 2011
Messages
14
Hey all!

I made some changes to the way that Samba logs my users' activity, and want to use it for the default. Because it's a read only filesystem, I do the mount -uw / command, which looks like it works, then copy my file over, and then do the mount -ur / command, which also appears to work. I then verify that the file is correct, which it is.

I even copy the file over to the /conf..... folder structure and overwrite that file.

All is well across the board. HOWEVER, once I reboot, everything reverts to the way it was. Is there something I'm doing wrong? I'm running the latest FreeNAS. Thanks in advance everyone!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
That's because it's stored in the database and gets rewritten everytime you boot. Why don't you add your stuff to the Auxiliary parameters under Services->Services-> CIFS and click on the wrench icon?
 

Scine

Dabbler
Joined
Nov 18, 2011
Messages
14
That's because it's stored in the database and gets rewritten everytime you boot. Why don't you add your stuff to the Auxiliary parameters under Services->Services-> CIFS and click on the wrench icon?

I'm adding a lot of lines and I wasn't sure about the parameters being able to handle multiple lines. Could they do that??
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I'm adding a lot of lines and I wasn't sure about the parameters being able to handle multiple lines. Could they do that??

Sure, you can have multiple lines. After you add them there you should be able to look at the smb.conf file and see the changes.
 

Scine

Dabbler
Joined
Nov 18, 2011
Messages
14
Sure, you can have multiple lines. After you add them there you should be able to look at the smb.conf file and see the changes.

Coolio! I'll try that first thing in the morning. Thanks for the tip!
 

Scine

Dabbler
Joined
Nov 18, 2011
Messages
14
Sure, you can have multiple lines. After you add them there you should be able to look at the smb.conf file and see the changes.

It worked! Quick question thought. If I put in the line that I want, it works flawlessly. However, how would I change a line? For example, the default line I want to change is:

max log size = 10

I'd like to change it to:

max log size = 20000

I'd like to use FreeNAS in my company, and so far, it's worked flawlessly for us, but the powers that be want to be able to have very verbose logging in case of a user who SWEAR's they didn't delete/move/etc a file.

Thanks again so much for all your help!
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I'm not sure if you add the same line again with a different value if it will override the default, you can try it. The only other way is to edit the database if you know sql. The problem there is, if you have a large log file, it gets written to flash and will either fill up your flash drive and crash or wear it out faster. I'm not sure if there's a variable in smb.conf for setting log file location. If there was, you could change it to write to your NAS.

You're welcome!
 

Scine

Dabbler
Joined
Nov 18, 2011
Messages
14
I'm not sure if you add the same line again with a different value if it will override the default, you can try it. The only other way is to edit the database if you know sql. The problem there is, if you have a large log file, it gets written to flash and will either fill up your flash drive and crash or wear it out faster. I'm not sure if there's a variable in smb.conf for setting log file location. If there was, you could change it to write to your NAS.

You're welcome!

Yep! So it looks like it'll read the first "max log file" line, then the next one, right after and use the latest one.

So for example:

Max log file size = 10
blah
blah
blah
Max log file size = 20000

It appears that it only remembers the last line only and uses that value. And that's ok with me. It's a little "sloppy" I suppose in my book, but if it works, I won't care. :)

I'm not worried about the flash, as we installed FreeNAS on a hard drive, rather than a flash drive, just because of that wearing issue.

The powers that be here are very impressed with how fast I've gotten an answer to simple questions, and now I'm moving on to replication and more "advanced" features. :)

I've already got snapshots working, users can restore themselves via "previous versions" within Windows Explorer, and it's EXACTLY what we've been looking for in a NAS setup.

We contacted a vendor, you can imagine who, and for a 24tb array, they wanted 35k. I can build a 40tb array with a lot more features, for 10k.

And I have yet to see something that the vendor offered that you guys didn't, other than support. But I'm comfortable enough with the command line because of my years of Linux experience, that that doesn't become an issue.

Thanks again for all your help, and I'll keep you guys posted on the progress that we make!
 
Status
Not open for further replies.
Top