Software: Apache. PHP/5.3.29 uname -a: Linux tardis23.nocplanet.net 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024
Safe-mode: OFF (not secure) /opt/imunify360/venv/share/imunify360/scripts/ drwxr-xr-x | |
| Viewing file: Select action/file-type: #!/bin/bash
# Disable CPU accounting for all services in Imunify slice
# some clients had issues with CPU accounting, so we provide this script to disable it
# see enable-cgroup-accounting.sh in unified-access-logger repo for more details
UNIT_DIR="/etc/systemd/system"
# Function to create the override file for a systemd unit
create_override() {
local unit_name="$1"
local override_path="$UNIT_DIR/$unit_name.d/override.conf"
# Create the directory for the override file
mkdir -p "$UNIT_DIR/$unit_name.d"
# Create the override.conf file
tee "$override_path" > /dev/null <<EOF
[Service]
CPUAccounting=false
EOF
echo "Override created for $unit_name"
}
# Get all of systemd services
services=$(systemctl list-units --type=service --all --no-pager --no-legend | awk '{print $1}')
for service in $services; do
if systemctl show --property=Slice "$service" | grep "Slice=Imunify"; then
echo "CPUAccounting disabled for $service"
create_override "$service"
fi
done
systemctl daemon-reload
|
:: Command execute :: | |
--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0813 ]-- |