hostname command vs. $HOSTNAME env. variable
Anyone have an explanation?
Why is it when I type "hostname (aNewName)" the $HOSTNAME environment variable doesn't change as well?
The change is only reflected if i type "uname -a"
I ask this because when linux boots up, ifup runs the function, need_hostname from the file, /etc/sysconfig/network-scripts/network-functions, and i believe it uses the shell command hostname to determine if it needs to set a variable called $NEEDHOSTNAME to 'yes' or to non-existent.
Then, the ifup script uses $NEEDHOSTNAME to determine if it should use the -H option when running dhcpcd.
The -H option is different from the -h option. -H sets my machine's $HOSTNAME and the value returned from typing hostname to one supplied by my ISP's dhcp server.
Anyway, my machine was previously able to boot up, obtain an IP from my ISP's dhcp server and not change my $HOSTNAME or the value returned from typing hostname. I think the value returned from typing "hostname" has something to do with it. It may have prevented ifup from using the -H option when executing dhcpcd.
I'd like to be able to boot and obtain an IP without changing my hostname. I know I can do this by commenting out the section in ifup that has the -H option when executing dhcpcd. But i'd like to avoid editing these original scripts.