# sendmail - slow startup

## Robert S

When I boot my gentoo system it hangs for a long time on "starting sendmail".  I've just installed gentoo according to the docs.  If I restart sendmail, it starts quickly.

I seem to recall that this problem can be caused but a misconfiguration in the network settings.

Some info:

 *Quote:*   

> cat /etc/resolv.conf
> 
> domain mydomain.com.au
> 
> nameserver 192.168.2.40
> ...

 

 *Quote:*   

> # cat /etc/conf.d/net
> 
> config_eth0=( "192.168.2.40 netmask 255.255.255.0 broadcast 192.168.2.255" )
> 
> routes_eth0=( "default via 192.168.2.2" )
> ...

 

 *Quote:*   

> cat /etc/conf.d/hostname
> 
> HOSTNAME="servername"
> 
> 

 

 *Quote:*   

> cat /etc/mail/sendmail.mc
> 
> divert(0)dnl
> 
> include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
> ...

 

Can anybody help here?

----------

## Inodoro_Pereyra

Does hostname -f responds with servername.mydomain.com.au correctly? Do you have:

```
127.0.0.1 servername.mydomain.com.au servername localhost
```

In your /etc/hosts?

Cheers!

----------

## Robert S

The answer is yes, and no.

 *Quote:*   

> 127.0.0.1 servername.mydomain.com.au servername localhost

 

This seems to have fixed it (on a single reboot).  Thanks    :Very Happy: 

----------

## Robert S

Unfortunately this configuration causes problems.  I have samba running on "servername".  When I try to connect to this server with a windows 7 machine I get prompted for a username and password.  I get an "incorrect password" error when I try to enter these using my usual windows/samba password.  The prompt says "Domain: asus" (the name of the windows client).  If I do "ping servername" from my windows box it gives 127.0.0.1 as the ip address.  I have dnsmasq running on my gentoo server.  Maybe this is causing problems??

My /etc/hosts now just has 

127.0.0.1               localhost

at the beginning and samba works fine.

Does anybody know how I can get samba working correctly with the recommended /etc/hosts configuration?

----------

## Inodoro_Pereyra

Instead of:

```
127.0.0.1 servername.mydomain.com.au servername localhost
```

Try:

```
192.168.2.40 servername servername.mydomain.com.au localhost

127.0.0.1 servername servername.mydomain.com.au localhost
```

The problem itself is dnsmasq wich is resolving servername as 127.0.0.1 instead of something like 192.168.2.40.

The file /etc/hosts is parsed sequentially so that should do the trick.

Cheers!

----------

## Robert S

That seems to have solved the problem.  I'll mark this with [SOLVED] in a few days when I'm sure that everything else works OK.

----------

