[Samba] Best practices for long-running Samba server

David Schlenk david-schlenk at bethel.edu
Thu Jan 27 22:41:39 GMT 2005


On Jan 25, 2005, at 7:37 AM, Misty Stanley-Jones wrote:
> Because our systems typically have uptimes measured
> in months rather than days, and it is difficult for me to restart Samba
> except as a scheduled task (which I'm afraid to do because there are 
> users
> who come in earlier than I do in the AM and users that work later than 
> me in
> the PM, and I don't want them having to call me at home :D ),

I restart my samba/cups services at 4:00AM every morning, using the 
following really, really aggressive script.

#!/usr/bin/perl
system("/sbin/service smb stop");
sleep(3);
system("killall -9 smbd");
sleep(3);
system("killall -9 nmbd");
sleep(3);
system("/sbin/service cups stop");
sleep(3);
system("killall -9 cupsd");
sleep(3);
system("/sbin/service cups start");
sleep(15);
system("/sbin/service smb start");

Never had a problem with things not restarting OK, and I've had this 
scheduled nightly for months.  In my experience, samba and cups will 
crash at some point, so I'd rather do this in attempts to avoid middle 
of the day type outages, but not everyone has the luxury of little to 
no users active at 4:00AM, so YMMV.
--
David Schlenk
Operating Systems Analyst
Bethel University
Saint Paul, Minnesota
david-schlenk at bethel.edu



More information about the samba mailing list