Path: utzoo!mnetor!uunet!mcvax!cogpsi!tom From: tom@cogpsi.UUCP (Tom Vijlbrief) Newsgroups: comp.unix.questions Subject: Re: Redirecting printer messages with lpd Message-ID: <335@cogpsi.UUCP> Date: 14 Jan 88 16:42:42 GMT References: <11247@brl-adm.ARPA> Reply-To: tom@rainbow.UUCP (Tom Vijlbrief) Organization: TNO Institute for Perception, Soesterberg, The Netherlands Lines: 35 In article <11247@brl-adm.ARPA> JON%UCLASTRO.BITNET@CUNYVM.CUNY.EDU writes: > > We have a apple Laserwriter as the default printer on our local >Sun network. Error messages that get returned from the printer are >placed in the error log file specified by lf= in /etc/printcap. However, >I would rather these messages either be sent directly to the user's >terminal, or if not logged on, mailed to the user who initiated the >job. My conception of how this would work would be to tell the lpd >deamon to send the messages to a filter instead of the file. However, >from the man pages for lpd, there does not seem to be a way of doing >this. Am I mistaken (as usual)? If not mistaken, how would I go >about doing this? Presumably, lpd would need to be modified. How Because you are running SunOs you have named pipes. You could create a named pipe and specify this pipe in the lf entry. A deamon program could read from the pipe and process the error messages. The main problem is determining the name of the user who prints. A possible solution would be to use a special filter as the printing filter which saves the name of the user in a file. (Probably this file will always contain the owner of the lpd deamon in which case you have to replace the lpr program by a simple shell script) Succes.... Tom =============================================================================== Tom Vijlbrief TNO Institute for Perception P.O. Box 23 Phone: +31 34 63 14 44 3769 DE Soesterberg E-mail: cogpsi!tom@mcvax.cwi.nl The Netherlands or: uunet!mcvax!cogpsi!tom ===============================================================================