[offtopic] Incomplete data received withscripted netcat that emulates a JetDirect printjob receiver

Kurt Pfeifle kurt.pfeifle at infotec.com
Sun Jun 8 08:53:27 PDT 2008


> On Sat, Jun 07, 2008 at 08:41:24PM -0700, Kurt Pfeifle wrote:
> >
> > If I remove the "&" from the listener-watchdog call in the "rc-listener" startup script, that script does not return the shell console to me. However, if I use "^Z;bg" to put it into the background, it works perfectly, and all data arrive without fail.
> >
> > I'm at my wits' end. It seems to be connected to the mentioned backgrounding of the "listener-watchdog" call inside the "rclistener" script.
> >
> > Why...
> >    ...does putting that one line directly into the background inside
> >       the script *not* work,
> >    ...while calling it normally, but instead putting the whole script
> >       manually into the background work
>
> Instead of using a script in /etc/init.d/, couldn't you edit your
> /etc/inittab file and put this line at the bottom :
>
> --- CUT ---
> lw:2345:respawn:/usr/local/bin/listener-wrapper >/tmp/log 2>/tmp/err
> --- CUT ---
>
> Then do a :
>
>         telinit q
>
> This will replace both your rc-listener script and your watchdog,
> elimintating in the process potential sources of problems.


I've not yet tested it (on Solaris), but from reading the telinit and inittab (Linux) man pages it looks like there could be problems with the "respawn" feature:

      If init finds that it is continuously respawning an entry more
      than 10 times in 2 minutes, it will assume  that  there  is an
      error in the command string, generate an error message on the
      system console, and refuse to respawn this entry until either 5
      minutes has elapsed or it receives a signal.

Since netcat does terminate when a connection ends, and I expect the arrival of jobs being frequently in a rate of "10 times in 2 minutes", this may not be a reliable way to achieve what I want...

But thanks anyway for the suggestion. I'll test it on Solaris regardless what the Linux man page says.

Cheers,
Kurt




More information about the cups mailing list