summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes/10-configurations.inc
diff options
context:
space:
mode:
Diffstat (limited to 'satellit_installer/includes/10-configurations.inc')
-rw-r--r--satellit_installer/includes/10-configurations.inc44
1 files changed, 18 insertions, 26 deletions
diff --git a/satellit_installer/includes/10-configurations.inc b/satellit_installer/includes/10-configurations.inc
index fdd9d61..0ab68f8 100644
--- a/satellit_installer/includes/10-configurations.inc
+++ b/satellit_installer/includes/10-configurations.inc
@@ -31,43 +31,35 @@ copy_tftpd-hpa_service() {
echo -n "# Copying tftpd-hpa service file... "
cp -p "$BASEDIR/static_files/tftpd-hpa.service" /etc/systemd/system && echo "ok." || perror "failed."
echo -n "# Linking tftpd-hpa service file into (/etc/systemd/system/)multi-user.target.wants... "
- ln -s /etc/systemd/system/tftpd-hpa.service /etc/systemd/system/multi-user.target.wants/tftpd-hpa.service \
+ ln -s ../tftpd-hpa.service /etc/systemd/system/multi-user.target.wants/tftpd-hpa.service \
&& echo "ok." || perror "Could not link tftpd-hpa service file into multiuser target!"
}
patch_lighttpd_config() {
+ local mod file
service lighttpd stop
- echo -n "# Patching lighttpd configuration..."
+ echo "# Customizing lighttpd config"
cp -p "$BASEDIR/static_files/lighttpd.conf" /etc/lighttpd/lighttpd.conf || perror "failed."
cp -p "$BASEDIR/static_files/lighttpd-auto-ssl.sh" /usr/share/lighttpd/auto-ssl.sh || perror "failed."
cp -p "$BASEDIR/static_files/lighttpd-include-conf-d.sh" /usr/share/lighttpd/include-conf-d.sh || perror "failed."
+ cp -a "$BASEDIR/static_files/patch_lighttpd_phpchildren" /usr/local/sbin/patch_lighttpd_phpchildren || perror "failed."
chmod +x /usr/share/lighttpd/auto-ssl.sh || perror "failed"
chmod +x /usr/share/lighttpd/include-conf-d.sh || perror "failed"
- echo "ok."
- 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
+ chmod +x /usr/local/sbin/patch_lighttpd_phpchildren || perror "failed"
+ for mod in fastcgi fastcgi-php; do
+ file=$(echo /etc/lighttpd/conf-available/??-${mod}.conf) # expand ??
+ [ -f "$file" ] || perror "Could not find path for $mod"
+ file=$(basename "$file")
+ ln -sf "../conf-available/$file" "/etc/lighttpd/conf-enabled/$file" || perror "Could not enable module $mod"
+ done
- # Increase php threads
- echo -n "# Looking for 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
- echo -n " patching service file ... "
- sed -i 's#\[Service\]#\[Service\]\nExecStartPre=\-/usr/local/sbin/patch_lighttpd_phpchildren#g' \
- /lib/systemd/system/lighttpd.service || perror "Could not patch service file!"
- cp -a "$BASEDIR/static_files/patch_lighttpd_phpchildren" /usr/local/sbin || \
- perror "Could not copy patch_lighttpd_phpchildren script!"
- chmod +x /usr/local/sbin/patch_lighttpd_phpchildren # Just to sleep better in dark nights.
- fi
- else
- # service file not found, going old static way
- echo -n " not found. Doing old, static way (PHP_FCGI_CHILDREN = 32). Please check... ".
- sed -i 's/"PHP_FCGI_CHILDREN.*$/"PHP_FCGI_CHILDREN" => "32",/' "15-fastcgi-php.conf"
- fi
- echo " done."
- mkdir -p "$1" || perror "Could not create $1."
+ # Increase php threads (set dynamically)
+ mkdir -p /etc/systemd/system/lighttpd.service.d || perror "Could not create /etc/systemd/system/lighttpd.service.d"
+ cat > "/etc/systemd/system/lighttpd.service.d/10-dynamic_php_children" <<-HDOC
+ [Service]
+ ExecStartPre=/usr/local/sbin/patch_lighttpd_phpchildren
+ HDOC
+ mkdir -p "$WWWDIR" || perror "Could not create www-dir ($WWWDIR)"
}
patch_php_config() {