It seems to me that after an hdinstall /etc/hosts always contains
127.0.0.1 localhost slitaz tazpanel
where slitaz is not always the real hostname.
would it be possible to make tazinst change /etc/hosts in the end of the install process or maybe in function users_settings(), something like sed -i 's/slitaz/realhostname/' /etc/hosts ?
thanks

rolling hd install /etc/hosts
(7 posts) (2 voices)-
Posted 12 years ago #
-
User must make changes to configuration template file before installation.
Install with tazpanel:
http://tazpanel:82/installer.cgi?page=install
Hostname
Set Hostname to:Your hostname here
Install from console:
tazinst new install.conf
vi install.conf
# Hostname
TGT_HOSTNAME="Your hostname here"
# tazinst install install.conf
Posted 12 years ago # -
again, thanks for your answer.
i did set hostname in install.cgi and it correctly transfers the value to tazinst:
... INSTFILE=/var/lib/tazinst.conf ... sed -i s/"^TGT_HOSTNAME=.*"/"TGT_HOSTNAME=\"$TGT_HOSTNAME\"/" $INSTFILE
but in the ending system in the hard disk i have the correct hostname and the wrong /etc/hosts.conf .
e.g. in my hd installed system hostname is slitvaio and i had "127.0.0.1 localhost slitaz tazpanel" in /etc/hosts , which i edited to "127.0.0.1 localhost slitvaio tazpanel".
this is the reason why i think that tazinst sets only the hostname and doesn't care about /etc/hosts.
not a big problem but if i have the wrong /etc/hosts and two different slitaz system in my network, e.g. slitvaio and slitaz, slitvaio trying to ping slitaz would end in slitvaio pinging itself.
messing with slitaz's script it's a little scaring to me :-) and devs probably would fix this trivially (if it's considered to be fixed), but if devs have no time and i'm allowed i could try to fix it myself and post here results.Posted 12 years ago # -
tazinst : http://hg.slitaz.org/slitaz-tools/file/066dd36cc2cc/installer/tazinst
Line 707 => echo $TGT_HOSTNAME > etc/hostname
We can use this instead:
sed -i s/slitaz/$TGT_HOSTNAME/ /etc/hosts /etc/hostname
Posted 12 years ago # -
for what i can understand it should work.
i would not use the prepending slash before every etc, original command does not use it and the presence of the command cd $TARGET_ROOT in the beginning of the function at line 691 makes me feel scared to break something.
if you can push it i can do some test when new version will be available.Posted 12 years ago # -
tested editing tazinst in a livecd and installing, it works.
Posted 12 years ago # -
thanks mojo
Posted 12 years ago #
Reply
You must log in to post.