Skip to content

Commit

Permalink
lxc.mount.hook: Skip cpu sysfs logic if missing target
Browse files Browse the repository at this point in the history
Closes lxc#625

Suggested-by: amateur80lvl
Signed-off-by: Stéphane Graber <[email protected]>
  • Loading branch information
stgraber committed Jan 14, 2024
1 parent 18e78f7 commit 746b9f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion share/lxc.mount.hook.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ -d {{LXCFSTARGETDIR}}/proc/ ]; then
fi

# /sys/devices/system/cpu
if [ -d {{LXCFSTARGETDIR}}/sys/devices/system/cpu ] ; then
if [ -d {{LXCFSTARGETDIR}}/sys/devices/system/cpu ] && [ -d "${LXC_ROOTFS_MOUNT}/sys/devices/system/cpu" ]; then
if [ -f {{LXCFSTARGETDIR}}/sys/devices/system/cpu/uevent ]; then
mount -n --bind {{LXCFSTARGETDIR}}/sys/devices/system/cpu "${LXC_ROOTFS_MOUNT}/sys/devices/system/cpu"
else
Expand Down

0 comments on commit 746b9f4

Please sign in to comment.