Samba 4.6.5c Print Examples

Talk about commercial or opensource products that already exist for OpenVMS or may be available in the future
Post Reply

Topic author
mlzhh87
Member
Posts: 5
Joined: Fri Jul 19, 2019 10:29 am
Reputation: 0
Status: Offline

Samba 4.6.5c Print Examples

Post by mlzhh87 » Mon Aug 26, 2019 9:09 am

Does anyone have working examples of smb.conf and printcap files for Samba 4.6.5c printing? What is the location in VMS syntax for /etc/printcap? (SAMBA$ROOT:[etc] or something different?


paul.nunez
VSI Expert
Member
Posts: 5
Joined: Tue Aug 27, 2019 11:46 am
Reputation: 0
Status: Offline

Re: Samba 4.6.5c Print Examples

Post by paul.nunez » Tue Aug 27, 2019 12:11 pm

Hi,

Samba for OpenVMS doesn't use a printcap file. But you may want to specify:

printcap name = /nla0

to eliminate printcap errors from log files.

To use print shares with Samba for OpenVMS:

Create the following directory:

$ dir/create samba$root:[var.cache.printing]

If necessary, create the OpenVMS printer queue.

Add a print share to smb.conf. Note the 'path' (of the spool directory) must be in Unix syntax; for example, to define a print share for a printer queue named INKET:

[INKJET]
path = /samba$root/spool
printable = yes

If Samba is configured to allow Guest access, also specify:

guest ok = yes

If you want the share name to be different from the queue name, use a system logical name to map the two. For example, to use a share name of OFFICEPRINTER for a queue named INKJET:

$ define/system officeprinter inkjet ! Also add to sys$manager:sylogicals.com

Hope this helps,

Paul


Topic author
mlzhh87
Member
Posts: 5
Joined: Fri Jul 19, 2019 10:29 am
Reputation: 0
Status: Offline

Re: Samba 4.6.5c Print Examples

Post by mlzhh87 » Thu Aug 29, 2019 8:30 am

The instructions provided above work and do provide a basic printing capability, so thank you for that.

The current issue is ability to pass parameters to the print queue. It seems the basic print command from Samba is somehow overriding VMS print queue configurations. In my example a VMS print queue with page orientation set to landscape pointing to an HP device will print in portrait mode. In addition, the default form configured for the printer is not being applied.

Is there a means from the remote client to correct this situation (i.e. pass the file without any preformatting or printer resets involved)? Or must the VMS print queue be altered in some way?


paul.nunez
VSI Expert
Member
Posts: 5
Joined: Tue Aug 27, 2019 11:46 am
Reputation: 0
Status: Offline

Re: Samba 4.6.5c Print Examples

Post by paul.nunez » Thu Aug 29, 2019 9:16 am

Hi,

Samba has a 'print command' parameter that determines what qualifiers are applied to print jobs, but the default is just /PASSALL/DELETE. The parameter can be set during SAMBA$CONFIG or by editing SAMBA$ROOT:[LIB]GENERIC_SMB.CONF.

So it may have more to do with the client app. Can you select Landscape orientation with the client app?

Can you post the output from $ SHOW QUE/FULL/ALL with one of the Samba print jobs present in the queue?

FWIW, for client testing purposes, you can also print with SMBCLIENT:

$ SMBCLIENT \\localhost\<print-share-name> [--user=<username>]
smb: \> print <filename>
smb: \> quit
$


Topic author
mlzhh87
Member
Posts: 5
Joined: Fri Jul 19, 2019 10:29 am
Reputation: 0
Status: Offline

Re: Samba 4.6.5c Print Examples

Post by mlzhh87 » Thu Sep 05, 2019 3:38 pm

With the instructions provided in the last post, various Samba configurations were tested about passing PARAMETERS from the client (in this case a CentOS machine) to the VMS print host. This did achieve a printout, though not in the desired format. In all cases the desired impact of rotating the print to landscape orientation did not work. In addition, the /DELETE qualifier does not remove the intermediate file from the spool directory. Any assistance would be appreciated.


General Setup
+++++++++++++++++++++++++++++++++++++++++++++
A regular DECprint Supervisor (DCPS) print queue is created
with parameters establishing landscape orientation and code list
formatting. Output from the VMS side from a direct print operation has
the appropriate appearance.

SAMBA$ROOT:[000000]SPOOL.DIR protection is set to (RWE,RWE,RE,RWE)

SMB.CONF (shows DCPS print share)
[DP2015]
printable = yes
printer name = DP2015
path = /SAMBA$ROOT/SPOOL
comment = DP2015 DECprint Queue
guest ok = yes

++++++++++++++++++++++++++++++++++++
+ Test 1 - basic print to DCPS queue
++++++++++++++++++++++++++++++++++++
GENERIC_SMB.CONF (for DCPS print queue)
[global]
Server string = Samba %v on %h (OpenVMS)
name resolve order = lmhosts host bcast wins
print command = /DELETE/PASSALL
unix charset = UTF-8
vfs objects = varvfc
vms filemode = yes
map to guest = Bad User

[user@linuxhost ~]$ smbclient --user=<user>%<password> \\\\vmshost\\DP2015
Try "help" to get a list of possible commands.
smb: \> print test.txt
putting file test.txt as test.txt (14.0 kb/s) (average 14.0 kb/s)
smb: \>

This works, but retains default form or format (portrait,80),
and the spool file is not deleted in SAMBA$ROOT:[SPOOL] directory.

++++++++++++++++++++++++++++++++++++
+ Test 2 - add parameter to linux side to print to DCPS queue
+ - utilize GENERIC_SMB.CONF listed in Test 1
++++++++++++++++++++++++++++++++++++

smb: \> print/parameter=(page_orientation=landscape) test.txt
print/parameter=(page_orientation=landscape): command not found


++++++++++++++++++++++++++++++++++++
+ Test 3 - add parameter to generic_smb.conf print command to DCPS queue
++++++++++++++++++++++++++++++++++++
GENERIC_SMB.CONF (for DCPS print queue)
[global]
Server string = Samba %v on %h (OpenVMS)
name resolve order = lmhosts host bcast wins
print command = /DELETE/PASSALL/param=(page_orientation=landscape)
unix charset = UTF-8
vfs objects = varvfc
vms filemode = yes
map to guest = Bad User

smb: \> print test.txt
putting file test.txt as test.txt (14.0 kb/s) (average 14.0 kb/s)
smb: \>

This job page with an error message is output on the printer:
5-SEP-2019 15:00 %DCPS-E-KEYNOTREC, The keyword (PAGE_ORIENTATION=LANDSCAPE, DATA_TYPE=LIST) in the PARAMETERS qualifier was not recognized
5-SEP-2019 15:00 %DCPS-E-PARSYNERR, Syntax error in the /PARAMETERS qualifier at or near...

and this error appears in the SAMBA$ROOT:[VAR] log file:

[2019/09/05 15:00:23.614792, 0] SRC:[samba.source3.printing]printing.c;1:2927()
[Thu Sep 5 15:00:23 2019] [daemon] [err] (00000927) SAMBA$SMBD.EXE:[2019/09/05 15:00:23.614792, 0] SRC:[samba.source3.printing]pri
nting.c;1:2927()
PRINT_JOB_START: Failed in fchown() on spool file -1 pjob.fd to uid 0, gid 136 with error bad file number
[Thu Sep 5 15:00:23 2019] [daemon] [err] (00000927) SAMBA$SMBD.EXE: PRINT_JOB_START: Failed in fchown() on spool file -1 pjob.fd to uid 0, gid 136 with error bad file number


paul.nunez
VSI Expert
Member
Posts: 5
Joined: Tue Aug 27, 2019 11:46 am
Reputation: 0
Status: Offline

Re: Samba 4.6.5c Print Examples

Post by paul.nunez » Fri Sep 06, 2019 8:41 am

Regarding the print orientation, see what happens if you remove /PASSALL from the default Samba print options.

I'll look into the issue with auto deletion of the spool file and come back...

Paul


Topic author
mlzhh87
Member
Posts: 5
Joined: Fri Jul 19, 2019 10:29 am
Reputation: 0
Status: Offline

Re: Samba 4.6.5c Print Examples

Post by mlzhh87 » Sat Sep 07, 2019 7:34 am

Removal of the /PASSALL qualifier from the generic_smb.conf file made no difference. The print behavior listed above remains unchanged.


paul.nunez
VSI Expert
Member
Posts: 5
Joined: Tue Aug 27, 2019 11:46 am
Reputation: 0
Status: Offline

Re: Samba 4.6.5c Print Examples

Post by paul.nunez » Mon Sep 09, 2019 12:47 pm

Sorry, out of ideas regarding the print orientation...

The spool file should be deleted by the print symbiont after the file prints (not by Samba) since it is submitted with /DELETE.

You might print the same file using DCL PRINT and SMBCLIENT PRINT while the queue is paused (stop/queue) and then compare the SMBCLIENT print job with the DCL print job ($ show queue/full/all) and also look at contents of the spooled file to see what you might discern.

No idea if it'll matter, but could also try disabling spoolss with the following in smb.conf [global] section:

disable spoolss = yes

Post Reply