hostname cannot execute


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers hostname cannot execute
# 1  
Old 08-17-2009
hostname cannot execute

I'm receiving the following message when executing hostname:

/usr/bin/hostname: /bin/uname: cannot execute

This error is usuallly a permissions issue but both /usr/bin/hostname and /bin/uname are set with the correct permissions as shown:

-r-xr-xr-x 1 root bin 561 Jan 21 2005 /usr/bin/hostname
lrwxrwxrwx 1 root root 16 Jun 20 2008 /bin/uname -> ../../sbin/uname

Not sure about the sysbolic link setting for /bin/uname or if I need additional settings for root. What else do I need to execute this command.

Thanks,

Tom
# 2  
Old 08-17-2009
what about /sbin/uname permission?
# 3  
Old 08-17-2009
I wanted to check it but I'm not sure how to interpret the .. in ../../sbin/uname.

Thanks,
Tom
# 4  
Old 08-17-2009
re; hostname cannot execute

Interesting that you don't have a dedicated "hostname" binary, which version of Linux are you running?

The ../../sbin/uname looks "odd".

Try "file /bin/hostname" and file "/bin/uname", this should confirm any links in play are actually valid.

Can you confirm whether SElinux is enabled and whether you are doing this from a user account or as "root" ?

Can you confirm the final destination for "uname" [/sbin/uname?] and can you run this directly?
# 5  
Old 08-18-2009
hostname is now running after the server was rebooted. Not sure what the original problem was.

Thanks for your help,
Tom
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Hostname -f hostname: Unknown host

deleted (0 Replies)
Discussion started by: hce
0 Replies

2. Solaris

2 hostname in one server

Hi, We have one server originally named <SERVERA>. Now we plan to put another network card & add another hostname <SERVERB>. Later, we will need to change hostname from <SERVERB> to <SERVERC>. I know that we need to plumb a new ip & add to /etc/hosts & /etc/hostname.<interface>. Is there... (2 Replies)
Discussion started by: beginningDBA
2 Replies

3. Emergency UNIX and Linux Support

HP UX - ILO Console hostname different than Machine Hostname...

Hi All, So we added a new HP-UX 11.31 machine. Copied OS via Ignite-UX (DVD)over from this machine called machine_a. It was supposed to be named machine_c. And it is when you log in...however when I'm in the ILO console before logging in, it says: It should say: What gives? And how do... (4 Replies)
Discussion started by: zixzix01
4 Replies

4. AIX

Ping by hostname

Hello everyone I have a partition with a problem with ping. If I do a ping by ip for example ping 1.1.1.1 I got no problem but If I ping by hostname for example ping partition1 take almost a minute to respond me. I have Aix 5.3 and I have another 19 partitions with no problem. The only... (5 Replies)
Discussion started by: lo-lp-kl
5 Replies

5. UNIX for Dummies Questions & Answers

Printing hostname

Hi, I am using hostname environment variable in my shell script to print the host name but it's printing nothing.Can you please help me on this. Please find the part of the code pasted here: llist= llist=$(ps -ef | grep -v grep | grep -c "$1") echo "Hostname is ${hostname}" (7 Replies)
Discussion started by: gbiswal
7 Replies

6. Shell Programming and Scripting

script execute or no execute

o hola.. Tengo un script que se ejecuta bajo una tarea del CronJOb del unix, tengo la version 11 de unix, mi script tiene un ciclo que lee unos archivos .txt luego cada uno de esos archivos debe pasar por un procedimiento almacenado el cual lo tengo almacenado en mi base de datos oracle 10g,... (4 Replies)
Discussion started by: Kespinoza97
4 Replies

7. UNIX for Dummies Questions & Answers

Solaris - unknown hostname - how can I change hostname?

Hello, I am new to Solaris. I am using stand alone Solaris 10.0 for test/study purpose and connecting to internet via an ADSL modem which has DHCP server. My Solaris is working on VMWare within winXP. My WinXP and Solaris connects to internet by the same ADSL modem via its DHCP at the same... (1 Reply)
Discussion started by: XNOR
1 Replies

8. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies

9. IP Networking

looking up hostname

Using Solaris 8 (or WINXP). I am trying to look up a specific DNS hostname, but I don't know which DNS server houses that entry. How can I find the hostname? nslookup gives me the following: C:\>nslookup hostname Server: dnsserver Address: x.x.x.x *** dnsserver can't find hostname:... (2 Replies)
Discussion started by: dangral
2 Replies

10. UNIX for Dummies Questions & Answers

Hostname

Hello, I am installing redhat linux 6.2 on an intel based system. Whether i want to know any naming conventions should i follow. ie Any convention to follow to name a linux machine(To give hostname). Simillarly for domain name also. Please suggest in this regard (1 Reply)
Discussion started by: bache_gowda
1 Replies
Login or Register to Ask a Question