Unix Technical Forum

Perplexing Printing Problem lprng

This is a discussion on Perplexing Printing Problem lprng within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I have my printer fuction set up to use lpr etc.... I run wp5.1 in dosemu for business letters ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-20-2008, 09:05 AM
No_One
 
Posts: n/a
Default Perplexing Printing Problem lprng


I have my printer fuction set up to use lpr etc....

I run wp5.1 in dosemu for business letters and have wp51 print the
contents to a postscript file called output.ps. I simply switch to another
window and run the command cat output > /dev/lp0

I ran into a problem the other day, instead of running the correct command I
ran cat output /dev/lp0 no redirect. Natually nothing printed, however, now
nothing else will print as well, I get an error message Device or resource
busy. I can't get the resource un-busy.

I've deleted lock file, temp file, spooled files, I've tired lpc to kill the
job, I've ps aux'd looking for a pid to kill, I started and stopped rc.lprng,

I can't get rid of the error message, and nothing else will print.

Naturally a reboot solves the problem but that can't be the solution.

Any ideas

ken

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2008, 09:05 AM
Matt Payton
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng

No_One wrote:
> I have my printer fuction set up to use lpr etc....
>
> I run wp5.1 in dosemu for business letters and have wp51 print the
> contents to a postscript file called output.ps. I simply switch to another
> window and run the command cat output > /dev/lp0
>
> I ran into a problem the other day, instead of running the correct command I
> ran cat output /dev/lp0 no redirect. Natually nothing printed, however, now
> nothing else will print as well, I get an error message Device or resource
> busy. I can't get the resource un-busy.
>
> I've deleted lock file, temp file, spooled files, I've tired lpc to kill the
> job, I've ps aux'd looking for a pid to kill, I started and stopped rc.lprng,
>
> I can't get rid of the error message, and nothing else will print.
>
> Naturally a reboot solves the problem but that can't be the solution.
>
> Any ideas


Have you ran checkpc ? That can fix many issues.
If you have parallel support as a module, did you try
unloading/reloading it ? Have you checked perms on /dev/lp0 ?

I would try running checkpc first, maybe with -V for more verbose
output. If that finds errors, fix them...Usually checkpc -f will do it.
If it doesn't find anything I'd start looking at the device ( lp0 ).

--
- Matt -
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-20-2008, 09:05 AM
Douglas Mayne
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng

On Sun, 05 Jun 2005 04:36:58 +0000, No_One wrote:

>
> I have my printer fuction set up to use lpr etc....
>
> I run wp5.1 in dosemu for business letters and have wp51 print the
> contents to a postscript file called output.ps. I simply switch to another
> window and run the command cat output > /dev/lp0
>
> I ran into a problem the other day, instead of running the correct command I
> ran cat output /dev/lp0 no redirect. Natually nothing printed, however, now
> nothing else will print as well, I get an error message Device or resource
> busy. I can't get the resource un-busy.
>
> I've deleted lock file, temp file, spooled files, I've tired lpc to kill the
> job, I've ps aux'd looking for a pid to kill, I started and stopped rc.lprng,
>
> I can't get rid of the error message, and nothing else will print.
>
> Naturally a reboot solves the problem but that can't be the solution.
>
> Any ideas
>
> ken
>

Check the devica and permissions on /dev/lp0 (with ls -la):
crw-rw---- 1 root lp 6, 0 1995-04-27 17:17 /dev/lp0

If it doesn't look like this, then repair the device as follows (as root
user):

rm /dev/lp0
mknod /dev/lp0 c 6 0
chown root.lp /dev/lp0
chmod ug+rw,o-r /dev/lp0


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-20-2008, 09:05 AM
Dennis Griffin
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng

On Sun, 05 Jun 2005 12:05:01 +0000, Matt Payton wrote:

> No_One wrote:
>> I have my printer fuction set up to use lpr etc....
>>
>> I run wp5.1 in dosemu for business letters and have wp51 print the
>> contents to a postscript file called output.ps. I simply switch to another
>> window and run the command cat output > /dev/lp0
>>
>> I ran into a problem the other day, instead of running the correct command I
>> ran cat output /dev/lp0 no redirect. Natually nothing printed, however, now
>> nothing else will print as well, I get an error message Device or resource
>> busy. I can't get the resource un-busy.
>>
>> I've deleted lock file, temp file, spooled files, I've tired lpc to kill the
>> job, I've ps aux'd looking for a pid to kill, I started and stopped rc.lprng,
>>
>> I can't get rid of the error message, and nothing else will print.
>>
>> Naturally a reboot solves the problem but that can't be the solution.
>>
>> Any ideas

Do a 'chmod 755 rc.lprng' in /etc/rc.d/ and your problem should be solved.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-20-2008, 09:05 AM
No_One
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng -to all


First of all, thanks for all the ideas and suggestion.

Secondly, nothing worked.

I even found a suggestion on google to use modprobe -r lp, however, all I
can is the same error message, device busy etc.

So I'll run another google search and check the linux doc project for any
ideas...again to all, thanks for the help.

ken


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-20-2008, 09:05 AM
Trygve Selmer
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng

No_One wrote:
>
> I ran into a problem the other day, instead of running the correct command I
> ran cat output /dev/lp0 no redirect. Natually nothing printed, however, now
> nothing else will print as well, I get an error message Device or resource
> busy. I can't get the resource un-busy.


You have overwritten your device file, ie. /dev/lp0 is now an ordinary
text file. Fix it as explained by Douglas (do this as root):

# rm /dev/lp0
# mknod /dev/lp0 c 6 0
# chown root.lp /dev/lp0
# chmod 0660 /dev/lp0

> I've deleted lock file, temp file, spooled files, I've tired lpc to kill the
> job, I've ps aux'd looking for a pid to kill, I started and stopped rc.lprng,


Make sure you have the spool file /var/spool/lpd with correct
permissions. If not, fix it by reinstalling the lprng package.

Then try "cat output.txt > /dev/lp0", hopefully it will work :-)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-20-2008, 09:05 AM
Joost Kremers
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng

Trygve Selmer wrote:
> No_One wrote:
>>
>> I ran into a problem the other day, instead of running the correct command I
>> ran cat output /dev/lp0 no redirect. Natually nothing printed, however, now
>> nothing else will print as well, I get an error message Device or resource
>> busy. I can't get the resource un-busy.

>
> You have overwritten your device file, ie. /dev/lp0 is now an ordinary
> text file. Fix it as explained by Douglas (do this as root):


doubtful. cat reads *all* the files you give it on the command line,
concatenates their contents, and writes the result to standard output. IOW
the second argument to cat is *not* taken as the file to write something
to, it is taken as a file to read from.

all i can guess is that when cat tried to read from the device, it somehow
got into a state which won't allow it to be used anymore. (that guess is as
wild as this description is vague, however. i really don't know about these
things.) if so, unloading/reloading the lp kernel module may fix it, or
otherwise a reboot. i'm sure there's a cleaner way as well, but i have no
idea what it might be.

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-20-2008, 09:05 AM
Matt Payton
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng

Trygve Selmer wrote:

> Make sure you have the spool file /var/spool/lpd with correct
> permissions. If not, fix it by reinstalling the lprng package.


Reinstalling should never be required to fix permissions when using
LPRng...checkpc ( included with LPRng ) will do this for you.
From the man page :
"Checkpc is used to check for the existence and correct permissions
of entries in the printcap database. It is useful when installing a
new printcap database and clean*ing up existing printer spoolers..."


--
- Matt -
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-20-2008, 09:05 AM
William Hamblen
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng

On 2005-06-05, No_One <no_one@no_where.com> wrote:

> I ran into a problem the other day, instead of running the correct command I
> ran cat output /dev/lp0 no redirect. Natually nothing printed, however, now
> nothing else will print as well, I get an error message Device or resource
> busy. I can't get the resource un-busy.


"cat output /dev/lp0" when you are an ordinary user gives you the error
message "cat: /dev/lp0: Permission denied", unless you were naughty and
changed the permissions on /dev/lp0 or are logged in as root. If you
did, cat will try to cat the output from /dev/lp0 until the cows come
home, your shell prompt won't come back (unless you &'ed the command)
and /dev/lp0 will be so busy with cat you can't print. There's more
than one way to kill cat, but once you do that you can print. Why are
you catting the output file directly to the printer device? When your
printing is properly set up you can print a postscript file and get the
output you want using the lpr command. All this assumes you are working
at the linux prompt when you are printing. DOS doesn't come with a cat
command that I know about and I don't know what the consequences of
fooling with devices under DOSEMU are.

If you are pulling our legs you are doing a good job.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-20-2008, 09:05 AM
No_One
 
Posts: n/a
Default Re: Perplexing Printing Problem lprng

On 2005-06-06, William Hamblen <wrhamblen@comcast.net> wrote:
> On 2005-06-05, No_One <no_one@no_where.com> wrote:
>
>
> "cat output /dev/lp0" when you are an ordinary user gives you the error
> message "cat: /dev/lp0: Permission denied", unless you were naughty and
> changed the permissions on /dev/lp0 or are logged in as root. If you


Guilty

> did, cat will try to cat the output from /dev/lp0 until the cows come
> home, your shell prompt won't come back (unless you &'ed the command)
> and /dev/lp0 will be so busy with cat you can't print.


Yep

>There's more
> than one way to kill cat, but once you do that you can print.


Nope, can't do it. Killed cat, got rid of the "device busy" message but
still can't print.

Why are
> you catting the output file directly to the printer device?


Actually, setting up wp51 to print to lp0 was troublesome and erratic, maybe
a problem with dosemu. At any rate, I set up wp51 to use a wp51 ps driver
and set the printer output to file ( which you can do in wp51) instead of to
/dev/lp0, that's why cat a.ps > /dev/lp0, not elegant but works if you don't
forget the redirect.

>
> If you are pulling our legs you are doing a good job.


Not unless your legs are shaved, you're wearing nylons and william is
short for Julia.


ken
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:31 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com