Mailing List Archive

Exim 4.94 - daemon_notifier_socket bind: Address already in use
Hi.

FreeBSD, Exim from ports.
Exim version 4.94 #0 (FreeBSD 12.1) built 02-Jun-2020 17:33:19

exim -d -q5m

42885 creating notifier socket
42885 /var/spool/exim/exim_daemon_notify
42885 LOG: MAIN PANIC
42885 daemon_notifier_socket bind: Address already in use

It's bug?

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
Mikhail Golub via Exim-users <exim-users@exim.org> (Mi 03 Jun 2020 10:42:35 CEST):
> Hi.
>
> FreeBSD, Exim from ports.
> Exim version 4.94 #0 (FreeBSD 12.1) built 02-Jun-2020 17:33:19
>
> exim -d -q5m
>
> 42885 creating notifier socket
> 42885 /var/spool/exim/exim_daemon_notify
> 42885 LOG: MAIN PANIC
> 42885 daemon_notifier_socket bind: Address already in use

Is there any other Exim instance running?
If not, does the /var/spool/exim/exim_daemon_notify file exist prior to
the start? It shouldn't, I suppose. Maybe a left-over from a previous
run?


… just guessing.
--
Heiko
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
On 03/06/2020 09:42, Mikhail Golub via Exim-users wrote:
> 42885 creating notifier socket
> 42885  /var/spool/exim/exim_daemon_notify
> 42885 LOG: MAIN PANIC
> 42885   daemon_notifier_socket bind: Address already in use
>
> It's bug?

It's something still using that socket.

Either "ss -p" or "netstat -panu" might tell you what process,
if this is a persistent condition.

--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
03.06.2020 12:18, Heiko Schlittermann via Exim-users ?????:
>> 42885 creating notifier socket
>> 42885 /var/spool/exim/exim_daemon_notify
>> 42885 LOG: MAIN PANIC
>> 42885 daemon_notifier_socket bind: Address already in use
>
> Is there any other Exim instance running?

No.
# ps ax | grep exim
44910 1 S+ 0:00,00 grep exim

> If not, does the /var/spool/exim/exim_daemon_notify file exist prior to
> the start? It shouldn't, I suppose. Maybe a left-over from a previous
> run?

Yes, file exist.

Ok, maybe file stayed after update Exim version and "tained" errors.
Thanks.


--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
On 03/07/2020 19:41, Ian Zimmerman via Exim-users wrote:
> On 2020-07-03 12:30, Jeremy Harris wrote:
>> The only other possibility is to avoid using the -oP option on the 465
>> daemon.
>
> Wait, how can -oP be the problem,

Specifying -oX and no -oP locks out the creation of this comms
endpoint.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
Hi,

I actually happen to see the same question recently.
One problem I found is that if I use exit_ctl to stop the process, this file can be removed without any problem.
But if I use -d option to start the exim daemon from the command line to check the debug output and then use ctrl+c to kill the process, the file exim_daemon_notify cannot be removed properly.
As a result, I cannot start exim process.
And for me, if I manually remove exim_daemon_notify file, exim can start successfully for me.
It took me really a long time to figure this out though.
I cannot find any relevant information from the search engine.
But you need to make sure you only have one instance of exim running.
I’m using a Mac. But I believe it applies to freebsd as well since your error message is exactly the same as mine, as well as the exim version.

Cheers,
Kun

On 2020-06-03 08:42, Mikhail Golub wrote:
> Hi.
>
> FreeBSD, Exim from ports.
> Exim version 4.94 #0 (FreeBSD 12.1) built 02-Jun-2020 17:33:19
>
> exim -d -q5m
>
> 42885 creating notifier socket
> 42885 /var/spool/exim/exim_daemon_notify
> 42885 LOG: MAIN PANIC
> 42885 daemon_notifier_socket bind: Address already in use
>
> It's bug?
>
>
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
On 23/07/2020 04:27, haoniukun via Exim-users wrote:
> I actually happen to see the same question recently.
> One problem I found is that if I use exit_ctl to stop the process, this file can be removed without any problem.
> But if I use -d option to start the exim daemon from the command line to check the debug output and then use ctrl+c to kill the process, the file exim_daemon_notify cannot be removed properly.
> As a result, I cannot start exim process.
> And for me, if I manually remove exim_daemon_notify file, exim can start successfully for me.
> It took me really a long time to figure this out though.
> I cannot find any relevant information from the search engine.
> But you need to make sure you only have one instance of exim running.
> I’m using a Mac. But I believe it applies to freebsd as well since your error message is exactly the same as mine, as well as the exim version.

Interesting.

Presumably, since you say you can manually remove the
notifier socket via its filename, its presence can be
seen using netstat? How is the socket name displayed
there?

The socket is unlinked by the daemon, on shutdown,
for the "abstract socket" case (only). For the
non-abstract case, we rely on the daemon closing it
to result in its disappearance. Perhaps the BSDs
are behaving differently here... I can test on a
FreeBSD, but not on a Mac; lets hope that is
good enough...

The close/unlink is done in the daemon just before a fork
for removing a pidfile. This for should be
visible in debug output; can you verify the daemon
gets to that point? It's about the last thing it
does on closedown.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
Hi.
Sorry, but the problem exists :(

Given:
exim -bV
Exim version 4.94 #4 (FreeBSD 12.2) built 25-Nov-2020 20:28:32
Copyright (c) University of Cambridge, 1995 - 2018
(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007
- 2018
Probably Berkeley DB version 1.8x (native mode)
Support for: crypteq iconv() use_setclassresources Perl Expand_dlfunc
OpenSSL Content_Scanning DKIM PIPE_CONNECT PRDR SPF TCP_Fast_Open
Experimental_SRS
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm
dbmjz dbmnz dnsdb dsearch ldap ldapdn ldapm mysql
Authenticators: plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/mbx autoreply lmtp pipe smtp
Malware: f-protd f-prot6d drweb fsecure sophie clamd avast sock cmdline
Fixed never_users: 0
Configure owner: 0:0
Size of off_t: 8
Configuration file is /usr/local/etc/exim/configure


Exim installed from ports.

I stop exim (service exim stop).
Manually remove file /var/spool/exim/exim_daemon_notify
Start exim (service exim start). File /var/spool/exim/exim_daemon_notify
created.
After that i reload exim (service exim reload) and give paniclog:
2021-02-05 10:07:24 daemon_notifier_socket bind: Address already in use

Second experiment - start Exim with debug.
service exim stop
rm /var/spool/exim/exim_daemon_notify

exim -bd -q5m -d+all > /var/log/exim/exim-debug.log 2>&1
Exim started normally and exim_daemon_notify created.
Send 'kill -1' to exim pid and give paniclog.

Debug in attachment.



On 23.07.2020 14:17, Jeremy Harris via Exim-users wrote:
> On 23/07/2020 04:27, haoniukun via Exim-users wrote:
>> I actually happen to see the same question recently.
>> One problem I found is that if I use exit_ctl to stop the process, this file can be removed without any problem.
>> But if I use -d option to start the exim daemon from the command line to check the debug output and then use ctrl+c to kill the process, the file exim_daemon_notify cannot be removed properly.
>> As a result, I cannot start exim process.
>> And for me, if I manually remove exim_daemon_notify file, exim can start successfully for me.
>> It took me really a long time to figure this out though.
>> I cannot find any relevant information from the search engine.
>> But you need to make sure you only have one instance of exim running.
>> I’m using a Mac. But I believe it applies to freebsd as well since your error message is exactly the same as mine, as well as the exim version.
>
> Interesting.
>
> Presumably, since you say you can manually remove the
> notifier socket via its filename, its presence can be
> seen using netstat? How is the socket name displayed
> there?
>
> The socket is unlinked by the daemon, on shutdown,
> for the "abstract socket" case (only). For the
> non-abstract case, we rely on the daemon closing it
> to result in its disappearance. Perhaps the BSDs
> are behaving differently here... I can test on a
> FreeBSD, but not on a Mac; lets hope that is
> good enough...
>
> The close/unlink is done in the daemon just before a fork
> for removing a pidfile. This for should be
> visible in debug output; can you verify the daemon
> gets to that point? It's about the last thing it
> does on closedown.
>
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
On Fri, 5 Feb 2021 at 11:18, Mikhail Golub via Exim-users <
exim-users@exim.org> wrote:

> Hi.
> Sorry, but the problem exists :(
>
> Given:
> exim -bV
> Exim version 4.94 #4 (FreeBSD 12.2) built 25-Nov-2020 20:28:32
> Copyright (c) University of Cambridge, 1995 - 2018
> (c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007
> - 2018
> Probably Berkeley DB version 1.8x (native mode)
> Support for: crypteq iconv() use_setclassresources Perl Expand_dlfunc
> OpenSSL Content_Scanning DKIM PIPE_CONNECT PRDR SPF TCP_Fast_Open
> Experimental_SRS
> Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm
> dbmjz dbmnz dnsdb dsearch ldap ldapdn ldapm mysql
> Authenticators: plaintext
> Routers: accept dnslookup ipliteral manualroute queryprogram redirect
> Transports: appendfile/mbx autoreply lmtp pipe smtp
> Malware: f-protd f-prot6d drweb fsecure sophie clamd avast sock cmdline
> Fixed never_users: 0
> Configure owner: 0:0
> Size of off_t: 8
> Configuration file is /usr/local/etc/exim/configure
>
>
> Exim installed from ports.
>
> I stop exim (service exim stop).
> Manually remove file /var/spool/exim/exim_daemon_notify
> Start exim (service exim start). File /var/spool/exim/exim_daemon_notify
> created.
> After that i reload exim (service exim reload) and give paniclog:
> 2021-02-05 10:07:24 daemon_notifier_socket bind: Address already in use
>
> Second experiment - start Exim with debug.
> service exim stop
> rm /var/spool/exim/exim_daemon_notify
>
> exim -bd -q5m -d+all > /var/log/exim/exim-debug.log 2>&1
> Exim started normally and exim_daemon_notify created.
> Send 'kill -1' to exim pid and give paniclog.
>
> Debug in attachment.
>

You are not alone. I had this problem too (actually I have it) but did a
workaround:
In rc.d/exim control script, I added a line:

notify=/var/spool/exim/exim_daemon_notify

Then down the script, I did this:

stop_postcmd()
{
rm -f $pidfile $notify <====== Added the $notify
}

Sometimes I just think it's not worth struggling so much. Maybe one day the
port maintainer will fix it.



--
Best regards,
Odhiambo WASHINGTON,
Nairobi,KE
+254 7 3200 0004/+254 7 2274 3223
"Oh, the cruft.", grep ^[^#] :-)
--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Exim 4.94 - daemon_notifier_socket bind: Address already in use [ In reply to ]
On 05/02/2021 08:17, Mikhail Golub via Exim-users wrote:
> Exim version 4.94 #4 (FreeBSD 12.2) built 25-Nov-2020 20:28:32

> I stop exim (service exim stop).
> Manually remove file /var/spool/exim/exim_daemon_notify
> Start exim (service exim start). File /var/spool/exim/exim_daemon_notify created.
> After that i reload exim (service exim reload) and give paniclog:
> 2021-02-05 10:07:24 daemon_notifier_socket bind: Address already in use

> Debug in attachment.

Thanks for the debug run. Fixed in beb5d85c7d in the master branch,
or c4e2500b1d if you follow exim-4.94+fixes.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/