sending print job info to Windows host

Simo Sorce simo.sorce at polimi.it
Thu Nov 9 10:02:01 GMT 2000


Christoph Steglich wrote:
> 
> Hello,
> 
> I also sent the message below to the samba-general mailing list, but I'm
> not sure whether this topic fits better here or there ...
> 
> I need help on the following problem: I want to send "extended" print
> job status information to a windows host via samba (2.0.7), e.g. if a
> job gets canceled.
> --> background: I've developed an accounting system (based on LPRng)
> that checks whether a valid printing account exists etc.
> --> aim: I want to send a message to the owner of the print job that
> appears in the windows printer status window or in an extra pop up. I
> would prefer a solution that e.g. extends the 'lpq command'.
> 
> thanks for your help
> 
> christoph

I've made a control system for prints with samba 2.0.7 that check
against users to see if they are allowed to print and if they are under
their day/year quota.
The set of scripts (bash) report also backed to the user if the printing
has been allowed and also their actual quota.
All works fine using postscript drivers (from Adobe) and standard lpq
daemon.

They key in sending back information to hosts is:

the samba print command is set as follow:
print command = /usr/local/samba/lpquota/lpruserwrap %p %U %s %m
lpruserwrap is a setuid C program that's used to call a bash script
(rember that print commands are executed as user) and the printer name,
username, printjob filename and machine name are passed to that script.

It take care of converting files (strip "\r" to use redhat ps filters)
and check quotas.
and then send back messages using smbclient:
cat message.txt| smbclient -M $machinename  ($machinename is taken from
%m)

bye,
Simo.

-- 
Simo Sorce - Integrazione Sistemi Unix/Windows - Politecnico di Milano
E-mail: simo.sorce at polimi.it
Tel.int: 02 2399 2425 - Fax.int. 02 2399 2451
-----------------------------------------------------------------
Be happy, use Linux!




More information about the samba-technical mailing list