Puppy 5.20 PDF printing error (semi-solved -- strange bug)

Please post any bugs you have found
Post Reply
Message
Author
User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

Puppy 5.20 PDF printing error (semi-solved -- strange bug)

#1 Post by RetroTechGuy »

OK, I have installed Puppy 5.20 (previous version was 4.3.1), and seem to have everything working except the printer. I want to print to a PDF, and nothing seems to happen.

Opening up the control panel, I see:

Code: Select all

CUPS-PDF-7  	Jobs - CUPS 1.4.3  	root  	136k  	Unknown  	canceled at
Sat Jan 29 02:21:58 2011 
"/usr/lib/cups/filter/cpdftocps failed"
It's also curious that the date/timestamp is in the future (it's Jan 27 right now...)

I did several searches, but find no such errors for 5.20. Has anyone else seen this? Is there some simple adjustment I need to make?

Trying "pdf-writer" seems to produce no output, which is also strange:

Code: Select all

pdf_writer-8  	Jobs - CUPS 1.4.3  	root  	136k  	Unknown  	completed at
Sat Jan 29 02:21:52 2011
Last edited by RetroTechGuy on Sat 29 Jan 2011, 05:10, edited 1 time in total.
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#2 Post by rcrsn51 »

I just did a fresh frugal install of Lupu 520 and both PDF writers worked fine. What else have you installed?

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#3 Post by RetroTechGuy »

rcrsn51 wrote:I just did a fresh frugal install of Lupu 520 and both PDF writers worked fine. What else have you installed?
Firefox and the "mg" editor from Debian (I had this latter in 4.3.1). Oh, and I placed tclkit in /usr/local/bin/

Update: I wondered if some of the Firefox plugins were causing the problem, but the same non-print occurs when I try it from Geany.
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#4 Post by RetroTechGuy »

Update #2.

I booted booted to RAM (no lupusave), and before installing anything at all, tried printing both to CUPS-PDF and pdf_writer. Neither produced an output -- neither asked for a filename...

checking the job status shows pdf_writer as "completed", and CUPS-PDF as "failed".

Again, the dates on each job is shown about 48 hours in the future...

Update #3: OK, now this is REALLY, REALLY, REALLY SILLY... :evil: :evil: :evil:

What apparently broke the printer was changing the Hostname from "puppypc" to something else.

Now why would this name make any difference to the local PDF "printer"?

I guess that what remains to be seen is whether naming every computer on my network "puppypc" will cause issues...

Update#4: Booting up my previously fully configured and working lupusave (but with broken printer), I edited /etc/hostname and changed the name back to puppypc. Rebooted and reloaded this lupusave, and now the printer works...

Is the printer hard wired to look for that hostname, and thus a name change breaks the path?... What gives?
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#5 Post by jpeps »

makes sense, since they're just human readable addresses

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#6 Post by RetroTechGuy »

jpeps wrote:makes sense, since they're just human readable addresses
It doesn't make sense to me...

It would be like having a working Chevy truck, and as soon as I put a Ford sticker on it, the wheels all fall off... :lol:

I would not expect the machine (or more relevantly, the local machine) to care what you call the local machine, for tools in the local machine to work.

It seems that the PDF printers somehow only want to print on the machine "puppypc", and could not "print to PDF" on the exact same hardware, if that machine were called "jpeps"...
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#7 Post by rcrsn51 »

RetroTechGuy wrote:What apparently broke the printer was changing the Hostname from "puppypc" to something else.Now why would this name make any difference to the local PDF "printer"?Is the printer hard wired to look for that hostname, and thus a name change breaks the path?... What gives?
This issue came up a while ago. There is some code in the pdf-writer backend that is tied to the hostname. There are some work-arounds, but I've forgotten. I'll get back to you on this.

Why do you need to change the hostname?

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#8 Post by rcrsn51 »

Try this:

Go to /usr/lib/cups/backend and open the file pdf-writer. Line 69 is

Code: Select all

PUPPY_LINUX=`uname -a | grep -ic puppy`
Change "puppy" to the new hostname. Don't accidentally delete the final back-tick character.

I'm not sure why the code was written that way. It appears to have something to do with remote printing.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#9 Post by jpeps »

I think hostnames are connected to local IP addreses and other identifiers that provide maps to/for the local device.

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#10 Post by RetroTechGuy »

rcrsn51 wrote:Try this:

Go to /usr/lib/cups/backend and open the file pdf-writer. Line 69 is

Code: Select all

PUPPY_LINUX=`uname -a | grep -ic puppy`
Change "puppy" to the new hostname. Don't accidentally delete the final back-tick character.

I'm not sure why the code was written that way. It appears to have something to do with remote printing.
Thanks rcrsn51, I'll give it a try in a few days (not at the machine I was testing).

I'm currently working on migrating all my computers to Lupu 520 (and just LinNWin-ed my XP laptop, which is working fine!)
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
rerwin
Posts: 2017
Joined: Wed 24 Aug 2005, 22:50
Location: Maine, USA

#11 Post by rerwin »

Go to /usr/lib/cups/backend and open the file pdf-writer. Line 69 is
Code:
PUPPY_LINUX=`uname -a | grep -ic puppy`
Looking at that code, I see that PUPPY_LINUX is used only to identify running in a puppy environment, versus any other distro. A bit tricky, to me, with an unintended consequence. Here is another way to set it to indicate running in puppy:

Code: Select all

[ ! -f /etc/rc.d/PUPSTATE ]
PUPPY_LINUX=$?
I have not tested pdf-writer with this, but those who are already modifying the script might try it. (I tested in a console.) The variable is set to "1" for puppy, otherwise zero -- the later test is for zero.

Barry might have a "standard" way to identify that a distro is a puppy, but this is what came to mind right now.
Richard

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#12 Post by 01micko »

That looks ok to me rerwin.. but the question in my mind is.. why even have that test at all? It is obvious the script is heavily modded for Puppy.

Cheers
Puppy Linux Blog - contact me for access

Roy
Posts: 451
Joined: Wed 31 Dec 2008, 18:31

#13 Post by Roy »

If I remember correctly, the work-around or fix for creating (printing to file) a .pdf document with a changed host name was to add a blank file named .Xauthority to root (the period before the file name indicating that it is a hidden file).

-Roy

User avatar
wuwei
Posts: 800
Joined: Sat 15 Sep 2007, 11:59
Location: formerly de; now in tranquility

#14 Post by wuwei »

Yep

reporting the exact same problem on luci257.

Changed hostname and pdf printer didn't work anymore.

Thanks to rcrsn51, it's up and running again.

And....Roy's recommendation works, as well (after undoing rcrsn51's).

Thanks to both!

Why change hostname?
With 5 frugal Puppies on one machine, try Xmarks addon in Firefox. You won't be amused about the screw-ups there.

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#15 Post by charlie6 »

@rcrsn51!
in puppy 4.20 I edited /usr/lib/cups/backend/pdf-writer
Before editing I had regularly non-working-pdf-writer with an error message as mentionned by forum member Retro TechGuy.
rerwin wrote:Go to /usr/lib/cups/backend and open the file pdf-writer. Line 69 is
Code:
PUPPY_LINUX=`uname -a | grep -ic puppy`
I commented that line (Nr 78 in puppy-4.20-Xtreme) and added afterwards lines 79 and 80 as (copy + paste):

Code: Select all

[ ! -f /etc/rc.d/PUPSTATE ]
PUPPY_LINUX=$?
Now it seems it works.
Thanks to all !
Cheers, Charlie

User avatar
jon4t2
Posts: 11
Joined: Wed 24 Feb 2010, 13:08
Location: Kent, Ohio

#16 Post by jon4t2 »

Roy wrote:If I remember correctly, the work-around or fix for creating (printing to file) a .pdf document with a changed host name was to add a blank file named .Xauthority to root (the period before the file name indicating that it is a hidden file).

-Roy
Roy's fix works again!

Thanks!

User avatar
wuwei
Posts: 800
Joined: Sat 15 Sep 2007, 11:59
Location: formerly de; now in tranquility

#17 Post by wuwei »

Roy wrote:
If I remember correctly, the work-around or fix for creating (printing to file) a .pdf document with a changed host name was to add a blank file named .Xauthority to root (the period before the file name indicating that it is a hidden file).
Careful....!

At least in Wary 511 this fix causes gdmap to crash.

This instruction, however, works in Wary without affecting gdmap:

rcrsn51:
Go to /usr/lib/cups/backend and open the file pdf-writer. Line 69 is
Code:
PUPPY_LINUX=`uname -a | grep -ic puppy`

Change "puppy" to the new hostname. Don't accidentally delete the final back-tick character.

night_mare007
Posts: 30
Joined: Sun 07 Aug 2011, 17:13

#18 Post by night_mare007 »

rcrsn51 wrote:Try this:

Go to /usr/lib/cups/backend and open the file pdf-writer. Line 69 is

Code: Select all

PUPPY_LINUX=`uname -a | grep -ic puppy`
Change "puppy" to the new hostname. Don't accidentally delete the final back-tick character.

I'm not sure why the code was written that way. It appears to have something to do with remote printing.
On Puppy Lucid 5.25 ( Macpup 5.25 ) this solution solve the problem.
I even made It better...
dosn't just change your user name to your current but change it to the letter "1"... so no matter what's your puppy user name - it will work always.
so you need to have this line look like this:

Code: Select all

PUPPY_LINUX=`uname -a | grep -ic 1`
after the change, save, and restartX.

that's it.

theinfamousj
Posts: 88
Joined: Sun 03 Sep 2006, 12:54

THANK YOU!

#19 Post by theinfamousj »

rcrsn51 wrote:Try this:

Go to /usr/lib/cups/backend and open the file pdf-writer. Line 69 is

Code: Select all

PUPPY_LINUX=`uname -a | grep -ic puppy`
Change "puppy" to the new hostname. Don't accidentally delete the final back-tick character.

I'm not sure why the code was written that way. It appears to have something to do with remote printing.
I just wanted to let you know that you are a life-saving genius. I have never been able to get the CUPS PDF to work with any Puppy install I have ever done, and this is both the reason and the fix. Oh to be able to print to PDF without having to do a Print to File thing. Happiness. :)

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#20 Post by rcrsn51 »

Why did you change the host name in the first place?

Post Reply