Operating System - Linux
1828581 Members
2256 Online
109982 Solutions
New Discussion

linux booing problem "setting hostname failed"

 
MahdiRa
Frequent Advisor

linux booing problem "setting hostname failed"

dear all
i have this problem inspite the server was running ok
at the booting procedure it hangs up with ""setting hostname failed" error message
pleas i need help
thx
15 REPLIES 15
Steven E. Protter
Exalted Contributor

Re: linux booing problem "setting hostname failed"

Shalom,

Check /etc/sysconfig/network

That is where the hostname is to be set.

You will need to boot off a Linux rescue cd or intervene at the console in the boot process.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alexander Chuzhoy
Honored Contributor

Re: linux booing problem "setting hostname failed"

Hi,
what operating system do you use?
Do you know if there was some change in configuration files?
Can you boot into runlevel 1?
MahdiRa
Frequent Advisor

Re: linux booing problem "setting hostname failed"

hi
i change nothing in the configuration files in the same time i have the HOSTNAME="server Name" at the network file at /etc/sysconfig
thx
Alexander Chuzhoy
Honored Contributor

Re: linux booing problem "setting hostname failed"

edit the file /etc/rc.sysinit
locate the line:
action $"Setting hostname ${HOSTNAME}: " hostname ${HOSTNAME}

right before it insert a line like this:
HOSTNAME="server name"


where server name is the name of you server.

Best regards.
MahdiRa
Frequent Advisor

Re: linux booing problem "setting hostname failed"

hi
this file is read only file and i did try to change it but am not succeeding
thx
MahdiRa
Frequent Advisor

Re: linux booing problem "setting hostname failed"

hi
i did all the options of moving renaming and changing of permition but am not succeeding to write to the file
thx
Alexander Chuzhoy
Honored Contributor

Re: linux booing problem "setting hostname failed"

you should boot with rescue cd (or the first installation cd) and type "linux rescue" at prompt.
This will boot you into rescue mode.Where you'll be able to edit this file.
MahdiRa
Frequent Advisor

Re: linux booing problem "setting hostname failed"

hi
i did all that and i could edit the file but i could not write
thx
Alexander Chuzhoy
Honored Contributor

Re: linux booing problem "setting hostname failed"

is it only this file read-only all the whole filesystem.
If it's file system do:
mount -o remount,rw /mountpoint
where mounpoint is where the partition mounted.
if it's only the file-how do you edit it?


the system should be mounted read/write when you boot into rescue environment...
MahdiRa
Frequent Advisor

Re: linux booing problem "setting hostname failed"

hi
it is only the file, am editing the file using vi editor but inspite i have -rwxr-xr-x
permition i couldnot do :wq it gives me that the file is read only, when i get a copy from the file i with another name i could edit and write to the file with the new name but i couldnot copy it back or over write the file rc.sysinit it is telling me that this operation is not permited "mv -f rc.sysinit.old rc.sysinit" to over write the file after making the modification on rc.sysinit.old
thx
Alexander Chuzhoy
Honored Contributor

Re: linux booing problem "setting hostname failed"

try to exit the file with
:wq!

after you did the changes of course.
MahdiRa
Frequent Advisor

Re: linux booing problem "setting hostname failed"

hi
i did befor but i face the same problem
thx
Alexander Chuzhoy
Honored Contributor

Re: linux booing problem "setting hostname failed"

what do you get if you do:
lsattr /etc/rc.sysinit
?
Stuart Browne
Honored Contributor

Re: linux booing problem "setting hostname failed"

Umm, why aren't you modifying '/etc/sysconfig/network' ?

Also, what is the exact line you have in '/etc/sysconfig/network' ? You've made sure it's a nice quoted string, with no spaces?

Also, the dumb question, when you're trying to modify these files, you are doing it as root aren't you?
One long-haired git at your service...
Steve_160
Frequent Advisor

Re: linux booing problem "setting hostname failed"

You might want to check ownership and permissions of the directories involved. Mine are:
/: drwxr-xr-x root root
/etc: drwxr-xr-x root root
/etc/sysconfig: drwxr-xr-x root root
/etc/sysconfig/network: -rw-r--r-- root root
/etc/rc.d/rc.sysinit: -rwxr-xr-x root root

Some init scripts won't read a file or directory with other permissions.

On my system (FC3) /etc/rc.sysinit is linked to /etc/rc.d/rc.sysinit. If yours is linked, you should check the permissions of the file in /etc/rc.d, not the link in /etc.

You also need root-level permissions to edit any of these files. If you're not in runlevel 1, you need to log in as root or use "sudo vi (filename)" to edit them.

#@%!! Windows!