Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

RE: ssh and hostname

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> RE: ssh and hostname Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
RE: ssh and hostname - Feb. 21, '05, 11:07:59 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
Actually the /etc/resolv.conf was not pupulated when I installed the SFU. I don't know why that happened but might that something to do with the fact that one machnie uses DHCP, and other machine has two network interfaces plugged in?

Are you sure that this /etc/resolv.conf is properly created every time the instalation is done? Maybe there's a bug somewhere?

Is the script you've mentioned available as a standalone script somewhere or is it a part od the postinstall script??

(in reply to markfunk)
Post #: 21
RE: ssh and hostname - Feb. 21, '05, 12:38:13 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> Are you sure that this /etc/resolv.conf is properly created every time the instalation is done? Maybe there's a bug somewhere?

The script is certainly run each time. It is possible that because you have the dual NIC's
that something was not found properly. Or perhaps there is a language quirk. If the infomation
below does not work then post what the output of your ipconfig /all gives.

> Is the script you've mentioned available as a standalone script somewhere or is it a part od the postinstall script??

You can edit and pull out the part(s) you want to use.

It is easy to see which section you want. It looks like this:
# resolv.conf
# If /etc/resolv.conf doesn't exist, we need to install one
# suitable for use by this local system
#
file=/etc/resolv.conf
if [ ! -f ${file} ]; then

    echo "*****************"
    date
    echo "postinstall: creating $file"


    # create /etc/resolv.conf
    touch ${file}

    # now set the content of the /etc/resolv.conf file
    #
    /bin/echo "# This file was automatically generated on " \
                $(date) >> ${file}
    /bin/echo "#" >> ${file}

    /bin/echo "search " \
        $(/usr/contrib/win32/bin/ipconfig /all \
            | /bin/grep "DNS Suffix"  \
            | /bin/sed 's/.*://')  \
        | /bin/sed 's/^M//g'            >> ${file}

    /bin/echo "nameserver" \
        $(/usr/contrib/win32/bin/ipconfig /all \
            | /bin/grep "DNS Servers"  \
            | /bin/sed 's/.*://')  \
        | /bin/sed 's/^M//g'            >> ${file}

    /bin/echo "lookup file bind" >> ${file}
fi

Though the "lookup" part (as discussed in another thread) is really no longer
part of the resolv.conf file anymore. You want to have the /etc/irs.conf
populated with the newer commands of:
# Hosts comes first from DNS, failing that, the local file
hosts   dns     continue
hosts   local

to have it do DNS first and then look at the /etc/hosts file.

(in reply to cortez_)
Post #: 22
RE: ssh and hostname - Feb. 22, '05, 4:56:48 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
It might ba a language issue see (Could Microsoft forget that he localized it's tools?):


C:\Documents and Settings\gprzybylski>ipconfig /all

Konfiguracja IP systemu Windows

        Nazwa hosta . . . . . . . . . . . : pcxxxzxybyxski
        Sufiks podstawowej domeny DNS . . . . . . :
        Typ węzła . . . . . . . . . . . . : Hybrydowy
        Routing IP włączony . . . . . . . : Nie
        Serwer WINS Proxy włączony. . . . : Nie
        Lista przeszukiwania sufiksów DNS : texxrxlne.cxmxrx

Karta Ethernet Połączenie lokalne:

        Sufiks DNS konkretnego połączenia : teatralne.comarch
        Opis . . . . . . . . . . . . . . :  NVIDIA nForce MCP Networking Adapter

        Adres fizyczny. . . . . . . . . . : 00-50-8D-54-C3-B3
        DHCP włączone . . . . . . . . . . : Tak
        Autokonfiguracja włączona . . . . : Tak
        Adres IP. . . . . . . . . . . . . : 10.132.18.93
        Maska podsieci. . . . . . . . . . : 255.255.255.192
        Brama domyślna. . . . . . . . . . : 10.132.18.65
        Serwer DHCP . . . . . . . . . . . : 10.10.1.5
        Serwery DNS . . . . . . . . . . . : 10.10.1.5
                                            10.132.0.150
        Podstawowy serwer WINS. . . . . . : 10.10.1.5
        Dzierżawa uzyskana. . . . . . . . : 22 lutego 2005 07:37:43
        Dzierżawa wygasa. . . . . . . . . : 22 lutego 2005 17:37:43

C:\Documents and Settings\gprzybylski>



So obviously it WONT populate the file properly as the greps in the script end up with nothing.
This language issue will probably exist in any non-english version of windows.

Any solution except from rewriting this script?


Adding the /tec/irs.conf doesn't change anything from my view.

Maybe there would be a possibility to make the bing libs lookup the hostname in a standard way in case the /etc/reslov.conf prooves faulty? like having a second level of a try?

(in reply to Rodney)
Post #: 23
RE: ssh and hostname - Feb. 22, '05, 10:55:11 AM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
> Any solution except from rewriting this script?

Not really. But a small set of modifications should work. Try this:
# resolv.conf
# If /etc/resolv.conf doesn't exist, we need to install one
# suitable for use by this local system. Changed from the
# original for localization.
#
file=/etc/resolv.conf
if [ ! -f ${file} ]; then

    echo "*****************"
    date
    echo "postinstall: creating $file"


    # create /etc/resolv.conf
    touch ${file}

    # now set the content of the /etc/resolv.conf file
    #
    /bin/echo "# This file was automatically generated on " \
                $(date) >> ${file}
    /bin/echo "#" >> ${file}

    /bin/echo "search " \
        $(/usr/contrib/win32/bin/ipconfig /all \
            | /bin/grep "sufiksów DNS"  \
            | /bin/sed 's/.*://')  \
        | /bin/sed 's/^M//g'            >> ${file}

    /bin/echo "nameserver" \
        $(/usr/contrib/win32/bin/ipconfig /all \
            | /bin/grep "Serwery DNS"  \
            | /bin/sed 's/.*://')  \
        | /bin/sed 's/^M//g'            >> ${file}

    /bin/echo "lookup file bind" >> ${file}
fi


> Adding the /tec/irs.conf doesn't change anything from my view.

Correct. Once /etc/resolv.conf has some useful information then it's used.

> Maybe there would be a possibility to make the bing libs lookup the hostname in
> a standard way in case the /etc/reslov.conf prooves faulty?

I did write code to do this a few months ago, but I did not merge it into BIND since
BIND is supposed to rely on /etc/resolv.conf. There was at the time also "no need" for
this API I wrote so it was filed away. The localization/language situation changes this of course.
I will try and dig it out. The first thing will be to make a small binary to fill
the /etc/resolv.conf file correctly. No timeline right now for this.

(in reply to cortez_)
Post #: 24
RE: ssh and hostname - Feb. 22, '05, 11:44:41 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
The script works fine, but this seems to ba a partial solution. I see two problems remain - each language version of windows will need to have it's own script (unless there is a binary that fills in the file regardless the language locale).
The other problem is that in case there is a DHCP and the resolv conf is generated it will have to be updated ieach time the new DHCP config arrives. By the way how is this issue solved on other unixes (I suppose there must be some solution in case they use DHCP to get config), the problem might be that if the Unix has an integrated DHCP client this client can fill in the resolv.conf and it's no problem. In Interix the DHCP is embedded in win32 environment and gives no signall that the config has changed... Am I right?

(in reply to Rodney)
Post #: 25
RE: ssh and hostname - Feb. 22, '05, 2:35:39 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
- a binary is the way to in the long run. Hopefully I can get some time this coming weekend.

- yes, the resolv.conf would need to be updated. On other unix systems the DHCP daemon does
this update as part of it's job.

- correct, Win32 DHCP doesn't alert other processes to any changes. This could be worked around
by having the (as yet unwritten) binary that fills resolv.conf as a daemon that periodically
polls if there has been a change. Yeah, I think that's the way to do it. Then it can be part
of the "rc" boot scripts for Interix.

(in reply to cortez_)
Post #: 26
RE: ssh and hostname - Feb. 23, '05, 2:39:35 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
That would work regardless of language version and would solve the DHCP problem in the most elegant way I think ;)

(in reply to Rodney)
Post #: 27
RE: ssh and hostname - Feb. 23, '05, 3:22:41 PM   
Rodney

 

Posts: 3729
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
Cross-reference the thread:
http://www.interopsystems.com/tools/forum/fb.asp?m=5073
This addresses the same question.

(in reply to cortez_)
Post #: 28
RE: ssh and hostname - Feb. 24, '05, 1:48:59 AM   
cortez_

 

Posts: 330
Joined: Mar. 27, '04,
From: Poland
Status: offline
Yes that is a partial solution but dos not resolve the language differences and needs to be applied manually.

(in reply to Rodney)
Post #: 29
Page:   <<   < prev  1 [2]
All Forums >> [SFU / Interix / SUA Technology] >> Tools Discussion Forum >> RE: ssh and hostname Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047