Re: Changing Hostname?
On Sat, Dec 21, 2013 at 3:03 PM, Bob Proulx <bob@proulx.com> wrote:
> Karl E. Jorgensen wrote:
>> In general, if you're changing host name, *ALL* references to the old
>> name should be tweaked.
>>
>> I would recommend:
>>
>> # sed --in-place=.bak -e 's/localhost-01/yournewname/g' $(grep -lr localhost-01 /etc)
>
> Good intention but that will corrupt many binary files. Beware! Here
> are some interesting binary ones that I would not edit in place from
> my system.
Well, I wouldn't run a command if I wasn't able to figure out at least
the basics of what it was going to do. But from other replies I
thought I wouldn't need anything too fancy to accomplish my goals
anyway.
And, based on other replies I edited 'hosts', 'hostname' and
'mailname'. Then rebooted. The DM (LightDM) still will not start. I
changed to another virtual terminal (by that I mean I pressed
<Ctrl><Alt><F1>), logged in a root and ran 'startx'. That worked OK.
To look for references to my old and new hostnames I ran the following
command: "grep -rH "HOSTNAME" in /etc and substituted both old and new
names for HOSTNAME. The 3 files I edited earlier still had the new
name. The only file with the old name is
exim4/update-exim4.conf.conf, and that doesn't look like it would
cause the problem. There are over 20 files with the word 'localhost'
in them, but not with '-01', so far my guess is that it is just used
to reference the host machine even when it is not the actual hostname.
So, maybe this is something specific to LightDM. I did check the
files in /etc/lightdm but there were no reference to "host', local or
otherwise. I started searching through my log files and thought this
might help. These are entries from the most recent boot up, which is
when LightDM would not load:
Auth.log -
Dec 21 16:36:38 (none) lightdm: pam_unix(lightdm-greeter:session):
session opened for user lightdm by (uid=0)
Dec 21 16:36:38 (none) lightdm: pam_unix(lightdm-greeter:session):
session closed for user lightdm
Dec 21 16:37:13 (none) login[3563]: pam_unix(login:auth): check pass;
user unknown
Dec 21 16:37:13 (none) login[3563]: pam_unix(login:auth):
authentication failure; logname=LOGIN uid=0 euid=0 tty=/dev/tty1
ruser= rhost=
Dec 21 16:37:15 (none) login[3563]: FAILED LOGIN (1) on '/dev/tty1'
FOR 'UNKNOWN', Authentication failure
Syslog -
Dec 21 16:36:38 (none) avahi-daemon[2285]: Server startup complete.
Host name is none.local. Local service cookie is 3853520009.
Then, still in syslog, I noticed two consecutive lines:
Dec 21 16:36:01 localhost-01 rsyslogd: [origin software="rsyslogd"
swVersion="7.4.4" x-pid="1899" x-info="http://www.rsyslog.com"]
exiting on signal 15.
Dec 21 16:36:36 (none) rsyslogd: [origin software="rsyslogd"
swVersion="7.4.4" x-pid="1922" x-info="http://www.rsyslog.com"] start
Based on the time stamp these happened during the most recent boot.
All the previous lines have 'localhost-01' then all the subsequent
lines have '(none)'.
One other thing - I rebooted again and tried the command 'service
lightdm restart'. It worked, sort of. I was able to log in, but my
desktop didn't start right. There were no panels, and when I tried to
run a Mate configuration app they wouldn't run. I switched back to
the virtual terminal I ran 'service lightdm restart' from, and there
were no error messages. Darn :-(.
Other suggestions?
Thanks
Jon
Reply to: