Merge pull request #10903 from BbolroC/fixes-for-cri-containerd-on-ubuntu24

tests: Support systemd unit files in /usr/lib as well as /lib
This commit is contained in:
Hyounggyu Choi 2025-02-19 19:45:55 +01:00 committed by GitHub
commit ca40462a1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -332,8 +332,8 @@ function restart_systemd_service_with_no_burst_limit() {
local unit_file=$(systemctl show "$service.service" -p FragmentPath | cut -d'=' -f2)
[ -f "$unit_file" ] || { warn "Can't find $service's unit file: $unit_file"; return 1; }
# If the unit file is in /lib, copy it to /etc
if [[ $unit_file == /lib* ]]; then
# If the unit file is in /lib or /usr/lib, copy it to /etc
if [[ $unit_file =~ ^/(usr/)?lib/ ]]; then
tmp_unit_file="/etc/${unit_file#*lib/}"
sudo cp "$unit_file" "$tmp_unit_file"
unit_file="$tmp_unit_file"