Dont autocreate php-fpm56 socket for new user.

bit

Verified User
Joined
Apr 23, 2015
Messages
57
My options.conf:

Code:
php1_release=5.6
php1_mode=php-fpm
php2_release=5.4
php2_mode=php-fpm
...
webserver=nginx_apache
Allwork well but after create new user in directadmin than not autocreate php-fpm56 socker for this user. Need restart php manually. With php 5.4 any problem. Please help.
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,070
Hello,

1) Which version of DA is running? I can see in the code changes were made about ~250 days ago..so 1.47.0 should work.
Else, try the pre-release binaries for 1.48.0.

2) Check to ensure the boot scripts are present and working, although I'm assuming they are, as you've mentioned a manual restart.

3) Lastly, which OS version is this for?

John
 

guyusoftware

New member
Joined
May 7, 2015
Messages
4
Hello,

1) Which version of DA is running? I can see in the code changes were made about ~250 days ago..so 1.47.0 should work.
Else, try the pre-release binaries for 1.48.0.

2) Check to ensure the boot scripts are present and working, although I'm assuming they are, as you've mentioned a manual restart.

3) Lastly, which OS version is this for?

John
I also met the same problem.
I am using CentOS 6 x86 + DA 1.48 now.
I had remember that when I install DA 1.48 with nginx_apache+php-fpm56+php-fpm53+mysql 5.6, it was quite strange that the environment which DA installed is not as my expectation, it give me a environment which included nginx_apache+broken php-ftp55+mysql 5.5.
I manually rebuild it with my configuration and finally it seems normal.
But, actually there is a hidden problem that I need to manually restart php-fpm56 after creating user.
Is there any better solution?

This below is the apache log of user's domain.
[Fri May 08 02:27:57.984049 2015] [proxy:error] [pid 4101:tid 2596092784] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /usr/local/php56/sockets/xxxxxxxxx.sock (*) failed
[Fri May 08 02:27:57.984091 2015] [proxy_fcgi:error] [pid 4101:tid 2596092784] [client XX.XX.XX.XX:XX] AH01079: failed to make connection to backend: httpd-UDS
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,070
Hmm.. still unable to duplicate.

Can you please create a User, and then very quickly run:
Code:
cat /usr/local/directadmin/data/task.queue
have it ready to press enter before you create the User, then quickly press enter immediate after it's created.

When I do it, we get this
Code:
[root@es6-64 sockets]# cat /usr/local/directadmin/data/task.queue
action=confirm&type=httpd%2Econf&value=%2Fusr%2Flocal%2Fdirectadmin%2Fdata%2Fusers%2Fphpfpmtest%2Fhttpd%2Econf
action=rewrite&value=pureftp%5Fdb
action=httpd&value=restart
action=sshd&value=reload
action=named&value=reload
action=httpd&value=restart
[root@es6-64 sockets]#
and then after the dataskq runs, then socket is created in both areas:
Code:
[root@es6-64 sockets]# ls -la /usr/local/php*/sockets/phpfpmtest.sock
srw-rw----. 1 phpfpmtest apache 0 May  8 03:38 /usr/local/php55/sockets/phpfpmtest.sock
srw-rw----. 1 phpfpmtest apache 0 May  8 03:38 /usr/local/php56/sockets/phpfpmtest.sock
[root@es6-64 sockets]#
From the task.queue output above, the line that does the restart would be the httpd or nginx restart/reload/graceful. Anything other than "stop" should issue a "graceful" to all related /etc/init.d/php-fpmXX scripts.

We can test that.. so on your server, try this:
Code:
cd /usr/local/directadmin
ps ax | grep php-fpm
#take note of the PID values for the 2 master processes.
echo "action=httpd&value=restart" > data/task.queue; ./dataskq d2000
And once that's done, run the "ps ax | grep php-fpm" a 2nd time, to see if the PID values changed.

Here's how it looks on my end
Code:
[root@es6-64 directadmin]# ps ax | grep php-fpm
22249 ?        Ss     0:00 php-fpm: master process (/usr/local/php55/etc/php-fpm.conf)
22251 ?        Ss     0:00 php-fpm: master process (/usr/local/php56/etc/php-fpm.conf)
22323 pts/1    S+     0:00 grep php-fpm
[root@es6-64 directadmin]# echo "action=httpd&value=restart" > data/task.queue; ./dataskq d2000
Debug mode. Level 2000


root priv set: uid:0 gid:0 euid:0 egid:0
pidfile written
staring queue
dataskq: command: action=httpd&value=restart
done queue
[root@es6-64 directadmin]# ps ax | grep php-fpm
22365 ?        Ss     0:00 php-fpm: master process (/usr/local/php55/etc/php-fpm.conf)
22367 ?        Ss     0:00 php-fpm: master process (/usr/local/php56/etc/php-fpm.conf)
22439 pts/1    S+     0:00 grep php-fpm
[root@es6-64 directadmin]#
So.. I'm still not sure why it's not working for you...

One thing to check would be to ensure that your task.queue is actually being processed... but if apache gets restarted, then so should php-fpm.
http://help.directadmin.com/item.php?id=107

John
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,070
Another thing to try is debug level 3000, eg:
Code:
echo "action=httpd&value=restart" > data/task.queue; ./dataskq d3000
I'm interested in the ~13 lines after the string "Apache::figure_out_setup:", as it will show us what DA has loaded from the CB options.conf.
It's possible that if something is weird in the options.conf, or some different case, that DA isn't reading the php versions/types correctly, thus the php-fpm isn't getting reloaded.

eg:
Code:
Apache::figure_out_setup:
cb_ver=2
php1_ver=5.5
php2_ver=5.6
php1_fpm=1
php2_fpm=1
php1_fcgi=0
php2_fcgi=0
suphp=0
cli=0
safe_mode=0
mod_ruid2=0
suexec_per_dir=0
webapps_inbox_prefix=0
We can see php1_fpm=1 and php2_fpm=1, so DA should be able to restart the php1_ver and php2_ver correctly.
Paste us what you get for those values.

And after that, if the above settings are correct, lower in the dataskq output should be:
Code:
doservice('php-fpm55', 'graceful')
execute('/sbin/service php-fpm55 graceful        >/dev/null 2>/dev/null                     ', maxsize=0, fd=1, env=0)
doservice('php-fpm56', 'graceful')
execute('/sbin/service php-fpm56 graceful        >/dev/null 2>/dev/null                     ', maxsize=0, fd=1, env=0)
which shows us that php-fpmXX are being given a 'graceful' restart.


Last thing, when you do it manually are you doing a "restart" or a "graceful"?
Make sure that this works:
Code:
/sbin/service php-fpm56 graceful
as it's what DA uses.

John
 

guyusoftware

New member
Joined
May 7, 2015
Messages
4
Another thing to try is debug level 3000, eg:
Code:
echo "action=httpd&value=restart" > data/task.queue; ./dataskq d3000
I'm interested in the ~13 lines after the string "Apache::figure_out_setup:", as it will show us what DA has loaded from the CB options.conf.
It's possible that if something is weird in the options.conf, or some different case, that DA isn't reading the php versions/types correctly, thus the php-fpm isn't getting reloaded.

eg:
Code:
Apache::figure_out_setup:
cb_ver=2
php1_ver=5.5
php2_ver=5.6
php1_fpm=1
php2_fpm=1
php1_fcgi=0
php2_fcgi=0
suphp=0
cli=0
safe_mode=0
mod_ruid2=0
suexec_per_dir=0
webapps_inbox_prefix=0
We can see php1_fpm=1 and php2_fpm=1, so DA should be able to restart the php1_ver and php2_ver correctly.
Paste us what you get for those values.

And after that, if the above settings are correct, lower in the dataskq output should be:
Code:
doservice('php-fpm55', 'graceful')
execute('/sbin/service php-fpm55 graceful        >/dev/null 2>/dev/null                     ', maxsize=0, fd=1, env=0)
doservice('php-fpm56', 'graceful')
execute('/sbin/service php-fpm56 graceful        >/dev/null 2>/dev/null                     ', maxsize=0, fd=1, env=0)
which shows us that php-fpmXX are being given a 'graceful' restart.


Last thing, when you do it manually are you doing a "restart" or a "graceful"?
Make sure that this works:
Code:
/sbin/service php-fpm56 graceful
as it's what DA uses.

John
# echo "action=httpd&value=restart" > data/task.queue; ./dataskq d3000
Debug mode. Level 3000

root priv set: uid:0 gid:0 euid:0 egid:0
pidfile written
staring queue
dataskq: command: action=httpd&value=restart
doservice('httpd', 'restart')
int Apache::figure_out_setup. Class instance
Apache::figure_out_setup:
cb_ver=2
php1_ver=5.6
php2_ver=5.3
php1_fpm=1
php2_fpm=1
php1_fcgi=0
php2_fcgi=0
suphp=0
cli=0
safe_mode=0
mod_ruid2=0
suexec_per_dir=1
webapps_inbox_prefix=0

InternalText::init(serverinfo)
ServerInfo::getVersions: parsing httpd version from 'Server version: Apache/2.4.12 (Unix)
Server built: Apr 30 2015 05:10:21
'
doservice('php-fpm52', 'graceful')
Error gracefuling service php-fpm52 : uid 0 gid 0 : /sbin/service php-fpm52 graceful >/dev/null 2>/dev/null : returned 1
doservice('php-fpm55', 'graceful')
Error gracefuling service php-fpm55 : uid 0 gid 0 : /sbin/service php-fpm55 graceful >/dev/null 2>/dev/null : returned 1
Tally::scan_log: /var/log/exim/mainlog: cur_size (230051) == last_size (230051). Assuming nothing changed. Skipping.
Tally::scan_log: /var/log/maillog: cur_size (5403) == last_size (5403). Assuming nothing changed. Skipping.
Tally::scan_log: /var/www/html/roundcube/logs/errors: cur_size (0) == last_size (0). Assuming nothing changed. Skipping.
Tally::scan_log: /var/www/html/squirrelmail/data/squirrelmail_access_log: cur_size (0) == last_size (0). Assuming nothing changed. Skipping.
Tally::scan_log: /var/www/html/phpMyAdmin/log/auth.log: cur_size (10783) == last_size (10783). Assuming nothing changed. Skipping.
check_brute_force_logs: begin IP sorting
check_brute_force_logs: done IP sorting. Begin User sorting
check_brute_force_logs: done User sorting
No need to write ./data/admin/login.hist as it hasn't changed
done queue

This is the result of my server.
It seems like DA had a mistake when gracefuling service php.
I am using php-fpm56 and php-fpm53 but DA do a gracefuling job for php-fpm55 and php-fpm52 then the error occurs.
Is that the problem is caused by this "suexec_per_dir=1"?
How can I fix it?
 

DirectAdmin Support

Administrator
Staff member
Joined
Feb 27, 2003
Messages
9,070
Based on the code, I'm not sure how that's even possible... which typically points to binary issues..

Check:
Code:
cd /usr/local/directadmin
./directadmin o
uname -m
cat /etc/redhat-release
to ensure they match up.

Beyond that, I couldn't say.
If you'd like me to check, I could debug deeper no the system with test binaries.
Send us your root and admin login info to support@.

John
 

guyusoftware

New member
Joined
May 7, 2015
Messages
4
Based on the code, I'm not sure how that's even possible... which typically points to binary issues..

Check:
Code:
cd /usr/local/directadmin
./directadmin o
uname -m
cat /etc/redhat-release
to ensure they match up.

Beyond that, I couldn't say.
If you'd like me to check, I could debug deeper no the system with test binaries.
Send us your root and admin login info to support@.

John
# ./directadmin o
Compiled on 'CentOS 6.0'
Compile time: May 3 2015 at 03:49:58
Compiled with IPv6
# uname -m
i686
# cat /etc/redhat-release
CentOS release 6.6 (Final)

I use "ln -s" to consistent with the bug.
It works right now.
Maybe I will send you a mail with that of information after asking my customer.
 

bit

Verified User
Joined
Apr 23, 2015
Messages
57
Problem be return((

Code:
# ./directadmin o
Compiled on 'CentOS 6.0'
Compile time: Jun 27 2015 at 02:07:32
Compiled with IPv6
# uname -m
i686
# cat /etc/redhat-release
CentOS release 6.7 (Final)
Code:
# echo "action=httpd&value=restart" > data/task.queue; ./dataskq d3000
Debug mode. Level 3000

root priv set: uid:0 gid:0 euid:0 egid:0
pidfile written
staring queue
dataskq: command: action=httpd&value=restart
doservice('httpd', 'restart')
execute('/sbin/service httpd restart        >/dev/null 2>/dev/null                     ', maxsize=0, fd=1, env=0)
int Apache::figure_out_setup. Class instance 
execute('/usr/sbin/suexec -V', maxsize=19, fd=1, env=0)
Apache::figure_out_setup:
cb_ver=2
php1_ver=5.6
php2_ver=5.4
php1_fpm=1
php2_fpm=1
php1_fcgi=0
php2_fcgi=0
suphp=0
cli=0
safe_mode=0
mod_ruid2=0
suexec_per_dir=1
webapps_inbox_prefix=0

InternalText::init(serverinfo)
execute('/usr/sbin/httpd -v', maxsize=128, fd=1, env=0)
ServerInfo::getVersions: parsing httpd version from 'Server version: Apache/2.4.16 (Unix)
Server built:   Aug 25 2015 14:05:25
'
doservice('php-fpm54', 'graceful')
execute('/sbin/service php-fpm54 graceful        >/dev/null 2>/dev/null                     ', maxsize=0, fd=1, env=0)
doservice('php-fpm55', 'graceful')
execute('/sbin/service php-fpm55 graceful        >/dev/null 2>/dev/null                     ', maxsize=0, fd=1, env=0)
Error gracefuling service php-fpm55 : uid 0 gid 0 : /sbin/service php-fpm55 graceful        >/dev/null 2>/dev/null                      : returned 1
Tally::scan_log: /var/log/secure:   cur_size (1820) == last_size (1820). Assuming nothing changed. Skipping.
Tally::scan_log: /var/log/exim/mainlog:   cur_size (1067699) == last_size (1067699). Assuming nothing changed. Skipping.
Tally::scan_log: /var/log/maillog:   cur_size (259316) == last_size (259316). Assuming nothing changed. Skipping.
Tally::scan_log: /var/www/html/roundcube/logs/errors:   cur_size (0) == last_size (0). Assuming nothing changed. Skipping.
Tally::scan_log: /var/www/html/squirrelmail/data/squirrelmail_access_log:   cur_size (0) == last_size (0). Assuming nothing changed. Skipping.
Tally::scan_log: /var/www/html/phpMyAdmin/log/auth.log:   cur_size (0) == last_size (0). Assuming nothing changed. Skipping.
Tally::scan_log: /var/log/messages:   cur_size (3048459) == last_size (3048459). Assuming nothing changed. Skipping.
check_brute_force_logs: begin IP sorting
check_brute_force_logs: done IP sorting. Begin User sorting
check_brute_force_logs: done User sorting
No need to write ./data/admin/login.hist as it hasn't changed
done queue
in debug we have error "Error gracefuling service php-fpm55 : uid 0 gid 0 : /sbin/service php-fpm55 graceful " but i dont have php-fpm55. I have php-fpm54 and php-fpm56...
 
Last edited:
Top