From: <pa...@rc...> - 2000-12-24 03:35:19
|
Timothy Lee wrote: > There's one problem I've found with ptal-printd using the initscript. > There is another problem related to the loadable modules. The situation > goes likes this: > ptal-printd will start with the printer off, but if I try to > print, it quits. After reading through the source code, it appears > that any manner of error will cause ptal-printd to exit. > In my opinion, error conditions should be logged, but the daemon should > just continue to run. Otherwise the machine will be left in a broken > state, thinking the ptal-printd subsystem is running, when in fact the > daemon is long gone. My fault -- sorry about that. I'll clean up my sloppiness later. :-) Part of the problem was that it wasn't immediately obvious what the most appropriate recovery was for each of the possible errors. I suppose it's OK to exit if an error occurs during startup, for example, failure to create the pipe. But there are several causes of error at runtime: - Failure to open the pipe (possibly because somebody deleted it). - select() fails on the open pipe (I don't know why). - Failure to open a connection to the peripheral (such as you described above). - Failure to write data to the peripheral. In all four cases there is data that needs to be sent to the peripheral, so if I fix ptal-printd so it doesn't abort, what do you think I should do with the data? I could just discard the data (after logging a message, of course), or in the case where I can't open the peripheral, I could periodically retry. Speaking of logging, I probably should use syslog, not just printf. > My question: is the device list fixed for ieee12844.o during > loading, or is it updated dynamically? If not, there'll definitely > be a problem with OfficeJets that were not turned on during boot up (must > remove modules by hand, or wait for cron to clean up autoload modules). The device list for ieee12844pp (not ieee12844) comes from whatever was connected and powered on when parport_probe was loaded. So if you forgot to turn on your peripheral before booting, then you need to unload both ieee12844pp.o and parport_probe, then reload parport_probe and ieee12844p.o. David |