summaryrefslogtreecommitdiffstats
path: root/satellit_installer
diff options
context:
space:
mode:
authorChristian Rößler2016-12-15 14:34:12 +0100
committerChristian Rößler2016-12-15 14:34:12 +0100
commit54805d58558a5cdd277841b626281eb1174970fd (patch)
tree89366e8d034bc96683ae6d59dc46fb5f53f3e09f /satellit_installer
parent[SSUS] Patch max upload filesize in php.ini (diff)
downloadsetup-scripts-54805d58558a5cdd277841b626281eb1174970fd.tar.gz
setup-scripts-54805d58558a5cdd277841b626281eb1174970fd.tar.xz
setup-scripts-54805d58558a5cdd277841b626281eb1174970fd.zip
[SSPS] php children not dynamic via service file patching (to be debugged!)
Diffstat (limited to 'satellit_installer')
-rw-r--r--satellit_installer/includes/10-configurations.inc15
-rw-r--r--satellit_installer/includes/50-copyscripts.inc22
2 files changed, 36 insertions, 1 deletions
diff --git a/satellit_installer/includes/10-configurations.inc b/satellit_installer/includes/10-configurations.inc
index 5b2b3ab..76448d0 100644
--- a/satellit_installer/includes/10-configurations.inc
+++ b/satellit_installer/includes/10-configurations.inc
@@ -40,8 +40,21 @@ patch_lighttpd_config() {
cd /etc/lighttpd/conf-enabled || perror "Could not cd to conf-enabled."
[ ! -h 10-fastcgi.conf ] && ln -s ../conf-available/10-fastcgi.conf
[ ! -h 15-fastcgi-php.conf ] && ln -s ../conf-available/15-fastcgi-php.conf
+
# Increase php threads
- sed -i 's/"PHP_FCGI_CHILDREN.*$/"PHP_FCGI_CHILDREN" => "32",/' "15-fastcgi-php.conf"
+ echo -n "# Patching lighttpd service file..."
+ if [ -f /lib/systemd/system/lighttpd.service ]; then
+ # service file found, patching dynamic php children value at system start via patchfile
+ # see includes/50-copyscripts.inc for dropping patch file /usr/local/sbin/patch_lightdm_phpchildren
+ if ! grep -q patch_lightdm_phpchildren /lib/systemd/system/lighttpd.service; then
+ sed -i 's#\[Service\]#\[Service\]\nExecStartPre=\-/usr/local/sbin/patch_lightdm_phpchildren#g'
+ fi
+ else
+ # service file not found, going old static way
+ sed -i 's/"PHP_FCGI_CHILDREN.*$/"PHP_FCGI_CHILDREN" => "32",/' "15-fastcgi-php.conf"
+ fi
+
+
mkdir -p "$1" || perror "Could not create $1."
}
diff --git a/satellit_installer/includes/50-copyscripts.inc b/satellit_installer/includes/50-copyscripts.inc
index 8697aa0..ff9573c 100644
--- a/satellit_installer/includes/50-copyscripts.inc
+++ b/satellit_installer/includes/50-copyscripts.inc
@@ -11,6 +11,28 @@ install_config_static_ip() {
echo "ok."
}
+install_lighttpd_phpchild() {
+ cat > /usr/local/sbin/patch_lightdm_phpchildren <<-HEREDOC
+ #!/bin/bash
+
+ # Could be written in one line, but for better editing when values change...
+ MEM=$(grep MemTotal /proc/meminfo|tr -s " "| cut -f 2 -d " ") # RAM
+ MEM=$(( $MEM / 1024 / 4 )) # to MB and a fourth
+ CHILDREN= $(( $MEM / 16 )) # 16 MB per child
+
+ if [ -f /etc/lighttpd/conf-enabled ]; then
+ sed -i "s/\"PHP_FCGI_CHILDREN.*$/\"PHP_FCGI_CHILDREN\" => \"$CHILDREN\",/" /etc/lighttpd/conf-enabled/15-fastcgi-php.conf
+ else
+ echo "Warning: /etc/lighttpd/conf-enabled/15-fastcgi-php.conf not found!"
+ exit 1
+ fi
+ exit 0
+ HEREDOC
+
+
+
+}
+
install_slxlog() {
mkdir -p "/usr/local/bin"
cp -a "$BASEDIR/static_files/slxlog" "/usr/local/bin/" || perror "Could not install slxlog"