[Gllug] Deleting samba shares.

Bruce Richardson itsbruce at workshy.org
Sun Apr 18 00:29:11 UTC 2010


On Sat, Apr 17, 2010 at 10:52:27PM +0100, general_email wrote:
> Hi all,
> 
> Is there any practical difference between running...
> 
> net usershare delete sharename
> 
> ...and just deleting the shares corresponding file from
> /var/lib/samba/usershares

smbd won't notice immediately if you simply delete the file (iirc, it
takes up for a minute for samba to notice config file changes).  Using
the net command will immediately notify the daemon (although that won't
affect existing connections).

It would always be safer to use the command, even though it is, at the
moment, enough to delete the file.  If you rely on manual manipulation
of the files and they ever add extra mechanisms (lock files or other
state information), you could end up unwittingly making a mess.  And
using the command means not having to worry about the backend details of
where samba is stashing state information (Although I encourage you to
be curious about such details and to poke around, but I'd also advise
using the tools provided.  It's like directly editing the passwd and
group files - good to know how to do it, best not to do it as regular
practice.)


-- 
Bruce

If the universe were simple enough to be understood, we would be too
simple to understand it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20100418/b25622dc/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list