DirectAdmin Knowledge Base and Support

DirectAdmin is a web panel for a simple administration of both virtual and dedicated servers. DirectAdmin is faster, safe and more powerful than any other CP. And we know how to customize and support it.

No PHP-FPM is restarted after an user restore by Directadmin

| 12:36:00 13.02.2019

Directadmin of the version 1.55.0 does not restart PHP-FPM after an user restoration if found domains with SSL certs.

The bug was already reported to Directadmin developers, and while we are waiting for an official fix, here is a possible solution from Poralix:

Use a hook script user_restore_post.sh

Create it if it does not exist:

cd /usr/local/directadmin/scripts/custom
touch ./user_restore_post.sh
chmod 700 ./user_restore_post.sh
chown diradmin:diradmin ./user_restore_post.sh

Open it in an editor and populate the file with the following code lines:

#!/bin/bash

# PHP-FPM is not restarted after an user import
# so here we restart it
restart_fpm()
{
    echo "[$(date)] Restarting php-fpm${PHP_VER}";
    /bin/systemctl restart "php-fpm${PHP_VER}";
    ps aux | grep -v grep | grep "php-fpm: master process" | grep "${PHP_VER}";
}

for PHP_VER in $(grep ^php[1-4]_release= /usr/local/directadmin/custombuild/options.conf | grep -v =no | cut -d= -f2 | awk -F. '{print $1$2}')
do
{
    restart_fpm | logger -t user_restore_post;
}
done;

Save the file and exit the editor.

You can control how it runs through /var/log/messages on a CentOS based server:

grep user_restore_post /var/log/messages

It's supposed that you see something like:

Feb 13 07:22:31 srvlin02 user_restore_post: [Wed Feb 13 07:22:31 CET 2019] Restarting php-fpm72
Feb 13 07:22:31 srvlin02 user_restore_post: root     16866  5.0  0.4 477088 16924 ?        Ss   07:22   0:00 php-fpm: master process (/usr/local/php72/etc/php-fpm.conf)
Feb 13 07:22:31 srvlin02 user_restore_post: [Wed Feb 13 07:22:31 CET 2019] Restarting php-fpm71
Feb 13 07:22:32 srvlin02 user_restore_post: root     16878  0.0  0.8 471088 32416 ?        Ss   07:22   0:00 php-fpm: master process (/usr/local/php71/etc/php-fpm.conf)

That's it.

More links:

  • https://www.directadmin.com/features.php?id=2116
  • https://www.directadmin.com/features.php?id=564
About Us
We are a team of professionals, and specialize in installation, configuring and managing of remote virtual and dedicated servers powered by Linux/Unix-like OS with DirectAdmin. We support various sets of software, including web-servers Apache, Nginx; internet domain name servers Bind, PowerDNS; mail-servers with POP3, IMAP and SMTP, FTP-servers, etc. After years of working through the most complex server challenges our team has gathered valuable experience and universal solutions suitable for everyday tasks. We are here to lend you a helping hand and take care of your servers in order to let you have enough time to do more of what you love.




All of the information and data on this site is for informational purposes only and is provided for the convenience of the user.
Powered by: Amiro.CMS - Free edition