Go Back   The macosxhints Forums > OS X Help Requests > System



Reply
 
Thread Tools Rate Thread Display Modes
Old 12-04-2006, 08:33 AM   #1
kaptagat
Major Leaguer
 
Join Date: Jul 2003
Posts: 329
Windows Queue printing?

Hello

We are moving over to centralized printing in the near future and printing will only be available via window print queues. OS X sees all our print queues but can't use them because of the well known kerberos ticket flaw in that the kerberos ticket is not accepted by smbspool.

As work around I am trying the "French Solution"

(http://homepage.mac.com/szumlins/scr...edPrinting.zip)

I am however having problems with this as well. Firstly I made a login hook to launch the daemon, user_kprintd, by :-

sudo defaults write com.apple.loginwindow LoginHook /Library/Scripts/user_ kprintd

Fatal result...Hanging blue screen after looging on. Where did I go wrong?

Secondly, the instructions then say "add like usual a printer using the ksmb printer".... Can some explain exactly how one adds a ksmb printer?

I really can't understand why Apple have not sorted this out yet.

Thanks
kaptagat is offline   Reply With Quote
Old 12-04-2006, 05:48 PM   #2
jimbobt
Triple-A Player
 
Join Date: Jan 2006
Posts: 111
Where did you obtain the "French Solution" - I tried this and experienced the same error as yourself, must be fake!

Apple Pro Services will be rakeing in the cash creating "scripts" for people who own there hardware!
__________________
---------------------------------
iMac G5 20" PowerPc 1.5GB RAM
MacBooK Pro 15" 1GB RAM
---------------------------------

Last edited by jimbobt; 12-04-2006 at 06:42 PM.
jimbobt is offline   Reply With Quote
Old 12-05-2006, 05:02 AM   #3
kaptagat
Major Leaguer
 
Join Date: Jul 2003
Posts: 329
Got it from here :-

http://listserv.cuny.edu/Scripts/wa....se&D=0&P=55236

Don't think it is a fake as someone in a previous thread seems to have got it to work.

http://forums.macosxhints.com/archiv...p/t-49585.html

I can't get the logon hook part to work, the system just hangs after looging on and I have to boot off an external to remove the file to disable the hook.

It also hung when I tried to use Mike Bombich's Login Window Manager to run it.
kaptagat is offline   Reply With Quote
Old 12-09-2006, 12:02 PM   #4
jimbobt
Triple-A Player
 
Join Date: Jan 2006
Posts: 111
I did the same as you. I went to login and the desktop hung. I had to power into single user mode and mount the drive. I then deleted the plist

sudo defaults delete com.apple.loginwindow

I setup LPR on the windows print server. This turns every windows print queue into a lpd queue. On the xserve i have added the print queues for student labs and pushed them out on a computer list level. Setting the papersize, default print queue and installin the driver locally, thanks to the tip in the other post!

In my environment where each user is charged for prints and approaches a printer with there own swipe card this works alot better than the smb printing option which we used before hand. Not only was the setup convoluted but now the user does not have to add the printer themselfs. Major biggie!
__________________
---------------------------------
iMac G5 20" PowerPc 1.5GB RAM
MacBooK Pro 15" 1GB RAM
---------------------------------

Last edited by jimbobt; 12-09-2006 at 12:13 PM.
jimbobt is offline   Reply With Quote
Old 01-05-2007, 04:41 PM   #5
FSJJeff
Prospect
 
Join Date: Jan 2007
Posts: 3
One step closer...

Hey guys, I'm trying to get this working as well and think I'm getting close to figuring it all out... First thing, if I run the user_kprintd manually and setup a printer using the ksmb:// url IT ALL WORKS beautifully!!!!

However, like you I'm getting a lock when I try to add the loginhook. I think I know why - this program continues to run, so if you just add the loginhook like you (and myself) were doing (ie: defaults write com.apple.loginwindow LoginHook /usr/bin/user_kprintd) it fires up the process, but then won't allow anything else to happen. Hypothetically one should be able to add a " &" at the end of the command to allow the program to move to the background and allow others to move forward.

I can test this by NOT adding the loginhook, logging into an AD user account, to into Terminal and starting the process with:

/usr/bin/user_kprintd

I can see that the process is started and running by the Terminal messages...

user_kprintd=525, user=428050552, g_spool_dir=/var/spool/samba/clientspool

If I then try and type another command, say ls, nothing happens. Additionally if I print I can see the messages showing up in the terminal window. If I hit Ctrl-C it kills the process.

On the other hand, if I start the process up with:

/usr/bin/user_kprintd &

Things work much better - I can type in other commands, and Ctrl-C doesn't kill the process.

Unfortunately I seem unable to get a loginhook to do this... I tried simply entering "sudo defaults write com.apple.loginwindow LoginHook /usr/bin/user_kprintd &" but it simply threw the defaults command into the background, rather than adding the & at the end of the LoginHook entry... So I went into Mike Bombich's LoginWindowManager and type that entry, but when I try to test it it simply gives me an applescript error...

I've also tried creating a script that simply has that command, making it executable, and calling it from the LoginHook, but that doesn't seem to work either.

Basically, the goodies work, but we need a way of calling it properly from the LoginHook.... Any other ideas out there?

Jeff
FSJJeff is offline   Reply With Quote
Old 01-08-2007, 05:28 PM   #6
FSJJeff
Prospect
 
Join Date: Jan 2007
Posts: 3
I got it working !!!!!

No response so far to my last posting, but I got things working anyway, so will post my solution...

Building on what I figured out last week (about the loginhook stopping the login procedure, and my inability to put the & command into the loginwindow plist) I did a bunch of sniffing around and put together a system that works.

Here's what I did:

1) In the loginwindow.plist, instead of calling user_kprintd directly I called a kPrintD, which is a shell script I created to fire up the process...

2) Because a loginscript executes as root, I had to modify the command so that the user_kprintd process would execute as the logging in user, easy enough to do since loginwindow provides $1 as a variable referring to the user logging in.

The kPrintD script is as follows (nice and simple):

-------------------
#! /bin/sh
su $1 -c /usr/bin/user_kprintd &
-------------------

That's it. I made sure the kprint script had execute priviledges, saved it into /usr/bin (with the user_kprintd app), and then added the loginscript with the command:

sudo defaults write com.apple.loginwindow LoginHook /usr/bin/kPrintD

Now when I log in it fires up the user_kprintd process, which intercepts signals to the printer (if the printer is setup correctly that is), pulls the kerberos info and sends the print jobs beautifully. Yippee.
FSJJeff is offline   Reply With Quote
Old 01-09-2007, 04:09 AM   #7
kaptagat
Major Leaguer
 
Join Date: Jul 2003
Posts: 329
Well Done FSJJeff! Hope someone from Apple sees this and incorporates it as an update. I myself had decided to go with installing Unix Print services on the Windows servers and then using LPR (LPD) printers on the clients which also sends the usernames to the printer, but I shall give your solution a try.
kaptagat is offline   Reply With Quote
Old 01-10-2007, 09:09 AM   #8
kaptagat
Major Leaguer
 
Join Date: Jul 2003
Posts: 329
OK I have tried it but it doesn't seem to work. However I am not sure if I am adding the the ksmb printer correctly.

I added it using the printer setup utility, and then under advanced, selected the "Windows Printer via Samba with Kerberos support v1.0". Should I have used lpadmin instead?

Thanks
kaptagat is offline   Reply With Quote
Old 01-16-2007, 12:33 PM   #9
FSJJeff
Prospect
 
Join Date: Jan 2007
Posts: 3
Some ideas to try, and additional notes...

kaptagat,

For setting up the ksmb thing, i went into Printer Setup Util, option clicked the Add button, went to Advanced and selected the "Windows Printer via Samba with Kerberos support v1.0" like you did... Then for the URL I entered ksmb://servername/queuename

A few things to double check:

1) You need to be logging in as an AD user, and getting a valid Kerberos ticket.... You can monitor your tickets with a nice GUI with /System/Library/CoreServices/Kerberos

2) Use Activity Monitory to ensure that the user_kprintd process is running as the logged in user. If it's running as root or any other user that won't work.

3) One of the things I did for troubleshooting is to skip all the loginhooks, log on as an AD user, go to terminal and open the user_kprintd process - it should start showing it's own messages on the terminal. Now setup the printer, open the Kerberos app and try to print - you should see messages from user_kprintd messages in the terminal window, and you should suddenly get a Kerberos ticket for your Windows print service. This at least lets you know if everything is working before you do all the loginscript stuff.

Also, I have one thing to add to my instructions... As is they all work, but for some reason the process doesn't quit, and gets started anew at every login... So if I login as user1 it starts up an instance running as user1. If I logout and login as user2 it starts up a 2nd instance running as user2... If I then logout and login as user1 again, it starts a 3rd instance as user1... I now have three instances running, 2 as user1 and 1 as user2.

To fix this I created a logout script that basicially says "killall user_kprintd" so that it always kills that process on logout.

Hope that helps
FSJJeff is offline   Reply With Quote
Old 11-01-2007, 12:48 PM   #10
kaptagat
Major Leaguer
 
Join Date: Jul 2003
Posts: 329
Anybody tried this yet using Leopard? When I click on the windows printing icon, nothing happens. Doesn't seem to be a way to manually enter the path to a queue.
kaptagat is offline   Reply With Quote
Old 02-19-2008, 05:50 PM   #11
adodo
Prospect
 
Join Date: Feb 2008
Posts: 3
Yes, any updates on whether this approach can work with Leopard? I, too, am not finding an advanced button, or somewhere to type the ksmb://devicename in.
adodo is offline   Reply With Quote
Old 08-04-2011, 09:22 AM   #12
lacrossebjorne
Prospect
 
Join Date: Nov 2009
Posts: 3
Bump

Looking for a solution that works under Snow Leopard. Tried this out, but no luck.
Have win2008r2 as print server and AD. Have the single sign-on working for the shares.
lacrossebjorne is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 07:38 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.