Change Solaris hostid


 
Thread Tools Search this Thread
Operating Systems Solaris Change Solaris hostid
# 8  
Old 12-18-2010
Now it's says :

./gcc: Invalid argument

I'm trying to run it from /usr/local/bin where i can find the gcc command.

Any other ideas ?

Please assist.
Thanks !
# 9  
Old 12-18-2010
Not sure where "Invalid argument" would come from, but...

Code:
# /usr/sfw/bin/gcc
gcc: no input files

Like you, I have:
Code:
# uname -a
SunOS sol10 5.10 Generic_141445-09 i86pc i386 i86pc

# 10  
Old 12-19-2010
Quote:
Originally Posted by DukeNuke2
the first link for "solaris gcc" on google was this:
Hint: How to install gcc on Solaris (easiest way possible - I think)
An 11 years old link is not the best advice.
# 11  
Old 12-19-2010
Quote:
Originally Posted by jlliagre
An 11 years old link is not the best advice.
provide a better link... this was the first which popped up in google and it wasn't reviewed.
criticize other people without better advice isn't helpfull at all...
This User Gave Thanks to DukeNuke2 For This Post:
# 12  
Old 12-19-2010
I've managed (i think) to install the gcc.
Now i'm trying to complie this piece of code (which were found in several forums for changing the host id):

Code:
#include <stdio.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
if(argc < 2)
{
fprintf(stderr,"Single argument: Target hostid\n",argv[0]);
return 1;
}
sethostid(
strtoul(argv[1],NULL,16) );
return 0;
}

but now i'm getting this kind of an error:

Code:
# gcc change_hostid.c -o change_hostid
Undefined first referenced
symbol in file
sethostid /var/tmp//ccEX9dSj.o
ld: fatal: Symbol referencing errors. No output written to change_hostid
collect2: ld returned 1 exit status

As i mentioned i've quite new with the Solaris and really i'm not a code guy.
Any idea what can be the problem for this simple code not to compile ?

BTW, i've managed to compile this short code successfully on a RedHat Linux server.

Please kindly advise.
# 13  
Old 12-19-2010
Quote:
Originally Posted by DukeNuke2
provide a better link... this was the first which popped up in google and it wasn't reviewed.
criticize other people without better advice isn't helpfull at all...
Agreed, sorry for the unhelpful/rude comment. I guess I was in bad mood been stuck by snow ...

Anyway, gcc is part of the default Solaris installation if you select one of these software groups: Developer, Entire, Entire plus OEM. These choices are certainly the most frequent ones, compared to End User, Core or Core with reduced network. The fact is a large majority of people complaining about a missing gcc on Solaris 10 are just missing to add /usr/sfw/bin to their PATH.
# 14  
Old 12-19-2010
And to sethostid:

Quote:
4.3 BSD has gethostname() and gethostid(), which return a symbolic name and a numeric value, respectively. There are related sethostname() and sethostid() functions that are used to set the values the other two functions return. The former functions are included in this specification, the latter are not.
The Open Group Base Specifications Issue 7


Quote:
4.2BSD. These functions were dropped in 4.4BSD. POSIX.1 does not define these functions, but ISO/IEC 9945-1:1990 mentions them in B.4.4.1. SVr4 includes gethostid but not sethostid.
sethostid - Linux Command - Unix Command
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Modify the Hostid in a Solaris 11 Global Zone running on VMWare

Hi Folks, I've been presented with an unexpected problem and I'm not sure if I can resolve it without some input from people. I have on this site 3 license servers running Solaris, one at; SunOS xxxxxx 5.8 Generic_117350-08 sun4u sparc SUNW,Ultra-5_10 One at; SunOS yyyyyy 5.7... (12 Replies)
Discussion started by: gull04
12 Replies

2. Red Hat

Change hostid to particullar string

Hello guys, currently I'm working on migration services from physical to virtual server (RHEL 6). One form applications is binded to hostid of old server. I put value of hostid from old server to the /etc/hostid on new server, but output of hostid command is giving nonsenses then. #... (0 Replies)
Discussion started by: brusell
0 Replies

3. Red Hat

How can I change hostid?

There is no /etc/hostid file. I know that there is no relationship between with MAC address and hostid. There are a lot of scripts on the net but how can I exactly do in my case. :rolleyes: (4 Replies)
Discussion started by: getrue
4 Replies

4. Solaris

Change hostID of Solaris 10 virtual/guest machine installed by Virtual Box 4.1.12 on Windows-XP host

Trying to set or modify the randomly set hostID of a Solaris 10 virtual/guest machine that I installed on a Windows-XP host machine (using Virtual Box 4.1.12). I was able to set/modify the hostname of the Solaris 10 virtual/guest machine during installation as well as via the Virtual Box... (4 Replies)
Discussion started by: Matt_VB
4 Replies

5. Solaris

How to change hostid saved in rpool?

Hi, We have a Sun M5000. I am now trying to boot the second system domain by using the boot disk (a mirrored boot disk actually) of the first domain (if succeed then no OS installation is needed for the second domain). I got the following errors: SPARC Enterprise M5000 Server, using Domain... (21 Replies)
Discussion started by: aixlover
21 Replies

6. Solaris

How to find HostID?

Dear All, I am facing a simple problem . I have a x6270 server attached to a M6000 chasis. The server is fresh i:e O/S is not installed in it. Now the customer is asking for the HostID of that server. I have tried every possible way but i am not able to find the HostID .I went through the... (4 Replies)
Discussion started by: sudhansu
4 Replies

7. Solaris

Change hostid for software install - license issue

Hi all. Solaris 9. After I change the hostid, how can I change it back without rebooting the machine? Thanks (2 Replies)
Discussion started by: jamie_collins
2 Replies

8. Solaris

Solaris 10 - HOSTID changed ???

Hello everybody, please , I need an urgent help. I reinstalled our server Sun X4150. What was changed: our two disks were changed to raid1 and I installed a never version of Solaris 10 (previously the version from 12/2009 was used, now a version from 03/2010). what I'm surprised, the... (3 Replies)
Discussion started by: freeangel
3 Replies

9. Solaris

procedure to change hostid of Sun server

Hello Everybody I would like to know that I have configure the OS & other application on the SunFire V440 server 1) If suppose no hostid base software install in that v440 server & if some problem comes in the motherboard of that server. If I remove the harddisk ( on which Solaris & other... (4 Replies)
Discussion started by: girish.batra
4 Replies

10. Solaris

How to change the HostID?--SunFire880

Hi, Guys I have to change the HostID for my SUNFire880 in lab. Can some body help me? and give the detail procedure? I don't think the command "mkp" can be used in SUNFire880 system. So please help!:cool: (2 Replies)
Discussion started by: surainbow
2 Replies
Login or Register to Ask a Question