Need to manually restart php-fpm55 every time I add a new site

amphora

Verified User
Joined
Feb 21, 2013
Messages
56
I'm using CB 2.0 on a CentOS 7 VPS and every time I add a new site/domain the new site gives a 503 Internal Server Error when I visit it in the browser.
Restarting the php-fpm55 service solves the problem but shouldn't it be restarted bij DA every time somebody adds a site/domain? Or is something broken maybe?
 
Hmm.. I've just tested on our CentOS 7 test box, and it does seem to get reloaded for me.
1) Check /var/log/directadmin/system.log to ensure you see the reload log entry at some point after you add the User (probably 1-2 minutes, as the php-fpm reload happens after the apache restart task.queue entry)

Here's how it looks for me:
Code:
2015:08:17-14:46:29: User testfpm is being created by admin.
2015:08:17-14:46:29: Domain testfpm.com is being created via creation of User account
2015:08:17-14:47:01: httpd reloaded
2015:08:17-14:47:01: php-fpm56 reloaded
2015:08:17-14:47:01: named reloaded
2015:08:17-14:47:01: sshd reloaded
where the php-fpm56 reload is triggered from the httpd reload in the task.queue.

2) You can manually test to see what it does:
Code:
cd /usr/local/directadmin
echo "action=httpd&value=reload" >> data/task.queue
and then wait for the cron to trigger the dataskq to see if that adds the php-fpm55 to your system.log.

3) If DA is trying (you see it in the logs), but it's not working, then I'd suspect something with the boot script.. or perhaps a $PATH issue..

a) Try #2, but instead of letting cron run it, do the same thing but run the dataskq yourself
Code:
./dataskq d2000
and if that does correctly restart the php-fpm (by means of actually seeing the new user.sock files being created, not referring to the system.log anymore), then we know it's a $PATH issue..

b) Try what the dataskq is running:and again, look for the new user.sock in /usr/local/php55/sockets/
The old username.sock files should also end up with a new timestamp after reload.

John
 
I just created another user to test. Most services get restarted but not php55

/var/log/directadmin/system.log:

2015:10:22-12:18:42: User xxx is being created by admin.
2015:10:22-12:18:43: Domain xxx.com is being created via creation of User account
2015:10:22-12:19:05: httpd restarted
2015:10:22-12:19:05: named reloaded
2015:10:22-12:19:05: sshd reloaded

Manually reloading (#2) only restarts httpd:
2015:10:22-12:29:01: httpd reloaded

And tried this:

[root@vps03 directadmin]# echo "action=httpd&value=reload" >> data/task.queue
[root@vps03 directadmin]# ./dataskq d2000
Debug mode. Level 2000

root priv set: uid:0 gid:0 euid:0 egid:0
pidfile written
staring queue
done queue

Seems normal too. I think DA just doesn't even try to restart php-fpm55 at all. Is there a config file that tells DA somewhere what to restart?
 
Last edited:
May you please submit a ticket to tickets.directadmin.com with login credentials to the server?
 
Followup:
DA binaries didn't match the OS, so different reload call was issued, which didn't make it (CentOS 6, vs CentOS 7).
Related guide to confirm OS vs binaries:
http://help.directadmin.com/item.php?id=318

Related error from /var/log/directadmin/errortaskq.log
Code:
2015:11:03-20:31:06: Error gracefuling service php-fpm55 : uid 0 gid 0 : /sbin/service php-fpm55 graceful        >/dev/null 2>/dev/null                      : returned 2
because "graceful" isn't a systemd option.
It had a chance of working, even with the wrong DA binaries, as "service" translates those calls to systemctl calls, but as "graceful" isn't an option... the lack of correct DA binaries prevented DA from calling "reload" instead.
The other services like apache were lucky that they worked, as DA issues reloads by default.

FYI: apache + systemd does issue a graceful to apache when DA calls a reload:
Code:
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
which is friendlier to active connections.

John
 
Thanks!
I've just added another domain and /var/log/directadmin/errortaskq.log now also says "php-fpm55 reloaded"
So it seems to work.
But apparently my VPS provider made gave me an incorrect system image with the wrong binaries? I'll contact them and let them have a look.
 
Note that the binaries downloaded are controlled in the license on our end.
So if they were incorrect there, and update to DA would give you those incorrect binaries.. so might not be an issue with their image, just a wrong OS selected in the license.

John
 
Back
Top