Triggering processes through Samba

John Blair jdblair at
Mon Apr 6 04:25:34 GMT 1998


> I was wondering if there isn't a more direct way of triggering a 
> process through Samba, so that I can get rid of the daemon.
> Thanks for your help.

There are two possibilities.  First, the 'postexec' and 'root postexec'
parameters let you specify a command to run when a client disconnects from
a resource.  This might solve your problem.  Remember that most clients do
not just disconnect when you are done-- you will have to do this
explicitly, or set 'dead time' to be just a minute.  This would cause
Samba to automatically disconnect clients after just a minute of
inactivity, trigerring the 'postexec' and 'root postexec' commands.

Another possibility is 'magic script'.  The 'magic script' command lets
you specify a file that, when closed, will be executed.  It gives you a
(rather hacky) way to send a shell script to the server.  You could create
a script to copy a shell script which would then trigger the gather of
your barcode data.

A third (I just thought of this one), rather extreme possibility would be
to modify the 'magic script' command to allow you to specify an arbitrary
command that will be executed when an arbitrary filename is closed.  This
might not be too difficult, but would involve dipping into the innards of
Samba :) 


John D. Blair          (sys|net)admin, the university computer center
mailto:jdblair at                    u. of alabama at birmingham
phoneto:(205) 975-7123                        (my other car is a cdr)

More information about the samba mailing list