Disabling/enabling share on the fly ?

Disabling/enabling share on the fly ?

Post by Gilles Bru » Sat, 18 Jan 1997 04:00:00

Hi !
I've got a FreeBSD box with 5 scuzzy CD inside. Each one is assigned a unique
mount point (of course). I order to share these Cd's, I set up 5 shares just
as following :

   comment = CDROM #0
   path = /cdrom/0
   root preexec = sh -c "mount /cdrom/0"
   browseable = yes
   read only = yes
   writable = no
   public = yes


   comment = CDROM #4
   path = /cdrom/4
   root preexec = sh -c "mount /cdrom/4"
   browseable = yes
   read only = yes
   writable = no
   public = yes

Well : it works perfectly, *BUT* if there is no CD inside the
reader, I want to be able to disable the share "on the fly"
(for example : make it disappear from the users's share list -
via the "browseable", "allow ..." or "public" attributes).

I tought of some kind "including" method wich would allow me
-at boot time- to scan for the empty and fitted CD-ROM so as to
create on file per share wich would be included (after they've been
processed) in my SMB.CONF script.

My only problem is that it would run fine, but if -during the day-,
a CD is un-mounted, I'd like to make some king of 'share refresh'
(that mean disabling the share)...

I though of a 'crontab' entry but it does not suits me very well...
Has anyone of you clues about the way it could be done ?

Thanx  !

PS. I insist on the fact I use 'standart' CD player - not a CD jukebox
or changer...

Gilles BRUNO
Universite Joseph Fourier - CRIP
Domaine Universitaire 38041 St Martin d'Heres FRANCE
Tel 04 76 63 56 68     Fax 04 76 51 42 74


1. On-the-fly share modification

    I apologize if this has been raised before but I have just noticed
how cumbersome Samba's share configuration process is. Though GUI
interfaces exist, share addition/modification/deletion still involves
editing a single .conf file. This has the implication that the whole
configuration file has to be re-read which currently apparently requires
restarting smbd (correct me if I'm wrong on this - does it actually
update itself every minute like is the case with fstab?)
    As this requires killing all open connections it doesn't seem to be
a wise idea when it comes to servers which have to be available all the
time. Any pointers welcome.

Michel Salim

2. pppd and proxyarp

3. Automatically enabling/disabling RAS

4. OS/2 Newsreader with UUdecode

5. Howto: Re-Enable a disabled User

6. 20GB 4 mm DDS-4 internal tape

7. account is enabled but cannot logon "account is disabled"

8. Scanner info requested

9. Disable/enable Toolbars

10. Maintenance Task: Enabled or Disabled?

11. Disable Shutdown but Enable Restart and Log Off

12. Re-enabling disabled NT Services

13. Enabling and Disabling Software Distribution