[Xprint] dealing with open background processes from
/etc/init.d/xprint
Drew Parsons
dparsons at debian.org
Fri Jun 24 15:34:59 EDT 2005
Hi,
I'd like to review the way Xprt is launched, comparing Debian GNU/Linux
to other Linuces as well as other Unices.
On Debian we notice there are a handful of rogue processes appearing
when /etc/init.d/xprint is used to start Xprt.
"ps aux | grep -i [x]pr" reports something like
root 13988 0.0 0.3 4852 1592 pts/4 S 14:15
0:00 /bin/bash /etc/init.d/xprint start
root 13989 0.0 0.3 4852 1592 pts/4 S 14:15
0:00 /bin/bash /etc/init.d/xprint start
root 13990 1.3 0.9 13332 4740 pts/4 S 14:15
0:00 /usr/X11R6/bin/Xprt -ac -pn -nolisten tcp -audit 4
-fp /usr/lib/X11/fonts/Type1,/usr/local/share/fonts/Mathematica/Type1,/usr/local/Wolfram/MathReader/5.0/SystemFiles/Fonts/Type1,/usr/X11R6/lib/X11/fonts/Type1,/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType,/usr/lib/X11/fonts/100dpi,/usr/lib/X11/fonts/100dpi/,/usr/lib/X11/fonts/75dpi,/usr/lib/X11/fonts/75dpi/,/usr/lib/X11/fonts/cyrillic,/usr/lib/X11/fonts/misc,/usr/local/share/fonts/Mathematica/BDF,/usr/local/share/fonts/Mathematica/PCF,/usr/local/Wolfram/MathReader/5.0/SystemFiles/Fonts/BDF,/usr/X11R6/lib/X11/fonts/100dpi,/usr/X11R6/lib/X11/fonts/75dpi,/usr/X11R6/lib/X11/fonts/cyrillic,/usr/X11R6/lib/X11/fonts/misc :64
root 13992 0.0 0.3 4852 1596 pts/4 S 14:15
0:00 /bin/bash /etc/init.d/xprint start
That is, there are three open processes referring to /etc/init.d/xprint,
along side the Xprt process itself. We would expect only the Xprt
process to be there, I think. The invoking init script should have
finished its job and exited, leaving Xprt running in the background.
Would it be possible to ask those of you who do not use Debian to
confirm or deny that your system has the same problem with the "rogue"
processes? If you don't have them, are you starting Xprt
using /etc/init.d/xprint, or some other way?
As far as I can tell the processes are remaining due to complicated
inner shell processes used to launch Xprt. In the start_servers()
function of /etc/init.d/xprint, around ll.618-645 we have something like
(shortening down)
(
(
# launch Xprt
${Xprt_binary} &
# set up /var/run/Xprint_servers
...
wait
# Xprt failed, so remove reference in /var/run/Xprint_servers
...
) 2>&1 | while read i ; do echo "$i" | tee -a
"${xpstart_logfile[$curr]}" | ${xpstart_logger[$curr]} ; done
) <&- >&- 2>&- &
One of the rogue processes is due to the wait command, which (if I
understood it correctly) waits to see if Xprt failed to start up
properly. I haven't been able to evaluate exactly what is holding up
the other two processes, however.
I have a fix, which uses the utility start-stop-daemon to start Xprt,
rather than launching it directly with "${Xprt_binary} &". Debian
generally expects us to use this utility in the init scripts, it's
designed for just this kind of problem. However start-stop-daemon is
(as far as I know) Debian-only, it comes with dpkg, the Debian packaging
manager.
So I'd be interested to hear if other systems have the same problem, if
not then why not. I'd like to evaluate whether to go ahead with my fix
for Debian alone, or whether we should build a common solution. A
corollary might be to ask if start-stop-daemon is generally useful to
other systems :)
Thanks,
Drew
More information about the Xprint
mailing list