Commit 1dc1e4c3 authored by Chris Croome's avatar Chris Croome

Test FD size using Bash script...

parent 65299a6e
Pipeline #3520 canceled with stage
in 8 minutes and 52 seconds
......@@ -15,16 +15,11 @@
state: latest
update_cache: yes
- name: Script to get the enable-fd-setsize configure option from the installed package in place
copy:
src: files/php-enable-fd-setsize.sh
- name: Script to get test enable-fd-setsize configure option in place
template:
src: templates/php-enable-fd-setsize.sh.j2
dest: /usr/local/bin/php-enable-fd-setsize.sh
mode: 0755
- name: Get the enable-fd-setsize configure option from the installed package
- name: Test the enable-fd-setsize configure option from the installed package
command: /usr/local/bin/php-enable-fd-setsize.sh
register: php_fd_size
- name: Fail if the installed version of PHP doesn't have the correct number of file descriptors enabled
fail:
when: php_sockets != ( php_fd_size.stdout | int )
#!/bin/bash
BUILD_FD_SIZE={{ php_sockets }}
PHP_CONFIG=$(which php-config)
if [[ "${PHP_CONFIG}" == "" ]]; then
......@@ -8,8 +10,16 @@ if [[ "${PHP_CONFIG}" == "" ]]; then
else
PHP_FD_SIZE=$(${PHP_CONFIG} --configure-options | sed 's/\s\+/\n/g' | grep enable-fd-setsize | sed 's/^--enable-fd-setsize=//' )
if [[ "${PHP_FD_SIZE}" != "" ]]; then
echo "${PHP_FD_SIZE}"
exit 0
if [[ "${PHP_FD_SIZE}" != "${BUILD_FD_SIZE}" ]]; then
echo "Requested FD No: ${BUILD_FD_SIZE} doesn't equal compiled FD No: ${PHP_FD_SIZE}"
exit 1
elif [[ "${PHP_FD_SIZE}" == "${BUILD_FD_SIZE}" ]]; then
echo "Requested FD No: ${BUILD_FD_SIZE} equalis compiled FD No: ${PHP_FD_SIZE}"
exit 0
else
echo "Something has gone wrong, FD No was due to be ${BUILD_FD_SIZE} but it is ${PHP_FD_SIZE}"
exit 1
fi
else
echo "It appears that --enable-fd-setsize was not set when PHP was configured"
exit 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment