LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-26-2003, 06:41 PM   #1
christophe.dr
LQ Newbie
 
Registered: Aug 2003
Location: Paris
Distribution: mandrake 9.1
Posts: 26

Rep: Reputation: 15
Get_local_host: hostname '...' bad


I have a same problem on mandrake 8.2.
I made a standard installation. So my machine's name was "localhost" at the beginning.
Then i established a DHCP internet connexion where my machine name is, let's say, "dante".
But when i want to print something i have this message :

2003-11-16-19:09:21.699 Get_local_host: hostname 'dante' bad

Yet, the printer had always been alright before DHCP internet connexion with hostname 'dante'.

So i tried to change the /etc/hosts and all the things suggested in other threads but nothing succeeded.

Any ideas ? Any other files to edit ?

Thank you
Efraristo.
Danke.
Gracias.
Spassiba.
Merci.
Grazie.
 
Old 11-26-2003, 08:29 PM   #2
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 46
Can you post the contents of your /etc/hosts file here just for checking purposes?
 
Old 11-27-2003, 04:07 AM   #3
christophe.dr
LQ Newbie
 
Registered: Aug 2003
Location: Paris
Distribution: mandrake 9.1
Posts: 26

Original Poster
Rep: Reputation: 15
OK :

[--christophe@dante 10:03:45 ~] more /etc/hosts
127.0.0.1 localhost.localdomain localhost

I tried to modify it by adding a line like this :

80.67.5.69 dante

The lpd started without problems, but now the lpr command will never get to the printer.
Moreover, i don't know why, but the mandrake control center used to configure printer (printerdrake) can be launched but never works.
I am really confused and don't know what to do because it used to work very properly before.
 
Old 11-27-2003, 06:44 AM   #4
CatSC
Member
 
Registered: Oct 2003
Location: New Zealand, Wellington
Distribution: Red Hat 9, Gentoo 1.4, Vector 4.0
Posts: 74

Rep: Reputation: 15
On RedHat 9 my /etc/hosts looks like
"127.0.0.1 main localhost.localdomain localhost"
main is the name of my computer, and file has only one line(exept some commentaries)
 
Old 11-27-2003, 08:08 PM   #5
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 46
Quote:
Originally posted by christophe.dr
OK :

[--christophe@dante 10:03:45 ~] more /etc/hosts
127.0.0.1 localhost.localdomain localhost

I tried to modify it by adding a line like this :

80.67.5.69 dante

The lpd started without problems, but now the lpr command will never get to the printer.
Moreover, i don't know why, but the mandrake control center used to configure printer (printerdrake) can be launched but never works.
I am really confused and don't know what to do because it used to work very properly before.
Change your /etc/hosts file to this:
Code:
127.0.0.1               localhost.localdomain localhost
127.0.0.1               dante
And it'll work fine
 
Old 11-28-2003, 04:15 PM   #6
christophe.dr
LQ Newbie
 
Registered: Aug 2003
Location: Paris
Distribution: mandrake 9.1
Posts: 26

Original Poster
Rep: Reputation: 15
OK thanks for ur help guys but now i really think this linux won't want to print anything.
I modified the /etc/hosts as you suggested but nothing new.
Then i decided to remove and reinstall the printer settings with the printerdrake (printer tool for linux mandrake) which didn't work for an unknown reason.
So i decided to remove any file containing the former settings for my HP psc 2210 in the /etc/cups/ folder so that the printerdrake can restart from scratch.
I rebooted the machine.
Then i launched printerdrake which finally worked.
But no matter the cups or lp used, the test pages could not reach the printer with miscellanous error messages like :

Starting the HP OfficeJet Linux driver.
lpinfo: Unable to connect to server: Connection refused

or

lpstat: Unable to connect to server: Connection refused

or

lpr: unable to print file: server-error-service-unavailable

or

lpq: Unable to contact server!

or

Cannot read printers.conf file!

or

lpadmin: Unable to connect to server: Connection refused

or

lpoptions: Unknown printer or class!

or

Cannot read printers.conf file!

then

Printer: ImprimanteHPpsc2210@localhost
ImprimanteHPpsc2210@localhost.localdomain:

and then

Cannot read printers.conf file!

And after i typed in a shell :
kwrite /etc/hosts &

I clicked on the print icon and this is what i read on the shell :

QDir::readDirEntries: Cannot read the directory: /etc/lp/printers
QDir::readDirEntries: Cannot read the directory: /etc/lp/member
QDir::readDirEntries: Cannot read the directory: /usr/spool/interfaces/lp

Then i noticed that there were no lp directory in /etc/ and no spool directory in /usr/
This is getting weirder and weirder. Printing is not my part and i'd really appreciate any help.
Thanks.
 
Old 12-15-2003, 05:02 PM   #7
christophe.dr
LQ Newbie
 
Registered: Aug 2003
Location: Paris
Distribution: mandrake 9.1
Posts: 26

Original Poster
Rep: Reputation: 15
OK

Total reinstallation of cups and hpoj drivers.
Cups is dead and there is no way to take back to life.
But printing now works with /etc/hosts :

127.0.0.1 localhost.localdomain localhost
127.0.0.1 dante

Good.
Lots of job for a print.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lpd - Get_Local_Host : HostName 'LocalHost' bad chanmy8 Linux - General 4 03-02-2006 04:13 PM
LPD error - bad hostname RH7.3 KL2001 Linux - Newbie 10 09-05-2002 06:32 PM
Get_local_host error TriniMan Linux - Newbie 2 04-22-2002 04:09 PM
Can't print due to "bad hostname" vortech Linux - Newbie 1 12-17-2001 05:42 AM
Get_local_host MrGreg Linux - Networking 1 04-30-2001 10:44 AM


All times are GMT -5. The time now is 04:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration