Skip to content

Commit

Permalink
lxd/instance/drivers/qemu: update how systemd is detected
Browse files Browse the repository at this point in the history
https://www.freedesktop.org/software/systemd/man/latest/sd_booted.html:
> Internally, this function checks whether the directory /run/systemd/system/
> exists. A simple check like this can also be implemented trivially in shell
> or any other language.

Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Aug 29, 2024
1 parent 7f763d5 commit f71c928
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lxd/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -2860,7 +2860,8 @@ if [ ! -e "systemd" ] || [ ! -e "lxd-agent" ]; then
exit 1
fi
if [ ! -e "/lib/systemd/system" ]; then
# systemd systems always have /run/systemd/system/ created on boot.
if [ ! -d "/run/systemd/system/" ]; then
echo "This script only works on systemd systems"
exit 1
fi
Expand Down

0 comments on commit f71c928

Please sign in to comment.