Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] Please Help!!! smbcontrol close-share

663 views
Skip to first unread message

Carlos R.P.Evertsz

unread,
Sep 8, 2015, 11:50:03 AM9/8/15
to
Hello to everybody in the list.

I want to close a samba share using a command that can be executed when
i need it or scheduled with at/cron.
I found that 'smbcontrol close-share' command supposed to do that, but
when i try to run command it doesn't work.

sudo smbcontrol smbd close-share My_Share

It returns the following:

Ignoring unknown parameter "use client drivers"
WARNING: [printers] service MUST be printable!
Ignoring unknown parameter "use client drivers"

I don't know how to make this command to work.

My server is Ubuntu 12.04LTS running Samba Version 3.6.3

Please, i really appreciate any help how to run this command.

Sincerely,

Carlos




--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

Marc Muehlfeld

unread,
Sep 8, 2015, 12:20:03 PM9/8/15
to
Hello Carlos,

Am 08.09.2015 um 17:42 schrieb Carlos R.P.Evertsz:
> I found that 'smbcontrol close-share' command supposed to do that, but
> when i try to run command it doesn't work.
>
> sudo smbcontrol smbd close-share My_Share

Have you read the manpage of smbcontrol? "close-share" just closes all
connections to a share, without affecting other client connections. It
doesn't remove a share.



> It returns the following:
>
> Ignoring unknown parameter "use client drivers"
> WARNING: [printers] service MUST be printable!
> Ignoring unknown parameter "use client drivers"

This doesn't mean that this command failed. It just tells you, what's
wrong with your smb.conf. See "testparm".




> I want to close a samba share using a command that can be executed
> when i need it or scheduled with at/cron.

https://lists.samba.org/archive/samba/2011-September/164268.html


Regards,
Marc

Carlos R.P.Evertsz

unread,
Sep 8, 2015, 3:00:03 PM9/8/15
to
Hi Marc,

Thank you for your email.

I think something is wrong with the command or syntax. For example, I
open the share folder in a Win workstation(\\server\My_Share) and then
run the program to close
that share in the server console. The workstation continues to have
normal access to that share. Nothing change.

I think If the command were running correctly the workstation would
not be able to access the share.

Is there other way to do this? I can try.

Carlos

Marc Muehlfeld

unread,
Sep 8, 2015, 3:10:04 PM9/8/15
to
Am 08.09.2015 um 20:53 schrieb Carlos R.P.Evertsz:
> I think something is wrong with the command or syntax. For example, I
> open the share folder in a Win workstation(\\server\My_Share) and then
> run the program to close
> that share in the server console. The workstation continues to have
> normal access to that share. Nothing change.
>
> I think If the command were running correctly the workstation would not
> be able to access the share.

No. Have a look at the smbcontrol manpage.

This command does only close the connection of all clients to the given
share. It doesn't remove the share or take it offline.

You run this command only to close all client connections to a share,
without disturbing other connections. If you would kill the PIDs of
connected processes, you would quit connections to other shares, too,
and clients need to reconnect.

After closing the connections, you can make the share unavailable. See
the link I posted:
https://lists.samba.org/archive/samba/2011-September/164268.html
Run "smbcontrol all reload-config" afterwards, to reload the changes.
Then you share is offline, until you enable it again.

Carlos R.P.Evertsz

unread,
Sep 8, 2015, 4:10:04 PM9/8/15
to
Thank you Marc

Now i understand. I have to make a script file to modify current
smb.conf, change the parameters "available=no" "browseable=no" and then
reload the configuration file.

One final question; It is possible to load a configuration file with
non-standard name? For example to load TempSMB.conf instead of smb.conf?

Thank you for your help.

Carlos

Marc Muehlfeld

unread,
Sep 8, 2015, 4:30:04 PM9/8/15
to
Am 08.09.2015 um 21:59 schrieb Carlos R.P.Evertsz:
> One final question; It is possible to load a configuration file with
> non-standard name? For example to load TempSMB.conf instead of smb.conf?

It depents what you're meaning. You can start e. g. "smbd" with -c to
give an alternative configuration file. -> man smbd
But for switching to this other file, you have to kill all smbd
processes and restart smbd.

Or you can include a file in your smb.conf, that contains additional
stuff like e. g. just this share.

See smb.conf manpage: include

Rowland Penny

unread,
Sep 8, 2015, 4:30:05 PM9/8/15
to
On 08/09/15 20:59, Carlos R.P.Evertsz wrote:
> Thank you Marc
>
> Now i understand. I have to make a script file to modify current
> smb.conf, change the parameters "available=no" "browseable=no" and
> then reload the configuration file.
>
> One final question; It is possible to load a configuration file with
> non-standard name? For example to load TempSMB.conf instead of smb.conf?

Yes, start smbd with '--configfile=CONFIGFILE', see 'man smbd' for more info

Rowland

>
> Thank you for your help.
>
> Carlos
>
>
>


Carlos R.P.Evertsz

unread,
Sep 8, 2015, 4:40:04 PM9/8/15
to
Thank you Marc,

I created a script to write the parameters in a file to be included in
my smb.conf with include = /../whatever.conf.

I think that is the easiest and cleanest way to do it.

Thanks a lot for your help.

Carlos

Carlos R.P.Evertsz

unread,
Sep 8, 2015, 4:50:03 PM9/8/15
to
Thank you Rowland
0 new messages