Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 125807 - hplip must be started twice
Summary: hplip must be started twice
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: AMD64 Linux
: Low minor (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-11 02:52 UTC by Sergio Polini
Modified: 2006-03-18 13:58 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/var/log/messages when hplip is started before v/ after iptables (hpmsg.txt,4.89 KB, text/plain)
2006-03-12 01:42 UTC, Sergio Polini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Polini 2006-03-11 02:52:14 UTC
Portage 2.0.54 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.12-gentoo-r10 x86_64)
=================================================================
System uname: 2.6.12-gentoo-r10 x86_64 AMD Turion(tm) 64 Mobile Technology ML-34
Gentoo Base System version 1.6.14
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=k8 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k8 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 X alsa apache2 arts audiofile avi berkdb bitmap-fonts bzip2 cdr crypt cups curl dri dvd eds emacs emboss encode exif expat fam ffmpeg foomaticdb fortran gd gdbm gif glut gphoto2 gpm gstreamer gtk gtk2 idn imagemagick imlib innodb ipv6 java jpeg kde lcms libwww lzw lzw-tiff mad mhash mng motif mp3 mpeg mysql ncurses nls ogg opengl pam pcre pdflib perl php png python qt quicktime readline scanner sdl spell ssl tcpd tetex tiff truetype truetype-fonts type1-fonts udev usb vorbis xine xml2 xpm xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Sergio Polini 2006-03-11 03:00:58 UTC
Sorry, I pressed "Commit" before writing my short description ;-)
I've added hplip and cups to my default runlevel, but when I start hp-toolbox or xsane they hang, and lpr <file> doen't print anything.
I thought that it was because my multifunction printer (HP PSC 1510) was powered down when I booted, but they didn't work even if I booted after my printer was powered on.
To get hp-toolbox, xsane, and print commands working I have to restart hplip.
There is an easy workaround: I've added

/etc/init.d/hplip restart

to /etc/conf.d/local.start, but it looks a bit ugly ;-)
Comment 2 Marcelo Goes (RETIRED) gentoo-dev 2006-03-11 10:08:52 UTC
Hmmm, I'm wondering if this is a service dependency issue.
Would you mind testing not having hplip in any runlevel and starting it after your system has finished booting?

Also, have you taken a look in cups's interface (http://localhost:631) - manage printers? Sometimes when I power down my printer and turn it on again I have to restart it manually.
Comment 3 Sergio Polini 2006-03-11 14:00:12 UTC
(In reply to comment #2)
> Hmmm, I'm wondering if this is a service dependency issue.
> Would you mind testing not having hplip in any runlevel and starting it after
> your system has finished booting?

It works, so I've done more ;-)
I've edited my /etc/conf.d/local.start and deleted the line
/etc/init.d/restart.
Then I've edited /etc/init.d/hplip and replaced

depend() {
       before cupsd
       after hotplug
       use net
}

with

depend() {
       after *
       use net
}

and it works!
Comment 4 Marcelo Goes (RETIRED) gentoo-dev 2006-03-11 14:33:04 UTC
Glad it works :-). Ideally, though, we should find what is borking it... I'll probably get my ass kicked if I add "after *" ;-). However, indeed it does not need to be started before cupsd.

Do you happen to remember which services were started after hplip before you made this modification?
Comment 5 Sergio Polini 2006-03-11 16:07:58 UTC
(In reply to comment #4)
> I'll probably get my ass kicked if I add "after *" ;-).

You are right ;-) Removing hplip from all runlevels ad adding /etc/init.d/hplip start to /etc/conf.d/local.start is better. I'll do so, for now.

> Do you happen to remember which services were started after hplip before you
> made this modification?

After a few experiments, I'm (nearly) sure that hplip doesn't work well for me because of... iptables!
If I remove iptables, there is no problem. But that's another matter... I think I should look better at my rules.
Comment 6 Marcelo Goes (RETIRED) gentoo-dev 2006-03-11 17:06:38 UTC
Maybe iptables is blocking ESTABLISHED connections (especially on port 631)?
If iptables is the culprit, I agree the problem is more likely to be with your rules than anything else.
Comment 7 Sergio Polini 2006-03-12 01:42:44 UTC
Created attachment 81963 [details]
/var/log/messages when hplip is started before v/ after iptables
Comment 8 Sergio Polini 2006-03-12 01:48:01 UTC
(In reply to comment #6)
> Maybe iptables is blocking ESTABLISHED connections (especially on port 631)?

Cups works well. Better: I can connect to localhost:631 and even print a test page, but scanimage and hp-toolbox hang.

> If iptables is the culprit, I agree the problem is more likely to be with your
> rules than anything else.

I'ld agree with you. However, I can't understand why hplip works well when it is started _after_ iptables ;-)
I've attached a few lines from /var/log/message: when hplip is started before iptables, and when it is started after iptables.
Perhaps I should send them to HP developers ;-)
Comment 9 Marcelo Goes (RETIRED) gentoo-dev 2006-03-12 09:27:07 UTC
Yes, this looks like an upstream case for me...
Comment 10 Marcelo Goes (RETIRED) gentoo-dev 2006-03-18 10:07:38 UTC
Please, let upstream know about this. My iptables rules don't interfer with hplip functioning, so I am guessing this is a very specific case. Please reopen if you think I am mistaken.

Cheers
Comment 11 Sergio Polini 2006-03-18 13:58:16 UTC
I agree with you and I'll take your advice.
Thanks