Has anyone had any success in getting Samba to correctly restart logging to the log files with the default logrotate setup (or even a modified one) from RedHat? The default setup is to move the files to another location, create a new file for Samba to fill, then send the daemons a HUP signal. I've tried some of the options that can be used in the logrotate.d/samba file (nocreate and copytruncate) without success... Currently, I'm allowing the default behavior without sending the HUP signal (the file move and the creation of an empty log file) then having a cron job restart the daemons by killing all the processes with a signal 9, and restarting. Just wondering if there is a more elegant solution, or if there are any unforseen problems with my "solution" Thanks! Bruce
On Tue, 12 Jan 1999 01:26:34 +1100, you wrote:>Has anyone had any success in getting Samba to correctly restart logging >to the log files with the default logrotate setup (or even a modified one) >from RedHat? The default setup is to move the files to another location, >create a new file for Samba to fill, then send the daemons a HUP signal.>From what I know about RedHat's logrotate, you can specify arbitraryshell commands to be executed after log file rotation. So, it would be no problem to have logrotate kill and restart the samba processes. Greetings Marc -- -------------------------------------- !! No courtesy copies, please !! ----- Marc Haber | " Questions are the | Mailadresse im Header Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15 Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
btenison@dibbs.net said:> Has anyone had any success in getting Samba to correctly restart > logging to the log files with the default logrotate setup (or even a > modified one) from RedHat? The default setup is to move the files to > another location, create a new file for Samba to fill, then send the > daemons a HUP signal.The Samba log files (in 1.9.18p10 at least), are really just swapped round by size - so logrotate is not really appropriate. The solution I use is just to rely on the syslogs (which you can get Samba to log to) and use that for weekly and long term records. As others have mentioned, the only way to get Samba to open the log files again is to kill all the samba daemons off and move the logs file and the restart. -- ----------------------------------------------------------------------------- | Peter Polkinghorne, Computer Centre, Brunel University, Uxbridge, UB8 3PH,| | Peter.Polkinghorne@brunel.ac.uk +44 1895 274000 x2561 UK | -----------------------------------------------------------------------------
Thanks Peter! This is the direction we finally took (we did use the postrotate scripts to stop and restart the samba servers at midnight, but recompiled with the --with-syslog option, configured the syslog.conf, and the logs are working perfectly now!) Now if we could just get the oplock problem worked out... Thanks! Bruce> > Has anyone had any success in getting Samba to correctly restart > > logging to the log files with the default logrotate setup (or even a > > modified one) from RedHat? The default setup is to move the files to > > another location, create a new file for Samba to fill, then send the > > daemons a HUP signal. > > The Samba log files (in 1.9.18p10 at least), are really just swapped round by > size - so logrotate is not really appropriate. The solution I use is just to > rely on the syslogs (which you can get Samba to log to) and use that for > weekly and long term records. > > As others have mentioned, the only way to get Samba to open the log files > again is to kill all the samba daemons off and move the logs file and the > restart. > > -- > ----------------------------------------------------------------------------- > | Peter Polkinghorne, Computer Centre, Brunel University, Uxbridge, UB8 3PH,| > | Peter.Polkinghorne@brunel.ac.uk +44 1895 274000 x2561 UK | > ----------------------------------------------------------------------------- > >