[Samba] Running a sleepy server (was: smbd on a battery-powered device)
abartlet at samba.org
Thu Dec 16 14:53:04 MST 2010
On Thu, 2010-12-16 at 13:36 -0800, Liam wrote:
> On Wed, Dec 15, 2010 at 1:31 AM, Andrew Bartlett <abartlet at samba.org> wrote:
> > On Mon, 2010-12-13 at 12:37 -0800, Liam wrote:
> > > I'm setting up samba service on a battery-powered WiFi device. The
> > > plan is to have it wake-on-lan, handle request, sleep. Anyone have
> > > experience with this?
> > >
> > > Are there smb protocol aspects that preclude server sleep between
> > > client-initiated exchanges?
> > >
> > > My server won't be awake to respond to netbios broadcasts, e.g. for
> > > name resolution. Can I shut off that service, and have clients access
> > > \\192.168.0.10\share? Can I shut off everything but the smb session
> > > service?
> > >
> > > Alternatively I could start/stop the server on demand, since I know
> > > when a client wants a file via smb. Is samba startup efficient, or
> > > cpu/disk-intensive?
> > The inetd mode would seem to be the best way to handle this. Then your
> > inetd or replacement can handle starting smbd. Just watch out that
> > clients may keep a connection open for quite some time while not
> > actually using it.
> Thanks for the input, Andrew.
> Can I disable nmbd if clients use \\192.168.0.1\share style addresses?
Yes, or they use DNS names.
> And when an smb connection is active but the client is idle, does the client
> expect anything from the server? If not, the next client msg will trigger
> wake-on-lan and the connection will be fine...
If the client is truly idle, then it's down to what the TCP layer may or
may not do (keep-alive etc). Also (but others who deal with the Samba3
code would be more qualified to comment) I think Samba when running will
do a number of periodic tasks, which is just as likely to keep your box
awake as the client itself.
More information about the samba