Samba and CUPS

Samba and CUPS

Post by Luis Angel Fernández Fernánde » Fri, 13 Jul 2001 15:31:06



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  Hi!

  When I boot my linux box, both, Samba and CUPS start rightly but
samba don't show the cups printer I want to share. I have to restart
samba from shell and then I can see the printer. Does anybody knows
what can I do?

  Thanks in advance.

- --

 |>  Linux 2.4.4 - AMD Athlon - Linux User #99754
 |>  Clave GPG: http://muxin.yi.org:2080/~koxo/miKey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7TUQisrzbHhG/hp8RAvpnAKDes+lhlwyC2GeYLUPNTLJ39Ka8tgCfXCQF
rsqnbWBPo3NIReWVIzk2u2o=
=Omqo
-----END PGP SIGNATURE-----

 
 
 

Samba and CUPS

Post by Karl Heye » Sun, 15 Jul 2001 05:19:11




> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1

>   Hi!

>   When I boot my linux box, both, Samba and CUPS start rightly but
> samba don't show the cups printer I want to share. I have to restart samba
> from shell and then I can see the printer. Does anybody knows what can I do?

>   Thanks in advance.

I'm guessing that samba is looking at the printcap file and cups maybe
(re)writing it.    make sure cups starts first and if that does not work you
may have to put a sleep before the samba processes are started.

karl.

 
 
 

Samba and CUPS

Post by Luis Angel Fernández Fernánde » Mon, 16 Jul 2001 01:58:56


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  Hi!


> I'm guessing that samba is looking at the printcap file and cups
> maybe
> (re)writing it.    make sure cups starts first and if that does not
> work you may have to put a sleep before the samba processes are
> started.

  First at all, thanks for your help :).

  I found an error message in the boot.log file (maybe I have did it
first). The error message is:

Jul  7 09:44:18 muxin smbd: lpstat: Unable to connect to server:
Connection refused

  First, cups was loaded rightly, so what the error means? Why when I
restart samba I can see the printer? Any idea?

  Thanks

- --

 |>  Linux 2.4.4 - AMD Athlon - Linux User #99754
 |>  Clave GPG: http://muxin.yi.org:2080/~koxo/miKey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7UHpMsrzbHhG/hp8RAjzlAJ9fp7Q5rCv3yfV08GbXo34tU2RpcwCgyRRq
QBC/QXxHwv/i4N6O7C87yik=
=Z1kb
-----END PGP SIGNATURE-----

 
 
 

Samba and CUPS

Post by Karl Heye » Mon, 16 Jul 2001 03:47:11




>   First at all, thanks for your help :).

>   I found an error message in the boot.log file (maybe I have did it
> first). The error message is:

> Jul  7 09:44:18 muxin smbd: lpstat: Unable to connect to server: Connection
> refused

>   First, cups was loaded rightly, so what the error means? Why when I
> restart samba I can see the printer? Any idea?

The error is from samba doing a query of cups using lpstat. Whatever lpstat
is asking for is probably on port 631 (cups) which at the time may not be
ready and that is why your getting the message.

try putting something like a 'sleep 2' command in the cups script in
/etc/rc.d/init.d  after cups is started.  What will be happening is the cups
daemon is started, fork'ed and returned back to the startup scripts then
samba is started before the cups daemon has actually had enough
processing time to get going.   It's a multi-tasking system and this is a
form of race condition that can crop up.

What would be better is if the cups program before returning would wait until
the actual daemon instance said it was ok to continue, at least as an option.

karl.

 
 
 

Samba and CUPS

Post by Luis Angel Fernández Fernánde » Tue, 17 Jul 2001 16:20:12


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  Hi!


> The error is from samba doing a query of cups using lpstat. Whatever
> lpstat is asking for is probably on port 631 (cups) which at the
> time may not be ready and that is why your getting the message.

> try putting something like a 'sleep 2' command in the cups script in
> /etc/rc.d/init.d  after cups is started.  What will be happening is
> the cups daemon is started, fork'ed and returned back to the startup
> scripts then samba is started before the cups daemon has actually
> had enough
> processing time to get going.   It's a multi-tasking system and this
> is a form of race condition that can crop up.

> What would be better is if the cups program before returning would
> wait until the actual daemon instance said it was ok to continue, at
> least as an option.

  I've tried that, but that didn't work for me :(. I was thinking
that the reason because samba can't 'stats' the printer could be I
have lp, partport_pc and everything I need for my printer as a
module. What do you think about it?

  Thanks.

- --

 |>  Linux 2.4.4 - AMD Athlon - Linux User #99754
 |>  Clave GPG: http://muxin.yi.org:2080/~koxo/miKey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7UpWqsrzbHhG/hp8RAll5AJ0VjOdG/o5NEupAap84wZ1/Vw2TgwCeOdGb
mphX4FnMEgRCLAPTbptquts=
=yvkx
-----END PGP SIGNATURE-----

 
 
 

Samba and CUPS

Post by Karl Heye » Sun, 22 Jul 2001 05:03:31




>   I've tried that, but that didn't work for me :(. I was thinking
> that the reason because samba can't 'stats' the printer could be I have lp,
> partport_pc and everything I need for my printer as a module. What do you
> think about it?

I don't think it is, the modules depandancies are setup from depmod near the
beginning and can disabled from /etc/modules.conf so if it didn't work at
/etc/rc.N.d stage then it wouldn't work later on either.

How about looking into name resolution issues. I would still look into the
cannot connect to the port message, probably 631 (cups).  This to me
indicates that cups maybe timing out on a hostname lookup before listening
on the port which samba wants a connection to.  Using strace here should
help, but identify what hostnames are being used and how you do name
resolution.

I don't know your setup and how you have configureed cups, do you run a
caching nameserver, if so at what point does it start? are all your hostnames
in the /etc/hosts file? etc...

karl.

 
 
 

Samba and CUPS

Post by Luis Angel Fernández Fernánde » Sun, 22 Jul 2001 23:19:11


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1




> How about looking into name resolution issues. I would still look
> into the
> cannot connect to the port message, probably 631 (cups).  This to me
> indicates that cups maybe timing out on a hostname lookup before
> listening
> on the port which samba wants a connection to.  Using strace here
> should help, but identify what hostnames are being used and how you
> do name resolution.

> I don't know your setup and how you have configureed cups, do you
> run a caching nameserver, if so at what point does it start? are all
> your hostnames in the /etc/hosts file? etc...

  First at all, finally I can see the printer, but I have to put a
'sleep 60' in /etc/rc.d/init.d/cups :(. I load samba at the end (only
rc.local runs after) but /etc/printcap is modified at the same minute
that samba is loading, so I decided to put an higher sleep than you
said. Although in that way I can see the printer, I think that the
sleep solution isn't a good one. Do you (or anybody else) know if
there is a way to avoid cups rewrite printcap on every boot?

  And thanks for your help.

- --

 |>  Linux 2.4.6 - AMD Athlon - Linux User #99754
 |>  Clave GPG: http://muxin.yi.org:2080/~koxo/miKey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7WY9dsrzbHhG/hp8RAnzHAJ97thty6D1O2iy89C3oP8lwQ4IrRQCgrqYs
zD5eNDFWs61zlAX0MzLJqLM=
=FrGy
-----END PGP SIGNATURE-----

 
 
 

Samba and CUPS

Post by Karl Heye » Mon, 23 Jul 2001 10:09:18




>   First at all, finally I can see the printer, but I have to put a
> 'sleep 60' in /etc/rc.d/init.d/cups :(. I load samba at the end (only
> rc.local runs after) but /etc/printcap is modified at the same minute that
> samba is loading, so I decided to put an higher sleep than you said.
> Although in that way I can see the printer, I think that the sleep solution
> isn't a good one. Do you (or anybody else) know if there is a way to avoid
> cups rewrite printcap on every boot?

>   And thanks for your help.

It smells like a timeout in cups, possibly DNS.  You might have to post the
cupsd.conf file, along with some information about the name resolution you
have.

I suspect something in your config is causing cups to do a name lookup that
isn't working locally so is asking a DNS server which cannot be reached. You
could run a tcpdump -n at boot to capture network packets, looking
specifically for DNS requests.

karl.

 
 
 

Samba and CUPS

Post by Luis Angel Fernández Fernánde » Thu, 02 Aug 2001 00:10:45


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> It smells like a timeout in cups, possibly DNS.  You might have to
> post the cupsd.conf file, along with some information about the name
> resolution you have.

> I suspect something in your config is causing cups to do a name
> lookup that isn't working locally so is asking a DNS server which
> cannot be reached. You could run a tcpdump -n at boot to capture
> network packets, looking specifically for DNS requests.

  I put this line just below daemon cupsd in the init script:
              tcpdump -n -i eth1 > /var/log/tcp.eth1 &
(eth1 is the network card to the Internet). I don't understand the
output of the tcpdump command, but I think there are some DNS
request.
   This is the begining of the output file: (I'm sorry if i send too
much, but I don't know what is useful and what isn't).

16:39:58.769174 0:60:67:76:f9:84 > ff:ff:ff:ff:ff:ff sap e0 ui/C
len=43
                         ffff 0028 0001 0000 0000 ffff ffff ffff
                         0453 0000 0000 0060 6776 f984 0453 0001
                         0000 0002 ffff ffff 0303 03
16:39:58.831048 213.141.32.122 > 224.0.0.2: icmp: router solicitation
16:39:58.858773 192.168.0.18.8080 > 192.168.0.205.2907: P
1387398486:1387399946(1460) ack 1472670390 win 17003 (DF)
16:39:58.881157 212.89.0.2.53 > 212.89.22.90.32769: 47364 NXDomain*
0/0/0 (27) (DF)
16:39:58.882440 212.89.22.90.32769 > 212.89.0.2.53: 47365+ (27) (DF)
16:39:58.892392 0:c0:26:a3:5e:25 > 3:0:0:0:0:1 sap f0 ui/C len=179
                         2c00 ffef 0800 0000 0000 0000 4252 4153
                         494c 2020 2020 2020 2020 201d 504f 4e49
                         454e 5445 2020 2020 2020 2000 ff53 4d42
                         2500 00
16:39:58.893610 213.141.41.91.1088 > 255.255.255.255.47624: udp 52
16:39:58.907615 64.245.59.31.21 > 212.89.27.202.1028: P
3927504380:3927504403(23) ack 64421 win 32120 (DF)
16:39:58.910547 arp who-has 212.89.16.254 tell 212.89.18.53
16:39:58.910613 0:e0:7d:80:7a:f2 > 3:0:0:0:0:1 sap f0 ui/C len=44
                         2c00 ffef 0100 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000 4546 4553
                         4f20 2020 2020 2020 2020 2000
16:39:58.913119 212.89.0.2.53 > 212.89.22.90.32769: 47365 NXDomain
0/0/0 (27) (DF)
16:39:58.914184 212.89.22.90.32769 > 212.89.0.2.53: 47366+ (27) (DF)
16:39:58.951624 212.89.0.2.53 > 212.89.22.90.32769: 47366 NXDomain
0/0/0 (27) (DF)
16:39:58.952533 212.89.22.90.32769 > 212.89.0.2.53: 47367+ (27) (DF)
16:39:58.958464 192.168.0.18.8080 > 192.168.0.205.2907: P
1460:2920(1460) ack 1 win 17003 (DF)
16:39:58.971899 192.168.0.18.8080 > 192.168.0.205.2907: P
2920:4380(1460) ack 1 win 17003 (DF)
16:39:58.981150 212.89.0.2.53 > 212.89.22.90.32769: 47367 NXDomain
0/0/0 (27) (DF)
16:39:59.001943 217.88.168.122.2431 > 213.141.33.130.6347: S
3223802173:3223802173(0) win 8760 <mss 1452,nop,nop,sackOK> (DF)
16:39:59.027050 192.168.0.18.8080 > 192.168.0.205.2907: P
4380:5272(892) ack 1 win 17003 (DF)
16:39:59.028213 arp who-has 212.89.16.254 tell 212.89.17.46
16:39:59.061773 192.168.0.18.8080 > 192.168.0.205.2907: P
5272:6732(1460) ack 1 win 17003 (DF)
16:39:59.170775 192.168.0.18.8080 > 192.168.0.205.2907: .
8192:9652(1460) ack 1 win 17003 (DF)
16:39:59.175956 192.168.0.18.8080 > 192.168.0.205.2907: P
9652:10240(588) ack 1 win 17003 (DF)
16:39:59.179017 212.89.0.5.67 > 212.89.18.207.68: xid:0x4169
C:212.89.18.207 Y:212.89.18.207 S:212.89.0.5 [|bootp] (DF)
16:39:59.208648 212.89.22.71.4536 > 212.89.22.255.39213: udp 824
16:39:59.208677 62.211.163.252.1376 > 212.89.27.135.6699: S
4218757:4218757(0) win 32768 <mss 1460,nop,nop,sackOK> (DF)
16:39:59.222739 arp who-has 212.89.16.242 tell 212.89.16.254
16:39:59.230818 arp who-has 212.89.22.255 tell 212.89.28.143
16:39:59.259214 192.168.0.18.8080 > 192.168.0.205.2907: P
12876:14336(1460) ack 1 win 17003 (DF)
16:39:59.272722 192.168.0.18.8080 > 192.168.0.205.2907: P
14336:15796(1460) ack 1 win 17003 (DF)
16:39:59.334225 192.168.0.18.8080 > 192.168.0.205.2907: P
15796:16536(740) ack 1 win 17003 (DF)
16:39:59.335663 0:0:21:ff:ff:ff > ff:ff:ff:ff:ff:ff sap 00 I
(s=0,r=0,C) len=42
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000 0000 0000 0000
                         0000 0000 0000 0000 0000

  There are some DNS request... all of then ended in .53, aren't
them?.  And there is something that i don't understand (yes,
something more :( ). Some lines with 192.168.0.18, what those means?
My LAN is on the 192.168.1.0 network.... and on the eth0 interface.

  Thanks.

- --

 |>  Linux 2.4.6 - AMD Athlon - Linux User #99754
 |>  Clave GPG: http://muxin.yi.org:2080/~koxo/miKey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7ZspysrzbHhG/hp8RAnc7AJ9FffubGP0BXYea1a+fLwsFjt+RfgCfbPbp
R6DyO4Ivr38JMhxvGtXvKVs=
=gXoZ
-----END PGP SIGNATURE-----

 
 
 

Samba and CUPS

Post by Luis Angel Fernández Fernánde » Fri, 03 Aug 2001 00:27:18


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  Hi!

  I've been 'playing' with cupsd.conf and I've changed the LogLevel
option. I set it  to debug2 and I saw some error messages about
browsing. I think I fixed it. I saw that cups load a lot of printer
driver and device drivers before it starts to listen to its port. So
I think that's the problem, the cups init script returns before cupsd
starts to listen to its port and before samba asks for a printer.
What do you think about this?

  Thanks.

- --

 |>  Linux 2.4.6 - AMD Athlon - Linux User #99754
 |>  Clave GPG: http://muxin.yi.org:2080/~koxo/miKey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7aB/UsrzbHhG/hp8RArHAAKDKTLZoYcQDUGIIGk8WuTJcxmJwYwCfWjP/
2aMhtKU0EpKDpZHw6js9VHQ=
=x4qd
-----END PGP SIGNATURE-----

 
 
 

Samba and CUPS

Post by Karl Heye » Sun, 05 Aug 2001 04:32:41




> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1

>   Hi!

>   I've been 'playing' with cupsd.conf and I've changed the LogLevel
> option. I set it  to debug2 and I saw some error messages about browsing. I
> think I fixed it. I saw that cups load a lot of printer driver and device
> drivers before it starts to listen to its port. So I think that's the
> problem, the cups init script returns before cupsd starts to listen to its
> port and before samba asks for a printer. What do you think about this?

sounds familiar!, yes that should be it. cupsd like mosts daemons starts up
forks a couple of times so it becomes a standalone program. The original
process returns straight away leaving the other the initialise the printing
subsystem.  This latter part is probably taking a while before the being
ready.

karl.

 
 
 

Samba and CUPS

Post by Karl Heye » Sun, 05 Aug 2001 05:02:43



...

Quote:

>   I put this line just below daemon cupsd in the init script:
>               tcpdump -n -i eth1 > /var/log/tcp.eth1 &
> (eth1 is the network card to the Internet). I don't understand the output of
> the tcpdump command, but I think there are some DNS request.
>    This is the begining of the output file: (I'm sorry if i send too
> much, but I don't know what is useful and what isn't).
> 16:39:58.769174 0:60:67:76:f9:84 > ff:ff:ff:ff:ff:ff sap e0 ui/C len=43
>                          ffff 0028 0001 0000 0000 ffff ffff ffff 0453 0000
>                          0000 0060 6776 f984 0453 0001 0000 0002 ffff ffff
>                          0303 03

Novell

Quote:> 16:39:58.831048 213.141.32.122 > 224.0.0.2: icmp: router solicitation

multicast packet.

Quote:> 16:39:58.858773 192.168.0.18.8080 > 192.168.0.205.2907: P
> 1387398486:1387399946(1460) ack 1472670390 win 17003 (DF)

port 8080 is typical of a web proxy.

Quote:> 16:39:58.881157 212.89.0.2.53 > 212.89.22.90.32769: 47364 NXDomain* 0/0/0
> (27) (DF)
> 16:39:58.882440 212.89.22.90.32769 > 212.89.0.2.53: 47365+ (27) (DF)

These are DNS. The first line is a reply from 212.89.0.2 (check
/etc/resolv.conf or a caching DNS you may have). check if you have a search
or domain keyword within /etc/resolv.conf

Quote:> 16:39:58.892392 0:c0:26:a3:5e:25 > 3:0:0:0:0:1 sap f0 ui/C len=179
>                          2c00 ffef 0800 0000 0000 0000 4252 4153 494c 2020
>                          2020 2020 2020 201d 504f 4e49 454e 5445 2020 2020
>                          2020 2000 ff53 4d42 2500 00

Novell

Quote:> 16:39:58.893610 213.141.41.91.1088 > 255.255.255.255.47624: udp 52

dunno, but it's broadcasting

Quote:> 16:39:58.907615 64.245.59.31.21 > 212.89.27.202.1028: P
> 3927504380:3927504403(23) ack 64421 win 32120 (DF)
> 16:39:58.910547 arp who-has 212.89.16.254 tell 212.89.18.53

normal
...

Quote:> 16:39:59.179017 212.89.0.5.67 > 212.89.18.207.68: xid:0x4169 C:212.89.18.207
> Y:212.89.18.207 S:212.89.0.5 [|bootp] (DF)

DHCP/bootp

Quote:>   There are some DNS request... all of then ended in .53, aren't
> them?.  And there is something that i don't understand (yes, something more
> :( ). Some lines with 192.168.0.18, what those means? My LAN is on the
> 192.168.1.0 network.... and on the eth0 interface.

correct, 53 is the DNS port. use ifconfig and route -n to look at your IP
addresses and you routing table.  The DNS requests you have listed resulted
in failure. I can't tell from this if 192.168.0.xxx is coming from you box.

karl.

 
 
 

Samba and CUPS

Post by Luis Angel Fernández Fernánde » Sun, 05 Aug 2001 15:59:01


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

  Hi!

  Thanks a lot for your help :)

- --

 |>  Linux 2.4.6 - AMD Athlon - Linux User #99754
 |>  Clave GPG: http://muxin.yi.org:2080/~koxo/miKey.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7a50zsrzbHhG/hp8RAsjBAKCw7gJnSkXkkefSvRdFo7zYb6TQQACeJRLP
iKOYb8FkXBgLpSaeq/RIT+Q=
=CRxF
-----END PGP SIGNATURE-----

 
 
 

1. CUPS packaging: .cups not -cups

Finally, I found out why my cups works from the admin tool but fails
otherwise: RPM installation didn't create symblinks to lpr, lpq, etc.
Although I read from man pages about lpr-cups, lpc-cups, and so on, they
exist on the hard disk as lpr.cups, lpc.cups, and so on.  Here are a few
questions:

1. Where does this naming descrepency come from?  RedHat, CUPS, or
somewhere else?

2. I think RH installs lpd printing by default but I may have explicitly
chosen to do so; I probably also chose to install CUPS at the same time.
  Could this be the reason why symblinks are not created?  Or the cups
RPM doesn't create any, period?

3. Now that I discovered the real naming convention, I can cope with
command-line and Mozilla, maybe a couple of other applications that
allow explicit printing facility configuration.  But I encounter
programs like xpdf that jumps into Mozilla every time I download a PDF
file. (I don't see GhostView installed, though GhostScript is by
default.)  There's no printing config in xpdf except paper format.  I
believe it defaults to lpr.  Any way to change this( without linking
lpr.cups to lpr)?

Thanks.

Yuan Liu

2. Help - Trouble Mounting/Reading SCSI CD

3. samba, mandrake 7.2 and cups, or, samba follies

4. controller id changed after upgrade to 2.6 on E5K--weirdness...

5. Matrox Mystique ands X.

6. Install via null modem

7. Problem installing cups and cups-libs rpm packages

8. Linux at nonprofits ? What works? What doesn't?

9. cups + samba configuration question

10. samba printing to cups

11. CUPS from Ports working, cups from src not

12. Problem with samba, Epson and cups

13. Printing with CUPS through SAMBA