what to do after netconfig so all changes are visible
I'm changing the network configuration using netconfig on a Slackware 12 box.
If I check ifconfig and hostname the changes have not been made. Changes have however been made to /etc/hosts and /etc/rc.d/rc.inet1.conf. Which script/program do I need to run to make the changes take effect. I tried /etc/rc.d/rc.inet1 but that did not help. |
Did you restart the service yet?
Code:
/etc/rc.d/rc.inet1 restart |
Thanks for the reply
I did run it (as said in the first post) but as I did not see the MAIN section in that file I assumed that it could be run without arguments. It does not solve the whole issue as hostname and the login prompt still reflect the old names. But at least the IP info is there. |
To change your system's hostname issue "/bin/hostname <new-name>" - "man hostname" will help.
|
Thanks for the reply. I know that I can do so, but I already have entered the hostname using netconfig and hence expect it to be set straight away.
I've done a little analysis. I had a look at /sbin/netconfig (I was surprised to find that it's a script) and found that it sets the hostname/domainname in /etc/HOSTNAME once both are specified (a minor bug as a user can still cancel the configuration at a later stage and ends up with an unexpected incorrect hostname after the next reboot). Further at boottime, rc.M is responsible for setting the hostname. As running that file on a fully booted system more than likely has a lot of implications, I'm afraid (but not sure) that it can not be used. For me the solution is to run the hostname command from within the netconfig script to set the hostname; this way the hostname command without parameters will at least reflect the contents of the file /etc/HOSTNAME. For those who want to make that change (it's advised to make a backup of /sbin/netconfig first): As root, open the file /sbin/netconfig using your favorite editor and search for etc/HOSTNAME; you should find something like the code below (without the bold line). Next add the bold line and save the work Code:
... WimS |
Hi,
Quote:
|
As I did not run the netconfig at installation but afterwards. And the hostname file is indeed set, but not reflected when you run the hostname command without parameters.
|
Hi,
Quote:
Code:
excerpt from 'man hostname' As I stated it is your system to do as you wish. But!:study: |
Quote:
Running netconfig does not set the 'HOSTNAME', it only writes it to '/etc/HOSTNAME'. In my opinion that's something different. One will not notice this easily as there is a reboot involved after the install which will take care of it but if one runs netconfig at a later stage you will notice. I did read the man page and nowhere is an option to set the hostname permanently using the hostname command (which you seem to imply but maybe I misunderstood you). My problem is that a supplied script (netconfig) sets the hostname in /etc/HOSTNAME but when one runs the hostname command without parameters afterwards, it does not reflect the contents of that file. To get it right, one has to run the hostname command with the hostname specified during the netconfig (or reboot the system) in which case /etc/rc.d/rc.M will take care of it. My proposed solution is to modify netconfig so the hostname command will reflect the changes made to the file /etc/HOSTNAME during the netconfig. WimS |
Quote:
Wim Sturkenboom: My understanding of netconfig is that it's purpose is to setup up the configuration files, and that's what it does. It's not a bug that those changes aren't reflected immediately, that's just how it works. Rerunning /etc/rc.d/rc.inet1 should reflect those changes. |
All times are GMT -5. The time now is 04:29 PM. |