Hi, I need to upload data from a barcode scanner into a Progress database on UNIX. The barcode reader is attached to a PC. We have set it up in this way that the barcode reader creates a file in a directory shared by the PC and an HP box. A simple daemon on the HP scans the directory and triggers a program to upload the data whenever it finds a file in that directory. 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. Koen Dejonghe QAD Service Line Origin International - Brussels tel. +32 (0)2 712 3668
On Mon, 6 Apr 1998 samba@samba.anu.edu.au wrote:> From: "Dejonghe, Koen" <Koen.Dejonghe@be.origin-it.com> > To: "'samba@samba.anu.edu.au'" <samba@samba.anu.edu.au> > Subject: Triggering processes through Samba > > 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.You could try creating a named pipe under Unix and having your barcode reader write data to it. e.g. $ mknod pipe p $ ls -l pipe prw-r--r-- 1 brett sct 0 Apr 6 14:47 pipe $ cat pipe Meanwhile over on the PC... D:\tmp>dir pipe Volume in drive D is brett Volume Serial Number is 0994-05F2 Directory of D:\tmp 06/04/98 13:47 0 pipe 1 File(s) 0 bytes 122,486,784 bytes free D:\tmp>echo hello > pipe Then back at the Unix machine: $ cat pipe hello $ Just like magic...> Koen DejongheBrett Worth
Koen,> 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 :) later, -john. --------------------------------------------------------------------- John D. Blair (sys|net)admin, the university computer center mailto:jdblair@uab.edu u. of alabama at birmingham phoneto:(205) 975-7123 (my other car is a cdr) ---------------------------------------------------------------------
on 6 Apr 1998, <Koen.Dejonghe@be.origin-it.com> wrote:> 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.Try sending a Winpopup containing the data to the HP. Use the 'message command =' parameter of smb.conf to specify the program to process it. Ludolf