Koozali.org: home of the SME Server

upgrading Samba to 3.X

Robert

upgrading Samba to 3.X
« Reply #15 on: January 16, 2005, 10:53:18 AM »
Hmmm... that's interesting. Samba is using what appear to be correct defaults for "printing = cups", including "printcap name = lpstat", but from your smbd error log it looks like the defaults don't work. Are you absolutely sure that the command 'lpstat -v' works from the shell prompt and doesn't ask you for a password or anything?

As a workaround, you could add the line "printcap name = /etc/printcap" to the global section in smb.conf, then reload samba and post the results here, please.

Robert

upgrading Samba to 3.X
« Reply #16 on: January 16, 2005, 11:25:11 AM »
An update about the other CUPS-related problem you reported: I've contacted Greg Zartman, the maintainer of e-smith-samba-2.*, and he has kindly put the reload-samba action back into e-smith-samba. Therefore and contrary to what I wrote before, I will _not_ change the symlink target in the printer-sync event (in e-smith-cups) from reload-samba to restart-samba. If you use samba-3 with e-smith-samba-2 and find that samba doesn't reload in printer-sync, you should update your e-smith-samba-2 package. This only applies to people who use Samba3/e-smith-samba-2 with CUPS/e-smith-cups.

dwater

upgrading Samba to 3.X
« Reply #17 on: January 16, 2005, 01:24:47 PM »
Quote from: "Robert"
...Are you absolutely sure that the command 'lpstat -v' works from the shell prompt and doesn't ask you for a password or anything?...


Quote from: "lpstat -v"
device for HP1120C: socket://hp-jd500x:9100/
device for HP2100-Corp: socket://hp-jd500X:9101/
device for philly: socket://philly:9100/
device for ricardo: socket://ricardo:9100/


Looks normal to me :|

Max.

dwater

upgrading Samba to 3.X
« Reply #18 on: January 17, 2005, 01:08:46 AM »
One thing I am noticing, is when I do a /etc/init.d/smb restart, I sometimes have the '[OK]' missing on the 'Starting SMB services' line. A 'ps -aux' shows that smb has been running for a few days - so the restart didn't happen.

Code: [Select]
/etc/init.d/smb restart
Shutting down SMB services:                                [   OK   ]
Shutting down NMB services:                                [   OK   ]
Starting SMB services:
Starting NMB services:                                     [   OK   ]
[mwaterman@truth samba]# ps -aux | fgrep smb
root       330  0.0  0.0  1284  272 ?        S    Jan14   0:00 supervise smbd
root      2814  0.0  0.0  7232 1012 ?        S    Jan14   0:00 smbd -D
root     11585  0.6  0.1  7100 2388 ?        S    07:57   0:00 /usr/sbin/smbd -F
root     11592  0.0  0.1  7100 2412 ?        S    07:57   0:00 /usr/sbin/smbd -F
5004     11606  6.1  0.2  7812 3676 ?        S    07:57   0:00 /usr/sbin/smbd -F
root     11608  0.0  0.0  1684  560 pts/0    R    07:58   0:00 grep -F smb


However, it is currently looking OK (?) :

Code: [Select]
# ps -aux | fgrep smb
root       330  0.0  0.0  1284  276 ?        S    Jan14   0:00 supervise smbd
root     11893  2.0  0.1  7100 2388 ?        S    08:00   0:00 /usr/sbin/smbd -F
root     11896  0.0  0.1  7100 2412 ?        S    08:00   0:00 /usr/sbin/smbd -F
root     11917  0.0  0.0  1680  548 pts/0    R    08:00   0:00 grep -F smb


but still, there are no printers advertised.

I see this too :

Quote from: "smbd.log"
[2005/01/17 08:00:23, 0] printing/pcap.c:pcap_printer_fn(361)
  Unable to open printcap file lpstat for read!


Any ideas?

Max.

dwater

upgrading Samba to 3.X
« Reply #19 on: January 17, 2005, 02:08:31 AM »
another data point; this works fine :

Code: [Select]
# cat /etc/passwd | lp -d ricardo
request id is ricardo-252 (1 file(s))


but I cannot add a printer to an XP client either by specifying "\\truth\ricardo", or by browsing.

Robert

upgrading Samba to 3.X
« Reply #20 on: January 17, 2005, 06:05:46 PM »
Could you please do the following:

1. Update your e-smith-samba-2 package to the latest released version (the one that has the reload-samba action back in).
2. Point /etc/e-smith/events/printer-sync/S90reload-samba back at reload-samba (instead of restart-samba, what you changed it to).
3. Add the line "printcap name = /etc/printcap" to the global section of your smb.conf.
4. Issue the command "/sbin/e-smith/signal-event printer-sync".

Let me know whether or not:

1. smbd actually got reloaded? The smbd log should tell you.
2. Your printers are now visible to samba clients?

dwater

upgrading Samba to 3.X
« Reply #21 on: January 18, 2005, 03:38:20 AM »
Quote from: "Robert"
Could you please do the following:

1. Update your e-smith-samba-2 package to the latest released version (the one that has the reload-samba action back in).


# rpm -q e-smith-samba
e-smith-samba-2.1.0-10gjz

Quote

2. Point /etc/e-smith/events/printer-sync/S90reload-samba back at reload-samba (instead of restart-samba, what you changed it to).


# ls -l /etc/e-smith/events/printer-sync/S90reload-samba
lrwxrwxrwx    1 root     root           23 Jan 18 10:11 /etc/e-smith/events/printer-sync/S90reload-samba -> ../actions/reload-samba

Quote

3. Add the line "printcap name = /etc/printcap" to the global section of your smb.conf.


# cat /etc/e-smith/templates{,-custom}/etc/smb.conf/11printcapName
printcap name = /etc/printcap
# egrep '^\[|printcap' /etc/smb.conf
[global]
printcap name = /etc/printcap
[homes]
...

Quote

4. Issue the command "/sbin/e-smith/signal-event printer-sync".


Ok, it seemed to take a a while (30 seconds?), but it complete w/o any messages.

Quote

Let me know whether or not:

1. smbd actually got reloaded? The smbd log should tell you.


This is strange; I seem to have two sets of log files - /var/log/samba/smbd.log and /var/log/samba/log.smbd. Same for nmbd.

In any case, neither of them have been changed since I rebooted earlier this morning (still complaining about the printcap file).

In the /var/log/messages file, I see :

Code: [Select]
Jan 18 10:24:50 truth e-smith[3819]: Running event handler: /etc/e-smith/events/printer-sync/S90reload-samba
Jan 18 10:24:51 truth kernel: NET4: AppleTalk 0.18a for Linux NET4.0
Jan 18 10:24:51 truth atalkd[3887]: restart (1.5.5)
Jan 18 10:24:51 truth e-smith[3819]: S90reload-samba=action|Event|printer-sync|Action|S90reload-samba|Start|1106015090 990943|End|1106015091 450907|Elapsed|0.459964
Jan 18 10:24:51 truth e-smith[3819]: Running event handler: /etc/e-smith/events/printer-sync/S95cups-symlink-ppds
Jan 18 10:24:51 truth e-smith[3819]: S95cups-symlink-ppds=action|Event|printer-sync|Action|S95cups-symlink-ppds|Start|1106015091 451133|End|1106015091 475560|Elapsed|0.024427
Jan 18 10:24:51 truth e-smith[3819]: Running event handler: /etc/e-smith/events/printer-sync/S95cups-update-timestamp
Jan 18 10:24:51 truth /etc/e-smith/events/printer-sync/S95cups-update-timestamp[3902]: /home/e-smith/configuration: OLD cups=service|LastSync|1105922275|status|enabled Jan 18 10:24:51 truth /etc/e-smith/events/printer-sync/S95cups-update-timestamp[3902]: /home/e-smith/configuration: NEW cups=service|LastSync|1106015091|status|enabled Jan 18 10:24:51 truth e-smith[3819]: S95cups-update-timestamp=action|Event|printer-sync|Action|S95cups-update-timestamp|Start|1106015091 475776|End|1106015091 756484|Elapsed|0.280708



Quote

2. Your printers are now visible to samba clients?


'fraid not :( Same as before - the shares are there, but not the printers.

Robert

upgrading Samba to 3.X
« Reply #22 on: January 18, 2005, 08:05:55 PM »
Have you tried a full samba restart? Kill anything samba-related for good measure first, then do "/etc/e-smith/events/actions/restart-samba".
BTW, what's the output of "testparm -s |grep printcap"?
Did printer-sync produce a printcap file that looks OK to you?

dwater

upgrading Samba to 3.X
« Reply #23 on: January 19, 2005, 04:29:33 AM »
Quote from: "Robert"
Have you tried a full samba restart? Kill anything samba-related for good measure first, then do "/etc/e-smith/events/actions/restart-samba".


I tried a reboot. That's should do what you suggest, I think.

When I try to (on XP) 'start/run \\truth\philly', it reports 'the network path was not found \\truth\philly'.

Quote from: "Robert"

BTW, what's the output of "testparm -s |grep printcap"?


Code: [Select]
printcap name = lpstat

Does that make sense? I don't know anything about printcap...though I note that on my FC3 system (at home), it says 'printcap name = /etc/printcap', so that is a difference...

Quote from: "Robert"

Did printer-sync produce a printcap file that looks OK to you?


I don't know what it should look like :-?
Ah, but I have an FC3 box right here, and they look similar. This is the SME one :

Code: [Select]
HP1120C:rm=truth:rp=HP1120C:
HP2100-Corp:rm=truth:rp=HP2100-Corp:
philly:rm=truth:rp=philly:
ricardo:rm=truth:rp=ricardo:


Thanks!

Max.

Robert

upgrading Samba to 3.X
« Reply #24 on: January 19, 2005, 07:15:28 AM »
Looking at the defaults used for your samba configuration, I'm pretty sure that your smbd was not compiled against libcups, but just to make sure, can you confirm that "ldd /usr/sbin/smbd |grep cups" returns nothing?

If your /etc/smb.conf still has the line "printcap name = /etc/printcap" but testparm reports "printcap name = lpstat", then something must be wrong with samba. It's starting to look like samba has trouble setting and using correct values for "printing = cups". Since cups has SysV and BSD frontends, you could try the following workaround:
1. Keep the template fragment that sets "printcap name = /etc/printcap"
2. Change the template fragment that sets the "printing" parameter from "printing = cups" to "printing = sysv"
3. Expand the template for /etc/smb.conf
4. Get the output of "testparm -s" and post it, please.
5. /etc/e-smith/events/actions/reload-samba

dwater

upgrading Samba to 3.X
« Reply #25 on: January 19, 2005, 08:26:49 AM »
Quote from: "Robert"
Looking at the defaults used for your samba configuration, I'm pretty sure that your smbd was not compiled against libcups, but just to make sure, can you confirm that "ldd /usr/sbin/smbd |grep cups" returns nothing?


# ldd /usr/sbin/smbd |grep cups
#

Quote

If your /etc/smb.conf still has the line "printcap name = /etc/printcap"


# fgrep printcap /etc/smb.conf
printcap name = /etc/printcap

Quote

 but testparm reports "printcap name = lpstat",


# testparm -s |& fgrep printcap
        printcap name = lpstat

Quote

 then something must be wrong with samba. It's starting to look like samba has trouble setting and using correct values for "printing = cups". Since cups has SysV and BSD frontends, you could try the following workaround:
1. Keep the template fragment that sets "printcap name = /etc/printcap"


# find /etc/e-smith -name \*printcap\* | xargs fgrep 'printcap name'
/etc/e-smith/templates-custom/etc/smb.conf/11printcapName:printcap name = /etc/printcap

Quote

2. Change the template fragment that sets the "printing" parameter from "printing = cups" to "printing = sysv"


OK, so that is :

# find /etc/e-smith -type f | xargs fgrep 'printing ='
/etc/e-smith/templates/etc/smb.conf/20printing:printing = cups

so, I copy that to 'templates-custom/...' and change it :

# find /etc/e-smith -type f | xargs fgrep 'printing = '
/etc/e-smith/templates/etc/smb.conf/20printing:printing = cups
/etc/e-smith/templates-custom/etc/smb.conf/20printing:printing = sysv

Quote

3. Expand the template for /etc/smb.conf


# /sbin/e-smith/expand-template /etc/smb.conf
#

Quote

4. Get the output of "testparm -s" and post it, please.


I put them on my web site (would you prefer I post them here for prosperity?) :

http://reality.sgiweb.org/maxw/tmp/samba-debug/testparm-2.txt

Quote

5. /etc/e-smith/events/actions/reload-samba


bingo (from my powerbook):

% net -S truth share
unable to open file (No such file or directory)
Password:
print$
Primary
admin-files
shared-files
IPC$
ADMIN$
HP1120C
HP2100-Corp
philly
ricardo
mwaterman

What next? Is this a good workaround to actually use semi-permanently?

Robert

upgrading Samba to 3.X
« Reply #26 on: January 19, 2005, 06:29:11 PM »
As you can see from the testparm output, "printing = sysv" does pretty much the same thing as "printing = cups", except that it's not broken.
So you could use this as a workaround, but a better one might even be to:

1. keep the "printcap name = /etc/printcap" bit

2. put this in /etc/e-smith/templates-custom/etc/smb.conf/20printing:

print command = /usr/bin/lp -d '%p' %s; rm %s
lpq command = /usr/bin/lpstat -o '%p'
lprm command = /usr/bin/cancel '%p-%j'
lppause command = lp -i '%p-%j' -H hold
lpresume command = lp -i '%p-%j' -H resume
queuepause command = /usr/bin/disable '%p'
queueresume command = /usr/bin/enable '%p'

That means you have no "printing = something" parameter, so no broken defaults/overrides to worry about.

3. Expand template and reload samba.

Next, you should report the two bugs you found in samba-3.0.7:
1. printcap method of lpstat does not work with CUPS
2. "printing = cups" overrides "printcap name" parameter in smb.conf

Please report these bugs to the packager of your samba package (get his address with "rpm -qi samba" or "rpm -q --changelog samba"). He'll be able to (help you) check if these bugs have already been reported upstream, add info about build options that may be of interest (like: not compiled against libcups), and coordinate the upstream bug reports with you. Please post the upstream bug tickets here for people who want to track this.

Offline gzartman

  • *
  • 305
  • +0/-0
    • LEI Engineering & Surveying
upgrading Samba to 3.X
« Reply #27 on: January 19, 2005, 07:45:29 PM »
Quote from: "Robert"
Looking at the defaults used for your samba configuration, I'm pretty sure that your smbd was not compiled against libcups, but just to make sure, can you confirm that "ldd /usr/sbin/smbd |grep cups" returns nothing?


Please see the following changelog information for the current SME Samba 3 packages.  Notice that cups support is shut off.

* Tue Nov 30 2004 Shad L. Lords <slords@mail.com> 3.0.7-1.2sme01

- Rebuild of stock Centos 3.3 package for SME 6.1
- Remove pie patch.
- Remove ACL compile option.
- Remove automount compile option.
- Explicitly disable cups support
- In $preun, replace standard smb service shutdown with
  daemontools equivalent. Only good for SME!!
- In %postun, replace standard service restart with
  daemontools equivalent.  Only good for SME!!
----
Greg J. Zartman
LEI Engineering & Surveying

SME user and community member since 2000.

Robert

upgrading Samba to 3.X
« Reply #28 on: January 19, 2005, 09:04:08 PM »
Building samba with --disable-cups (or whatever the switch is called) makes sure that smbd isn't linked to libcups. If smbd is linked to libcups it can use libcups library functions for the printing commands, which means you don't need to install any CUPS frontends/clients, like lp, lpr, lprm, cancel, lpstat, etc. If samba was built without libcups-support and you specify "printing = cups" it will just call the various frontends (lp, cancel, etc.), similarly as with any other printing system. So, the fact that samba was built with --disable-cups explains why "ldd smbd" didn't find libcups, it does not explain the problems that dwater encountered.

dwater

upgrading Samba to 3.X
« Reply #29 on: January 26, 2005, 09:23:40 AM »
Quote from: "Robert"

Please report these bugs to the packager of your samba package ... Please post the upstream bug tickets here for people who want to track this.


So, I take it I don't need to do this then - since he actually has actually posted to this thread on the issue?

Let me know.

Thanks.

Max.