PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Samba: Ausdruck von Client umleiten an Skript



tazinblack
24.03.06, 12:54
Hallo zusammen,

ich würde gern mittels Ausdruck der vom Sambaclient kommt auf dem Sambaserver etwas steuern.


Da hab ich in der Sambadoku folgendes gefunden :



print command (S)

After a print job has finished spooling to a service, this command will be used via a system() call to process the spool file. Typically the command specified will submit the spool file to the host's printing subsystem, but there is no requirement that this be the case. The server will not remove the spool file, so whatever command you specify should remove the spool file when it has been processed, otherwise you will need to manually remove old spool files.

The print command is simply a text string. It will be used verbatim after macro substitutions have been made:

%s, %f - the path to the spool file name

%p - the appropriate printer name

%J - the job name as transmitted by the client.

%c - The number of printed pages of the spooled job (if known).

%z - the size of the spooled print job (in bytes)

The print command MUST contain at least one occurrence of %s or %f - the %p is optional. At the time a job is submitted, if no printer name is supplied the %p will be silently removed from the printer command.

If specified in the [global] section, the print command given will be used for any printable service that does not have its own print command specified.

If there is neither a specified print command for a printable service nor a global print command, spool files will be created but not processed and (most importantly) not removed.

Note that printing may fail on some UNIXes from the nobody account. If this happens then create an alternative guest account that can print and set the guest account in the [global] section.

You can form quite complex print commands by realizing that they are just passed to a shell. For example the following will log a print job, print the file, then remove it. Note that ';' is the usual separator for command in shell scripts.

print command = echo Printing %s >> /tmp/print.log; lpr -P %p %s; rm %s




D.h. ich sollte mit der Angabe eines Skriptes im Printcommand (s.o.) dieses ausführen können.
Leider scheint das bei mir nicht zu funktionieren ;-(

Ich hab jetzt schon mehrmals versucht, die Rechte des Skripts zu prüfen.
Aber auch einfach Sachen wie z.B. touch /tmp/datei gehen nicht.

Hat da jemand einen Tip ?

Gruß
tazinblack

emba
25.03.06, 17:21
welchen loglevel hast du?

greez

tazinblack
27.03.06, 12:08
Momentan 0, aber ich setz ihn mal hoch auf 5 ...


... so, wenn ich vom Client ne Testseite drucke, dann meldet dieser keinen Fehler :-)

also Printcommand hab ich mal testweise touch /tmp/drucken/datei eingetragen und darauf geachtet, dass der komplette Pfad dorthin volle Berechtigung hat (777).
Leider legt er mir dort keine Datei an :-(

In allen Logs (log.smbd, log.nmbd, log.<Client>) sehe ich nix was, wie ein Fehler aussieht

Hat da jemand nen Tip ?


Gruß
tazinblack

tazinblack
27.03.06, 15:32
Ich habs gefunden,

wenn ich für diesen Drucker auf lprng umschalte, dann gehts.
Komischerweise mit cups nicht !


Gruß
tazinblack