apisnetworks / apiscp

ApisCP Issues Tracker
https://apiscp.com
15 stars 1 forks source link

EditDomain results in flooded log entries #28

Closed MACscr closed 4 years ago

MACscr commented 4 years ago

Everytime a domain is edited, it appears that a dependency is attempted to be loaded for every site on the server:

Dec  9 18:50:01 cp3 systemd: [/etc/systemd/system/php-fpm-site25-clientdomain.com.socket:4] Failed to add dependency on After=php-fpm-site25.service, ignoring: Invalid argument
Dec  9 18:50:01 cp3 systemd: [/etc/systemd/system/php-fpm-site25-clientdomain.com.service:69] Failed to load slice unit site25. Ignoring.

I know the slice part can be ignored, but the dependency error seems like an issue:

[root@cp3 system]# cat php-fpm-site25-clientdomain.com.socket
# Templated from /usr/local/apnscp/resources/templates/apache/php/fpm-socket-service.blade.php
[Unit]
Description=PHP-FPM group control site25
BindsTo=php-fpm.service  php-fpm-site25.service After=php-fpm-site25.service

[Socket]
ListenStream=/var/run/php-fpm/site25-clientdomain.com.socket
SocketUser=apache
SocketGroup=admin25
SocketMode=0660
RemoveOnStop=yes
DirectoryMode=1111

[Install]
WantedBy=sockets.target php-fpm.service  php-fpm-site25.service
msaladna commented 4 years ago

Resolved in v3.1.14. Some work is needed with slices, which I'd like to hold off for an en masse migration because it needs to be done. You can force an update now with the follow snippet,

yum install -y jq
cpcmd -o json admin:collect null '[apache.jail:1]' | jq 'keys[]' | tr -d '"' | while read -r SITE ; do   
  echo "Editing $(get_config "$SITE" siteinfo domain)"
  EditDomain "$SITE"
done

Going forward deps ought to be resolved apart from the slice.