theweaselking: (Work now)
[personal profile] theweaselking
So for reasons that truly escape me[1], network file shares for Windows users are shared via a CentOS machine running Samba instead of directly off the NetApp via CIFS.

Anyway. It's working, except there's a thing: By default (and currently), samba logs are separated by machine - they log to /var/log/samba/%m.log which means there's one log for each laptop or desktop.

It would be handier to have the logs separated by user, or by service. The docs all say to just change that %m to %u for User or %S for Service... but if I do that, I get files LITERALLY CALLED /var/log/samba/%u.log or %S.log. It doesn't expand the user or service and give me per-user or per-service logs the way the docs and mailing list RTFMers say it will, it throws them all in a single file with a literal percent sign in it.

Anyone run into this and remember the magic spell to fix it?
CentOS 5.11, Samba 3.0.33.


[1]: "Legacy, changing would require resources, changing would require users to do something different" oh wait I guess the reasons don't escape me but OH FUCK OFF.

(no subject)

Date: 2016-04-13 09:09 pm (UTC)
From: [identity profile] skington.livejournal.com
Is there some sort of directive you've missed that says "make multiple log files", which is the thing that enables %u or %S?

Are you using the wrong type of quote marks or something?

(no subject)

Date: 2016-04-13 10:07 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
Nope. And it's currently making multiple log files with %m - separated by machine.

Wrong quote marks: if I take the current log definition line - "/var/log/samba/%m.log" and change THAT LETTER in the config file to "/var/log/samba/%u.log", then reload, I get a single log file named "%u". If I change that single letter back to %m, I get many log files separated by machine again.

(no subject)

Date: 2016-04-13 10:38 pm (UTC)
From: [identity profile] jsbowden.livejournal.com
Find who ever decided to reshare the NFS mounts from the NetApp via Samba instead of directly sharing them from the NetApp, punch them in their stupid fucking face, and use the NetApp to make your life and the user experience a thousand times better.

(no subject)

Date: 2016-04-14 01:09 am (UTC)
From: [identity profile] theweaselking.livejournal.com
I know exactly who did it. This is nowhere close to the most mortal of his sins.

Dude was an artist, a genuine genius at making kludges with zero budget. I admire what he did! He was fired three years before I was contracted and there's still stuff left over because a whole lot of what he did is super-fragile, breaks at the slightest change, and *works* - it's in production, causing zero problems as long as nobody BREATHES on it, today. And there's an entrenched culture of "this works, it has always worked, we do not want to CONSIDER anything better because better is change and CHANGE IS EVIL."

Engineers, I tell you.

(no subject)

Date: 2016-04-14 01:17 am (UTC)
From: [identity profile] theweaselking.livejournal.com
To be fair, the NetApp didn't exist when he worked there. He created a samba server to share NFS mounts off a TON of physical machines, wherever spare disk space existed, so that networked disk space would all be in one spot. The FAS was installed after he left, and took all those shares off physical servers and put them on the FAS.... but users wanted all their files to still be in the same place, so the same NAMES were kept and the samba server started sharing NFS from the netapp instead of NFS from the converted desktop "servers".

And when the samba server was virtualised, priority was given to "making everything work without changing anything", not "doing it right".

(no subject)

Date: 2016-04-14 10:32 am (UTC)
From: [identity profile] skiriki.livejournal.com
I have good news: You're not going cray-cray. I just tested that on my own Samba server, and I'm getting the same thing. I'm running 3.6.23 on CentOS release 6.7.

HOWEVER, when I put in %U (instead of %u), stop smb & nmb, clean old logs away, and start smb & nmb, I'm getting log.skiriki

So, uh. Give that a go?

(no subject)

Date: 2016-04-14 02:51 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
"An undocumented change, directly contradicting the manual and the config file"

Lovely.

(no subject)

Date: 2016-04-14 02:53 pm (UTC)
From: [identity profile] skiriki.livejournal.com
I know, I was mightily baffled by this as well, now that it came to my attention.

Did you get it working? As in, "did you kludge the existing kludge in a manner that made it work, with some complaints and scathing comments written in conf file"?

(no subject)

Date: 2016-04-14 02:57 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
I haven't tried it yet - I'm not in that office again until tomorrow.

I'll also test %s instead of %S.

(no subject)

Date: 2016-04-15 01:13 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
And: yes, by completely ignoring the official documentation, ignoring the man page, and ignoring all the instructions, and by using the thing it specifically says SHOULD NOT WORK, it works.

(no subject)

Date: 2016-04-15 01:38 pm (UTC)
From: [identity profile] skiriki.livejournal.com
Insert a scathing comment to .conf file, otherwise the next unfortunate soul -- which could be you, I've done this myself, "why is that thing configured like that", changed it to According to the Holy Writ and everything stops working and then go "oh duh, that's why" -- might change it back to %u... :D

(no subject)

Date: 2016-04-15 02:33 am (UTC)
secretagentmoof: (Default)
From: [personal profile] secretagentmoof
There are, unfortunately, still a bunch of reasons why one might wish to export via samba instead of directly off a NetApp; the two main ones I can think of are "You don't have and/or don't want to use AD" (Fun fact: use can use local accounts on NetApps for CIFS... as long as you do not exceed 75 local accounts) and "You want to control exactly which version of SMB will be used."

(no subject)

Date: 2016-04-15 03:56 am (UTC)
From: [identity profile] theweaselking.livejournal.com
We have Active Directory.

(Which, admittedly, ALSO didn't exist when the dude who set this up set this up.)

Profile

theweaselking: (Default)theweaselking
Page generated Jun. 14th, 2025 05:00 pm