1

Topic: newsyslog: can't notify daemon

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.2
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: FreeBSD 11.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

For the past two weeks, I've been getting an automated e-mail sent to the root user from the cron daemon at 7:00pm every day with the message:

newsyslog: can't notify daemon, pid 94751 = /var/run/php-fpm.pid: No such process

The server had been running normally for several months before this with no issues.

To troubleshoot, I've run 'pgrep php-fpm' which lists this:

root@mx:~ # pgrep php-fpm
13033
96069
94756
94755
94754
94753
94752

Note, 94751 isn't in the list.

If I look at the contents of /var/run/php-fpm.pid it contains 94751

Restarting php-fpm fails on an error because the address/socket 127.0.0.1:9999 is already in use.

---

root@mx:~ # service php-fpm restart
...
Starting php_fpm.
[ERROR] unable to bind listening socket for address '127.0.0.1:9999': Address already in use (48)
[ERROR] FPM initialization failed
/usr/local/etc/rc.d/php-fpm: WARNING: failed to start php_fpm

---

So, to troubleshoot I can do 'killall php-fpm', delete /var/run/php-fpm.pid, then restart php-fpm.  This fixes the problem for 1 day, then the automated cron e-mail returns with a new pid #.

crontab doesn't have any newsyslog entries or any tasks that run at 7pm.

root@mx:~ # crontab -l
30   3   *   *   *   /usr/local/bin/bash /var/vmail/backup/backup_mysql.sh >/dev/null 2>&1

# iRedAPD: Clean up expired tracking records hourly.
1   *   *   *   *   /usr/local/bin/python2 /opt/iredapd/tools/cleanup_db.py >/dev/null 2>&1

# iRedAPD: Convert SPF DNS record of specified domain names to IP
#          addresses/networks hourly.
2   *   *   *   *   /usr/local/bin/python2 /opt/iredapd/tools/spf_to_greylist_whitelists.py >/dev/null

# iRedMail: Cleanup Amavisd database
1   2   *   *   *   /usr/local/bin/python2 /usr/local/www/iredadmin/tools/cleanup_amavisd_db.py >/dev/null

# iRedAdmin: Clean up sql database.
1   *   *   *   *   /usr/local/bin/python2 /usr/local/www/iredadmin/tools/cleanup_db.py >/dev/null 2>&1

# iRedAdmin: Delete mailboxes on file system which belong to removed accounts.
1   *   *   *   *   /usr/local/bin/python2 /usr/local/www/iredadmin/tools/delete_mailboxes.py
# iRedMail: Cleanup Roundcube SQL database
2   2   *   *   *   /usr/local/bin/php /usr/local/www/roundcube/bin/cleandb.sh >/dev/null

# iRedMail: Cleanup Roundcube temporary files under 'temp/' directory
2   2   *   *   *   /usr/local/bin/php /usr/local/www/roundcube/bin/gc.sh >/dev/null
# iRedMail: Backup SOGo data databases on 04:01AM
1   4   *   *   *   /usr/local/bin/bash /var/vmail/backup/backup_sogo.sh >/dev/null 2>&1

Any thoughts to what might cause this or solve?

I have already updated the php-fpm port to the latest version via FreeBSD ports to see if that helped, but no difference.

---

php -version

PHP 7.4.5 (cli) (built: Apr 25 2020 08:54:53) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

---

All services seem to be working normally, but I'm not sure what will happen if this isn't corrected.

Thanks in advance!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: newsyslog: can't notify daemon

No idea right now. sad

3

Re: newsyslog: can't notify daemon

Both the php-fpm.log and slow.log show nothing unusual.  No errors.  Only messages that the logfiles turned over at 19:00 each day:

root@mx:/var/log/php-fpm # more php-fpm.log.0
May  8 19:00:10 mx newsyslog[93191]: logfile turned over
May  9 19:00:12 mx newsyslog[79467]: logfile turned over

root@mx:/var/log/php-fpm # more slow.log.0
May  8 19:00:10 mx newsyslog[93191]: logfile turned over
May  9 19:00:12 mx newsyslog[79467]: logfile turned over

I also set php-fpm.conf logging to "log_level = debug", with nothing notable in the syslog.

The only pattern I can see is that at 19:00 every day, this message appears in /var/log/messages

May  9 19:00:14 <local5.warn> mx dovecot: master: Warning: SIGHUP received - reloading configuration

Could there be something with this dovecot message that would impact php-fpm processes?

4

Re: newsyslog: can't notify daemon

Sounds to me like you might have conflicting versions of PHP installed.
Try run

which php

5

Re: newsyslog: can't notify daemon

root@mx:~ # which php
/usr/local/bin/php

Looks like there is only one version installed?

6

Re: newsyslog: can't notify daemon

blacksteel1288 wrote:

Looks like there is only one version installed?

Seems like it, sorry I'm also not sure then.
Maybe /var/log/php-fpm/ has something useful

7

Re: newsyslog: can't notify daemon

I've checked those logs, but nothing of interest in them as shown in my earlier post here.

@MuPp3t33r your idea about checking the PHP version got me thinking that maybe "simply" reinstalling PHP might reset everything and this would go away.

I tried reinstalling the PHP port, but that set off a series of rebuilds of other ports including the update of libressl from v3.0.2 to v3.1.1

After upgrading libressl to 3.1.1, many other ports broke and mail clients could no longer connect, and I had to rollback to a prior snapshot to get everything working again.

Has anyone successfully updated their iRedMail on FreeBSD 11.3 to libressl 3.1.1.?

8

Re: newsyslog: can't notify daemon

LibreSSL 3.1.1 was released on May 7th, 2020, maybe some ports have issue with it and didn't catch up yet.

9

Re: newsyslog: can't notify daemon

After restoring the iredmail jail from a snapshot, this problem hasn't happened again.  I have to assume it has something to do with the OS and or jails setup, as I didn't make any config changes to iredmail software.

Also, I was finally able to upgrade ports after LibreSSL was updated to 3.1.2.  Everything seems to be working fine.