mirror of
https://github.com/docker/docker-bench-security.git
synced 2025-10-08 16:30:18 +00:00
fixes systemctl issue in get_systemd_service_file for containerized scan which cannot run systemctl show -p FragmentPath. Includes improvement when reporting Files not found.
This commit is contained in:
parent
8a0852e17f
commit
bd5d2e82ba
3 changed files with 46 additions and 44 deletions
|
@ -105,6 +105,8 @@ get_systemd_service_file() {
|
|||
echo "/etc/systemd/system/$SERVICE"
|
||||
elif systemctl show -p FragmentPath "$SERVICE" 2> /dev/null 1>&2; then
|
||||
systemctl show -p FragmentPath "$SERVICE" | sed 's/.*=//'
|
||||
elif [ -f "/lib/systemd/system/$SERVICE" ]; then
|
||||
echo "/lib/systemd/system/$SERVICE"
|
||||
else
|
||||
echo "/usr/lib/systemd/system/$SERVICE"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue