From: utzoo!decvax!ittvax!shp Newsgroups: net.unix-wizards Title: line printer problems Article-I.D.: ittvax.520 Posted: Tue Nov 16 13:48:26 1982 Received: Wed Nov 17 02:18:04 1982 The problem with the lineprinter spooler is that it never closes files. When the printer is left offline the spooler tries to open the printer every minute to check the status. Eventually 15 files are opened, the spooler aborts on the 16th try and you're left with the lock file hanging around and the spooler not running. Make the following changes to lpd.c and lpf.c and the problem should go away. It did here at ittvax. The change to lpf.c is optional as it only outputs an offline message to the console. - sam praul ...!decvax!ittvax!shp ========================================== diff /usr/new/src/cmd/lpr/lpd.c /usr/src/cmd/lpr/lpd.c 114d113 < fclose(fp); /* off-line bug fix */ 163,164c162 < if (send()) { < fclose(dfb); /* off-line bug fix */ --- > if (send()) 166d163 < } ========================================== diff /usr/new/src/cmd/lpr/lpf.c /usr/src/cmd/lpr/lpf.c 39d38 < console_msg("PRINTER ERROR: OFFLINE"); 83d81 < console_msg("PRINTER ERROR: IO ERROR"); 323,336d320 < } < < < /* this routine outputs a message to the console < */ < < console_msg(message) < char *message; < { < FILE *con; < < con = fopen("/dev/console","w"); < fprintf(con,"%s\n\r",message); < fclose(con); ==========================================