[ltsp] printer prints only once
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ltsp (Ubuntu) |
Fix Released
|
Undecided
|
Scott Balneaves |
Bug Description
Binary package hint: ltsp-client
gutsy & feisty
I have a thin client which has a printer attached. So I put in lts.conf
[00:40:63:xx:xx:xx]
PRINTER_
and it works. Only after one page the printerdaemon stops. Starting /usr/sbin/jetpipe by hand gives(start & end loop put in pythonscript by me):
root@terminalse
start loop
end loop ====>>> FIRST PAGE
start loop
Traceback (most recent call last):
File "/usr/sbin/
listen()
File "/usr/sbin/
s.bind(('', int(sys.argv[2])))
File "<string>", line 1, in bind
socket.error: (98, 'Address already in use')
putting a while loop in /opt/ltsp/
#
# we 'exec' the print server, so that the print server will
# replace the shell.
#
if [ -n "${PRT_OPTS}" ]; then
logger -t lp_server "Started with: -n ${PORT} ${WO_OPT} -d ${DEVICE} -t \"${PRT_OPTS}\""
else
logger -t lp_server "Started with: -n ${PORT} ${WO_OPT} -d ${DEVICE}"
fi
while [ TRUE ]; do
done
There was recently a fix I committed to jetpipe. Not sure if it's made it yet.
Here's the new jetpipe, replace your current one with this one, and back out your shell script loop part, see if this works.
import socket
import sys
# Print usage information
if len(sys.argv)!=3:
print 'Usage: jetpipe <printerdevice> <port>'
sys.exit(0)
# Wait for a job on <port> to forward to <printerdevice>
p.write( data)
def listen(s):
conn, addr = s.accept()
while 1:
data = conn.recv(1024)
if not data: break
p = open(sys.argv[1], 'wb')
p.flush()
p.close()
conn.close()
# Rewspawn eternally socket( socket. AF_INET, socket.SOCK_STREAM) bind((' ', int(sys.argv[2]))) listen( 1)
if __name__ == "__main__":
jetpipe = socket.
jetpipe.
jetpipe.
while 1:
listen( jetpipe)