The 2.04b rpm for rh60 ships with and installs a config file for logrotate (the samba.log file in the packaging/RedHat section). ====/var/log/samba/log.nmb { postrotate /usr/bin/killall -HUP nmbd endrotate } /var/log/samba/log.smb { postrotate /usr/bin/killall -HUP smbd endrotate } ==== 1) I think that the use of "endrotate" is wrong. There is no "endrotate" in logrotate's (logrotate-3.2-1) man pages; the man examples use "endscript". The use of "endrotate" has the effect that logrotate does only the rotation of the first entry of the file, log.nmb, and leaves log.smb "not-rotated". If I put "endscript" in place of "endrotate" then log.smb is rotated too. 2) It seems that once the log file is rotated smbd keeps logging to the old renamed/rotated file. Is "killall -HUP smbd" (since it is used as the postrotate script) supposed to tell smbd to reopen the log file? If not, what's the reason for the "killall -HUP smbd" in the logrotate file? The man for smbd doesn't say anything about this; it just says that the HUP signal causes smbd to re-load its smb.conf configuration file within a short period of time. Thanks. -- giulioo@tiscalinet.it
On 11 Jul 99, giulioo@tiscalinet.it (Giulio Orsero) had questions about 2.0.4b: logrotate problems with rh60: [snip]> If I put "endscript" in place of "endrotate" then log.smb is rotated too.Okay.> 2) > It seems that once the log file is rotated smbd keeps logging to the old > renamed/rotated file. Is "killall -HUP smbd" (since it is used as the > postrotate script) supposed to tell smbd to reopen the log file?[snip] I'm not sure; maybe you should try "/etc/rc.d/init.d/smb restart" instead. It's worth a try. Steve ************************************************************* Steve Arnold http://www.rain.org/~sarnold Conserving bandwidth (and belly-button lint...)
When the world was young, giulioo@tiscalinet.it (Giulio Orsero) carved some runes like this:> On Sun, 11 Jul 1999 09:47:59 +1000, hai scritto: > > >> It seems that once the log file is rotated smbd keeps logging to the > >> old renamed/rotated file. Is "killall -HUP smbd" (since it is used as > >> the postrotate script) supposed to tell smbd to reopen the log file? > >[snip] > > > >I'm not sure; maybe you should try "/etc/rc.d/init.d/smb restart" > >instead. It's worth a try. > > Yes, this certainly works, and this is what I've used so far; but I hoped > that there was a solutions similar to that of all other daemons, which can > be signalled to reopen the logs. > > Moreover the restart has some drawbacks: > 1) If logrotate runs while there are open files, does samba shutdown and > restart, may this cause locking inconsistencies or errors in file > transfers? 2) The "smb restart" (with the standard /etc/rc.d/init.d/smb) > restarts both smbd and nmbd twice (once for the rotation of log.nmb and > once for log.smb), not elegant :-)Logrotate runs as one of the cron.daily jobs (check logrotate.conf, /etc/logrotate.d, crontab). I think it runs in the wee hours of the morning (but you can change it to anything you want). I'm not sure what the deal is with samba 2.0.x; my 1.9.18 setup works fine with the HUP signal and logrotate. Maybe you should try 2.0.4b (or the latest snapshot). Isn't bleeding on the edge fun? As far as open files and samba restarts, feel free to test it (and let us know what happens). HTH, Steve ****************************************************************** Stephen L Arnold http://www.rain.org/~sarnold #include <std_disclaimer.h> ******************************************************************
When the world was young, giulioo@tiscalinet.it (Giulio Orsero) carved some runes like this:> > Logrotate runs as one of the cron.daily jobs (check logrotate.conf, > > /etc/logrotate.d, crontab). I think it runs in the wee hours of > > the morning (but you can change it to anything you want).> Since some of my customers shut down the machine during night > hours I have to run logrotate "by day". Don't want to study > anacron...Mind if I ask why? Much of the default RedHat setup (and linux/unix in general) seems to assume that the machine will run continuously. And linux generally hums right along until the power or the hardware fails.> > I'm not sure what the deal is with samba 2.0.x; my 1.9.18 setup > > works fine with the HUP signal and logrotate. Maybe you should try > > 2.0.4b (or the latest snapshot). Isn't bleeding on the edge fun?> I have 2.0.4b and pre2.0.5. > Are you sayng that you can: > 1) move the log.smb file elsewhere > 2) killall -1 smbd > and it recreates a new log.smb? > Does it recreate it at once or after smbd serves a file?What I'm saying is I have no idea what actually happens ;-) Seriously, it looks like I made the same change you made, ie, I replaced endrotate with endscript, and the logs are correctly rotated/compressed. The log.smb and log.client entries send the HUP signal to smb, while the entry for log.nmb sends the signal to nmb. They all look like this: /var/log/samba/log.smb { postrotate /usr/bin/killall -HUP smbd endscript It looks like the new log file is created by logrotate. Anymore I can do to confuse you, just let me know ;)> >As far as open files and samba restarts, feel free to test it (and > >let us know what happens). > Please... I already have the oplock_break problem... :-) it reappeared > yesterday after a "clean" week :-(Yeah, sorry about that. I won't be able to test any of this until my NICs arrive, and I punch one more hole through the wall in the master bedroom. I wonder if the next tenants will want their own network... Steve ****************************************************************** Stephen L Arnold http://www.rain.org/~sarnold #include <std_disclaimer.h> ******************************************************************
When the world was young, giulioo@tiscalinet.it carved some runes like this:> Because they are not "computer persons", they like to switch off > everything when they go home. There is no way I can convince > them.Just tell them "it's a server, not a desktop, plus it's a real OS, not windoze. It needs to get chores done overnight." Put it on an UPS and take away the monitor... Even the construction weenies I helped setup a linux/samba/ip-masq gateway for have learned to leave that box alone. [snip]> Yes logortate creates the new files, but samba keeps logging to > the old one: logrotate creates log.smb, samba logs to log.smb.1That is not the behavior I'm seeing with 1.9.18 (but it's going to be a little while before I can start testing 2.0.x at home).> For this reason I ask you if samba would create a file by its > own; if we don't consider logrotate at all, and: - mv > /var/log/samba/log.smb /var/log/samba/log.smb.old - killall -HUP > smbd.What if you try the above (mv, HUP) with this in between: touch /var/log/samba/log.smb? Does samba start logging to the new file?> Will samba a) create a new log.smb file and log to it?That's what I see with 1.9.18> b) keep logging to log.smb.old ?That's probably not the correct behavior.> On my system it's b). If it is so by design, then even if > logrotate creates the new file for samba, samba will ignore it > and keep logging to the old one (this is what I see). Yes, I see > the new file logrotate creates, but it is empty, till the next > samba restart.It could be a bug in samba, but I would think something like that would not slip through. Maybe it's a side effect of the kernel or glibc changes; are you running the RedHat binary, or did you compile from source? Could it be related to the 64-bit file locking glitch? I'm just guessing now, since I haven't yet played with this combination (kernel 2.2x, samba 2.x, glibc 2.1). In general, I would recommend compiling samba, the kernel, and any other related components yourself. HTH, Steve ****************************************************************** Stephen L Arnold http://www.rain.org/~sarnold #include <std_disclaimer.h> ******************************************************************
On Fri, 16 Jul 1999 02:55:30 +1000, hai scritto:>What if you try the above (mv, HUP) with this in between: >touch /var/log/samba/log.smb? Does samba start logging to the new >file?No.>glibc changes; are you running the RedHat binary, or did you >compile from source? Could it be related to the 64-bit fileI downloaded the src.rpm (because I need to customize the SPEC to accomodate both rh60 and caldera13 in a single rpm). So I compiled it. I verified the problem both on libc5/2.0.33 and glibc2.1/2.2.10. I just checked on a DG/UX samba.1.9.18 and it has the same problem. -- giulioo@tiscalinet.it