Dachshund Digital
2022-Dec-26 04:24 UTC
[Samba] What is the correct process or procedure to add functionality to Samba?
What is the correct process or procedure to add functionality to Samba? I have an idea to add backing store validation behind Samba shares. For example, add logic to Samba, such that if the backing store, i.e. device or mount point is missing, Samba does not publish the applicable share point. If the above is done, a potential benefit would be, Samba could dynamically publish share points as devices or mount points become again visible. This would, if implemented, eliminate the need for explicitly stop/start/restart smbd, as resources are restored to service, or even new resources published. In the smb.conf, a new flag/parameter, per share, with a reference to a script for what actions to take when backing store disappears, reappears or added. For example... A possible idea... [Some Share] # enable actions, if yes Watch = yes|no Add = yes|no Remove = yes|no Recover = yes|no # script samba can invoke when a backing store, i.e. device, mount point # no longer exists or present WatchAction = <name of script to execute> # mount point referenced in smb.conf now exists AddAction = <name of script to execute> # mount point on longer exists RemoveAction = <name of script to execute> # mount point now exists again RecoverAction = <name of script to execute> Is there any interest from the Samba development team to consider such as outlined above? I am not as yet familiar with the patch submission process, but do I understand correctly, that is one possible path to implementing this idea? -DD
Jeremy Allison
2022-Dec-26 05:32 UTC
[Samba] What is the correct process or procedure to add functionality to Samba?
On Sun, Dec 25, 2022 at 08:24:05PM -0800, Dachshund Digital via samba wrote:>What is the correct process or procedure to add functionality to Samba? > >I have an idea to add backing store validation behind Samba shares. >For example, add logic to Samba, such that if the backing store, i.e. >device or mount point is missing, Samba does not publish the >applicable share point. > >If the above is done, a potential benefit would be, Samba could >dynamically publish share points as devices or mount points become >again visible. This would, if implemented, eliminate the need for >explicitly stop/start/restart smbd, as resources are restored to >service, or even new resources published. > >In the smb.conf, a new flag/parameter, per share, with a reference to >a script for what actions to take when backing store disappears, >reappears or added. > >For example... A possible idea... > >[Some Share] ># enable actions, if yes >Watch = yes|no >Add = yes|no >Remove = yes|no >Recover = yes|no > ># script samba can invoke when a backing store, i.e. device, mount >point # no longer exists or present >WatchAction = <name of script to execute> > ># mount point referenced in smb.conf now exists >AddAction = <name of script to execute> > ># mount point on longer exists >RemoveAction = <name of script to execute> > ># mount point now exists again >RecoverAction = <name of script to execute> > >Is there any interest from the Samba development team to consider such >as outlined above? > >I am not as yet familiar with the patch submission process, but do I >understand correctly, that is one possible path to implementing this >idea?It's an interesting idea, but I'm not sure a new parameter or script is the right way to achieve this. Move over to samba-technical at lists.samba.org to discuss as this subject is more appropriate there.