Bug 230 - SYSV not defined for Solaris 9 in configure.in
Summary: SYSV not defined for Solaris 9 in configure.in
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Config Files (show other bugs)
Version: 3.0.0preX
Hardware: All Solaris
: P2 normal
Target Milestone: 3.0.0rc2
Assignee: Gerald (Jerry) Carter (dead mail address)
QA Contact:
: 355 (view as bug list)
Depends on:
Reported: 2003-07-16 05:54 UTC by Claude Frantz
Modified: 2005-11-14 09:24 UTC (History)
3 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Claude Frantz 2003-07-16 05:54:53 UTC
In my smb.conf, there is "printing = SYSV", "printer name = lp" but no printer
is made available. Further, there are many error lines like "Error loading
module '/usr/local/samba-numa/lib/charset/CP850.so': ld.so.1: ./bin/testparm:
fatal: /usr/local/samba-numa/lib/charset/CP850.so: open failed: No such file or
Conversion from CP850 to UTF8 not supported " when testing the config with
"testparm". But this bug is another story. 

The log.smbd shows entries like " printing/pcap.c:pcap_printer_fn(361)
  Unable to open printcap file /etc/printcap for read! ". In fact, there is no
printcap file present, as usual with SYS V. Using past versions of SAMBA, I did
not have a printcap file.

 Another entry like "rpc_server/srv_spoolss_nt.c:set_printer_hnd_name(454)
  Setting printer name=\\kommsrv.rz.unibw-muenchen.de\lp (len=33)
  searching for [lp] (len=2)
  Printer not found ".
Comment 1 Jan-Olaf Droese 2003-07-22 07:52:56 UTC
Same problem here with 3.0.0beta3 under sparc-sun-solaris2.7 with gcc version 3.2.2.

The whole printing system defaults to BSD after compilation and therefore the
printers are not loaded.

The cause for the problem seems to be that the SYSV variable is not defined in
config.h after running the configure script. This causes the code to parse the
output of the lpstat command not to be included. Also all print commands default
to the BSD variants (e.g. lpq instead of lpstat etc.)

My quick fix for this was to manually #define SYSV in config.h after running
configure. Now the printers get loaded again and the lp* commands default to the
sysv values.

I can not provide a real fix for this. I think the configure script is the right
place to fix the problem.

If there are any patches I should test, I'd be more than happy to offer my help.
Comment 2 Jan-Olaf Droese 2003-08-18 03:49:01 UTC
This is still in 3.0.0rc1.

After looking into this a bit further (since I wanted to know why it used to
work before), I think I have found the cause of the problem:

The SYSV variable never got defined in config.h. Instead, older versions (e.g.
2.2.7a )had the following in include/includes.h:

+ /* this guess needs to be improved (tridge) */
+ #if (defined(STAT_STATVFS) || defined(STAT_STATVFS64)) && !defined(SYSV)
+ #define SYSV 1
+ #endif

This caused the SYSV variable to be defined before the #defines for the
printsystem are evaluated.

A quick fix would be to again include the lines shown above in includes.h. But
as the comment above suggest, this is probably not the right way to fix it.

This bug is a real showstopper, since it will cause printing to fail on all SYSV
platforms because the whole printing system will default to BSD.
Comment 3 Gerald (Jerry) Carter (dead mail address) 2003-08-18 09:22:10 UTC
Thanks for checking but since this bug was never 
marked as fixed, i would have expected it to 
remain in RC1.  I'll try to get it fixed by rc2.
Comment 4 Gerald (Jerry) Carter (dead mail address) 2003-08-25 21:38:37 UTC
I need to now what versions of solaris use SYSV printing 
and when Sun made the move to BSD (which is the recent 
trend from what I've heard).  Can you provide any input
for this?  What printing packages are installed on 
Solaris 9 ?
Comment 5 Claude Frantz 2003-08-25 23:54:09 UTC
If I remember well, the first version using SYSV was Solaris 2.3.
This was ten years ago.

> What printing packages are installed on Solaris 9 ?

This is a hybrid system, a sort of BSD and SYSV mix, if I understand
well. The primary focus is SYSV and this is the primary view of
the user. I cannot give you further details about the exact details.
I think, we have simply to consider this OS as SYSV. This was the
way past versions of SAMBA have seen the matter. It worked well.
Comment 6 Gerald (Jerry) Carter (dead mail address) 2003-08-26 13:22:44 UTC
According to the Sun docs I've read, beginning with 
Solaris 2.6, the print spooler implemented the BSD 
printing protocol.  

The problem I have is defining a test for SYSV vs. BSD
that is not based on the operating system version.

If you set 'printing = sysv', it should fix your problem.
Can you check for me?

I'm going to try to get my Solaris 9 box back up tonight
and see what a stock install looks like.  I tried to see 
if I could get this information from the build farm, but 
no luck.
Comment 7 Tim Potter 2003-08-26 23:29:29 UTC
*** Bug 355 has been marked as a duplicate of this bug. ***
Comment 8 Tim Potter 2003-08-26 23:30:23 UTC
Adding me as cc.
Comment 9 Jan-Olaf Droese 2003-08-27 00:25:10 UTC
Just adding "printing = sysv" will not fix the problem.

There is special code in print_svid.c which parses the output of the lpstat
command to get a list of printers. This code only gets compiled in if SYSV is
defined. Without this code, load printers will not work because only the code
for parsing a printcap file is there (but there is no printcap file under solaris).

This is not only a problem on solaris 9 but also on earlier versions (I did my
tests under Solaris 7).

I'd also like to add that the Solaris print system is definitely SYSV as noted
earlier. There are some sort of BSD compatibility functions included, but they
do not work to well.
Comment 10 Gerald (Jerry) Carter (dead mail address) 2003-08-27 07:00:40 UTC
OK.  I'm convinced.  I'm working on a modified version of Tim's
patch.  I'm marking this as fixed, but won't actually have the 
code in for a few hours.
Comment 11 Gerald (Jerry) Carter (dead mail address) 2003-08-27 07:08:28 UTC
btw...the CP850.so issue is logged in
bug 150 and has been fixed in the SAMBA_3_0
cvs tree.  Any testing you could give it would
be appreciated.
Comment 12 Edgar Hoch 2003-08-27 07:59:31 UTC
I agree that defining SYSV for solaris in source/configure.in version
1.300.2.151 solves the problem with lpstat.

Many thanks for your work!

Comment 13 Gerald (Jerry) Carter (dead mail address) 2005-02-07 08:40:31 UTC
originally reported against 3.0.0beta2.  CLeaning out 
non-production release versions.
Comment 14 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:21:06 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 15 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:24:35 UTC
database cleanup