个人工具

“UbuntuHelp:AppleTalk”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示2个用户的10个中间版本)
第2行: 第2行:
 
{{Languages|UbuntuHelp:AppleTalk}}
 
{{Languages|UbuntuHelp:AppleTalk}}
 
=== Introduction ===
 
=== Introduction ===
Some people using [http://en.wikipedia.org/wiki/Appletalk AppleTalk] printers or running Mac OS 9 still want to use [[UbuntuHelp:AppleTalk|AppleTalk]]. While the [[UbuntuHelp:AppleTalk|AppleTalk]] protocol suite is considered deprecated by Apple these days, the large number of legacy devices makes discarding the protocol unfeasible.
+
Some people using [http://en.wikipedia.org/wiki/Appletalk AppleTalk] printers or running Mac OS 9 still want to use AppleTalk. While the AppleTalk protocol suite is considered deprecated by Apple these days, the large number of legacy devices makes discarding the protocol unfeasible.
=== Installing [[UbuntuHelp:AppleTalk|AppleTalk]] Daemons ===
+
=== Installing AppleTalk Daemons ===
 
Installation is easy, just use apt-get to install [http://netatalk.sf.net Netatalk].
 
Installation is easy, just use apt-get to install [http://netatalk.sf.net Netatalk].
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get install netatalk
 
sudo apt-get install netatalk
 
</nowiki></pre>
 
</nowiki></pre>
=== [[UbuntuHelp:AppleTalk|AppleTalk]] Printing ===
+
And wait for netatalk to run. If you get an error similar to:
Getting your Ubuntu installation to print to an [[UbuntuHelp:AppleTalk|AppleTalk]] printer is relatively easy.
+
With netatalk installed, run <pre><nowiki>nbplkup</nowiki></pre> to find the names of the [[UbuntuHelp:AppleTalk|AppleTalk]] printers on your network. Make a note of these names.
+
Edit /etc/cups/printers.conf (as root) to add the printer. Here's an example for a printer named "Laser Writer Select 360". The "LW360" you see is the name you'd like to see in Ubuntu. It can be almost anything. The "Laser Writer Select 360" name you see in the URL must be exactly the name that nbplkup gave you for the printer.
+
 
<pre><nowiki>
 
<pre><nowiki>
# Printer configuration file for CUPS v1.1.23
+
Starting Netatalk services (this will take a while): nbp_rgstr: Förbindelsen dog ut (timeout)
# Written by cupsd on Mon 25 Apr 2005 02:02:39 PM PDT
+
Can't register laptop:Workstation@*
<Printer LW360>
+
invoke-rc.d: initscript netatalk, action "start" failed.
Info LW360
+
dpkg: fel vid hantering av netatalk (--configure):
Location Local zone
+
underprocess post-installation script gav felkod 1
DeviceURI pap://*/Laser Writer Select 360/LaserWriter
+
Fel uppstod vid hantering:
State Idle
+
netatalk
Accepting Yes
+
E: Sub-process /usr/bin/dpkg returned an error code (1)
JobSheets none none
+
QuotaPeriod 0
+
PageLimit 0
+
KLimit 0
+
</Printer>
+
 
</nowiki></pre>
 
</nowiki></pre>
This example assumes a single, default [[UbuntuHelp:AppleTalk|AppleTalk]] zone. If you have more than one zone, replace the * in the printer URL with the zone name.
+
Then try adding your AppleTalk connected interface (eth0, eth1, wlan0 etc) to the end of /etc/netatalk/atalkd.conf
The last step is to provide CUPS with a working PAP (the Netatalk printing methodology) backend. You may download one from [http://www.birdhouse.org/~mnep/pap here]. Once you have that file, cd to where that file is stored and:
+
<pre><nowiki>
 +
sudo gedit /etc/netatalk/atalkd.conf
 +
</nowiki></pre>
 +
by typing the appropriate interface at the end of the file and try starting the services:
 +
<pre><nowiki>
 +
sudo /etc/init.d/netatalk start
 +
</nowiki></pre>
 +
[http://archives.devshed.com/forums/networking-100/nbp-rgstr-connection-timed-out-startingnetatalk-on-fedora4t-1871279.html Reference]
 +
=== AppleTalk Printing ===
 +
Getting your Ubuntu installation to print to an AppleTalk printer is relatively easy.
 +
First, provide CUPS with a working PAP (the Netatalk printing methodology) backend. You may download one from [[UbuntuHelp:attachment:pap|here]]. Once you have that file, cd to where that file is stored and:
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo chmod +x pap
 
sudo chmod +x pap
第37行: 第39行:
 
Now all you need to do is restart CUPS. You can do this with
 
Now all you need to do is restart CUPS. You can do this with
 
<pre><nowiki>
 
<pre><nowiki>
sudo /etc/init.d/cupsys restart
+
sudo /etc/init.d/cups restart
 
</nowiki></pre>
 
</nowiki></pre>
This should provide you with [[UbuntuHelp:AppleTalk|AppleTalk]] printing. Open the Printing admin tool and ensure the printer appears there. Try sending a test page.
+
This should provide you with AppleTalk printing.  
If all is well, the only remaining step is to ensure Mozilla variant browsers will print. Mozilla uses a newer Ghostscript engine than most Apple printers will support. If an error page stating this comes from the printer when you try to print from Firefox/Mozilla, change the default print string in Firefox/Mozilla's printing prefs to
+
Now, set up the printer by opening the Printing admin tool (System>Administration>Printing) and clicking the "New" button.
 +
Before we go any farther we need to find the device URI, this can be accomplished by calling the backend without any arguments
 
<pre><nowiki>
 
<pre><nowiki>
gs -q -sDEVICE=pswrite -sOutputFile=- -dNOPAUSE -dBATCH -dMozConvertedToLevel2=true - | lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}"
+
/usr/lib/cups/backend/pap
 +
</nowiki></pre>
 +
This should return something like
 +
<pre><nowiki>
 +
network pap "HP LaserJet 4050 Series " "LaserWriter"
 +
</nowiki></pre>
 +
We want to take the device name and convert it into a pap address to use as the device URI. This is done by using the prefix "pap://" and converting any spaces into "%20". So in this case it would be
 +
<pre><nowiki>
 +
pap://HP%20LaserJet%204050%20Series%20
 
</nowiki></pre>
 
</nowiki></pre>
There you go. [[UbuntuHelp:AppleTalk|AppleTalk]] printing from Ubuntu! Enjoy.  
+
Note that in this case there was a space after the word "Series". This is important!
 +
Now, under Devices select "Other" and enter the device URI we just found.
 +
https://help.ubuntu.com/community/AppleTalk?action=AttachFile&do=get&target=Screenshot-New+Printer.png
 +
Click forward. Select your printer Make and Model and whatever options it may have. Once completed, print a test page to see if it works.
 +
There you go. AppleTalk printing from Ubuntu! Enjoy.  
 
=== Finding Your Printer URI ===
 
=== Finding Your Printer URI ===
You can find the correct URI for your printer by calling the backend without argument :
+
If you are having trouble finding the correct URI for your printer first call the backend without argument :
 
<pre><nowiki>
 
<pre><nowiki>
 
/usr/lib/cups/backend/pap
 
/usr/lib/cups/backend/pap
 
</nowiki></pre>
 
</nowiki></pre>
=== [[UbuntuHelp:AppleTalk|AppleTalk]] Names ===
+
if this doesn't work, try using nbplkup
An Ubuntu node will show up on the [[UbuntuHelp:AppleTalk|AppleTalk]] network as 'localhost'. This is due to 'hostname -s' returning localhost instead of using the real name (in /etc/init.d/netatalk).
+
<pre><nowiki>
 +
nbplkup
 +
</nowiki></pre>
 +
=== AppleTalk Names ===
 +
An Ubuntu node will show up on the AppleTalk network as 'localhost'. This is due to 'hostname -s' returning localhost instead of using the real name (in /etc/init.d/netatalk).
 
To remedy this, change the appropriate line in /etc/hosts and move the real hostname in front of 'localhost.localdomain', for example:
 
To remedy this, change the appropriate line in /etc/hosts and move the real hostname in front of 'localhost.localdomain', for example:
 
<pre><nowiki>
 
<pre><nowiki>
第58行: 第77行:
 
There's an open bug report documenting the problem with said order in /etc/hosts that is causing trouble with other programs, too.
 
There's an open bug report documenting the problem with said order in /etc/hosts that is causing trouble with other programs, too.
 
https://launchpad.net/distros/ubuntu/+source/netcfg/+bug/8980
 
https://launchpad.net/distros/ubuntu/+source/netcfg/+bug/8980
 +
=== Problems ===
 +
If nothing is coming out of your printer, debug the pap backend and view the log to see where problems may be coming from.
 +
<pre><nowiki>
 +
sudo gedit /usr/lib/cups/backend/pap
 +
</nowiki></pre>
 +
and uncomment out the lines that write out to the log file. (Delete the ##'s on lines that contain "echo")
 +
restart cups and try to print another file
 +
<pre><nowiki>
 +
sudo /etc/init.d/cups restart
 +
</nowiki></pre>
 +
Now check the logs for any problems
 +
<pre><nowiki>
 +
sudo cat /tmp/pap.log
 +
</nowiki></pre>
 +
a sample log file should look like this
 +
<pre><nowiki>
 +
+++++++++++++++++++++++++++++
 +
Sat Feb  7 16:34:05 EST 2009 new job in pap backend
 +
uri pap://HP%20LaserJet%204050%20Series%20
 +
new file    /var/tmp/22205.prn
 +
copies  1
 +
nbpname HP LaserJet 4050 Series
 +
%%[ status: busy; source: EIO 2 (ATALK) ]%%
 +
Normal exit
 +
</nowiki></pre>
 +
NOTE: if you see a line that says "NBP Lookup failed"
 +
<pre><nowiki>
 +
HP LaserJet 4050 Series :LaserWriter@*: NBP Lookup failed
 +
</nowiki></pre>
 +
You must restart netatalk and your printer should work again
 +
<pre><nowiki>
 +
sudo /etc/init.d/netatalk restart
 +
</nowiki></pre>
 +
=== Other Info ===
 +
The following may be needed if you have more than one AppleTalk Zone or are having general problems.
 +
With netatalk installed, run <code><nowiki>nbplkup</nowiki></code> to find the names of the AppleTalk printers on your network. Make a note of these names.
 +
Edit /etc/cups/printers.conf (as root) to add the printer. Here's an example for a printer named "Laser Writer Select 360". The "LW360" you see is the name you'd like to see in Ubuntu. It can be almost anything. The "Laser Writer Select 360" name you see in the URL must be exactly the name that nbplkup gave you for the printer.
 +
<pre><nowiki>
 +
# Printer configuration file for CUPS v1.1.23
 +
# Written by cupsd on Mon 25 Apr 2005 02:02:39 PM PDT
 +
<Printer LW360>
 +
Info LW360
 +
Location Local zone
 +
DeviceURI pap://Laser%20Writer%20Select%20360
 +
State Idle
 +
Accepting Yes
 +
JobSheets none none
 +
QuotaPeriod 0
 +
PageLimit 0
 +
KLimit 0
 +
</Printer>
 +
</nowiki></pre>
 +
This example assumes a single, default AppleTalk zone. If you have more than one zone, the printer URL should end with %40 followed by the zone name.
 +
<pre><nowiki>
 +
# Printer configuration file for CUPS v1.1.23
 +
# Written by cupsd on Mon 25 Apr 2005 02:02:39 PM PDT
 +
<Printer LW360>
 +
Info LW360
 +
Location Local zone
 +
DeviceURI pap://Laser%20Writer%20Select%20360%40zonefour
 +
State Idle
 +
Accepting Yes
 +
JobSheets none none
 +
QuotaPeriod 0
 +
PageLimit 0
 +
KLimit 0
 +
</Printer>
 +
</nowiki></pre>
 +
Mozilla uses a newer Ghostscript engine than most Apple printers will support. If an error page stating this comes from the printer when you try to print from Firefox/Mozilla, change the default print string in Firefox/Mozilla's printing prefs to
 +
<pre><nowiki>
 +
gs -q -sDEVICE=pswrite -sOutputFile=- -dNOPAUSE -dBATCH -dMozConvertedToLevel2=true - | lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}"
 +
</nowiki></pre>
 
----
 
----
 
[[category:CategoryNetworking]]
 
[[category:CategoryNetworking]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 17:30的最新版本

Introduction

Some people using AppleTalk printers or running Mac OS 9 still want to use AppleTalk. While the AppleTalk protocol suite is considered deprecated by Apple these days, the large number of legacy devices makes discarding the protocol unfeasible.

Installing AppleTalk Daemons

Installation is easy, just use apt-get to install Netatalk.

sudo apt-get install netatalk

And wait for netatalk to run. If you get an error similar to:

Starting Netatalk services (this will take a while): nbp_rgstr: Förbindelsen dog ut (timeout)
Can't register laptop:Workstation@*
invoke-rc.d: initscript netatalk, action "start" failed.
dpkg: fel vid hantering av netatalk (--configure):
 underprocess post-installation script gav felkod 1
Fel uppstod vid hantering:
 netatalk
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then try adding your AppleTalk connected interface (eth0, eth1, wlan0 etc) to the end of /etc/netatalk/atalkd.conf

sudo gedit /etc/netatalk/atalkd.conf

by typing the appropriate interface at the end of the file and try starting the services:

sudo /etc/init.d/netatalk start

Reference

AppleTalk Printing

Getting your Ubuntu installation to print to an AppleTalk printer is relatively easy. First, provide CUPS with a working PAP (the Netatalk printing methodology) backend. You may download one from here. Once you have that file, cd to where that file is stored and:

sudo chmod +x pap
sudo mv pap /usr/lib/cups/backend

Now all you need to do is restart CUPS. You can do this with

sudo /etc/init.d/cups restart

This should provide you with AppleTalk printing. Now, set up the printer by opening the Printing admin tool (System>Administration>Printing) and clicking the "New" button. Before we go any farther we need to find the device URI, this can be accomplished by calling the backend without any arguments

/usr/lib/cups/backend/pap

This should return something like

network pap "HP LaserJet 4050 Series " "LaserWriter"

We want to take the device name and convert it into a pap address to use as the device URI. This is done by using the prefix "pap://" and converting any spaces into "%20". So in this case it would be

pap://HP%20LaserJet%204050%20Series%20

Note that in this case there was a space after the word "Series". This is important! Now, under Devices select "Other" and enter the device URI we just found. AppleTalk?action=AttachFile&do=get&target=Screenshot-New+Printer.png Click forward. Select your printer Make and Model and whatever options it may have. Once completed, print a test page to see if it works. There you go. AppleTalk printing from Ubuntu! Enjoy.

Finding Your Printer URI

If you are having trouble finding the correct URI for your printer first call the backend without argument :

/usr/lib/cups/backend/pap

if this doesn't work, try using nbplkup

nbplkup

AppleTalk Names

An Ubuntu node will show up on the AppleTalk network as 'localhost'. This is due to 'hostname -s' returning localhost instead of using the real name (in /etc/init.d/netatalk). To remedy this, change the appropriate line in /etc/hosts and move the real hostname in front of 'localhost.localdomain', for example:

127.0.0.1  realname localhost.localdomain localhost

There's an open bug report documenting the problem with said order in /etc/hosts that is causing trouble with other programs, too. https://launchpad.net/distros/ubuntu/+source/netcfg/+bug/8980

Problems

If nothing is coming out of your printer, debug the pap backend and view the log to see where problems may be coming from.

sudo gedit /usr/lib/cups/backend/pap

and uncomment out the lines that write out to the log file. (Delete the ##'s on lines that contain "echo") restart cups and try to print another file

sudo /etc/init.d/cups restart

Now check the logs for any problems

sudo cat /tmp/pap.log

a sample log file should look like this

+++++++++++++++++++++++++++++
Sat Feb   7 16:34:05 EST 2009 new job in pap backend
uri pap://HP%20LaserJet%204050%20Series%20
new file    /var/tmp/22205.prn
copies  1
nbpname HP LaserJet 4050 Series
%%[ status: busy; source: EIO 2 (ATALK) ]%%
Normal exit

NOTE: if you see a line that says "NBP Lookup failed"

HP LaserJet 4050 Series :LaserWriter@*: NBP Lookup failed

You must restart netatalk and your printer should work again

sudo /etc/init.d/netatalk restart

Other Info

The following may be needed if you have more than one AppleTalk Zone or are having general problems. With netatalk installed, run nbplkup to find the names of the AppleTalk printers on your network. Make a note of these names. Edit /etc/cups/printers.conf (as root) to add the printer. Here's an example for a printer named "Laser Writer Select 360". The "LW360" you see is the name you'd like to see in Ubuntu. It can be almost anything. The "Laser Writer Select 360" name you see in the URL must be exactly the name that nbplkup gave you for the printer.

# Printer configuration file for CUPS v1.1.23
# Written by cupsd on Mon 25 Apr 2005 02:02:39 PM PDT
<Printer LW360>
Info LW360
Location Local zone
DeviceURI pap://Laser%20Writer%20Select%20360
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>

This example assumes a single, default AppleTalk zone. If you have more than one zone, the printer URL should end with %40 followed by the zone name.

# Printer configuration file for CUPS v1.1.23
# Written by cupsd on Mon 25 Apr 2005 02:02:39 PM PDT
<Printer LW360>
Info LW360
Location Local zone
DeviceURI pap://Laser%20Writer%20Select%20360%40zonefour
State Idle
Accepting Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
</Printer>

Mozilla uses a newer Ghostscript engine than most Apple printers will support. If an error page stating this comes from the printer when you try to print from Firefox/Mozilla, change the default print string in Firefox/Mozilla's printing prefs to

gs -q -sDEVICE=pswrite -sOutputFile=- -dNOPAUSE -dBATCH -dMozConvertedToLevel2=true - | lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}"