]> code.ossystems Code Review - openembedded-core.git/commitdiff
systemctl: Don't try to remove directory which doesn't exist
authorMartin Jansa <martin.jansa@gmail.com>
Fri, 13 Mar 2015 18:41:40 +0000 (19:41 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 20 Mar 2015 10:59:04 +0000 (10:59 +0000)
Noticed in this log.do_rootfs error:
  Started /OE/build/shr-core/tmp-glibc/sysroots/x86_64-linux/usr/bin/systemctl --root=/OE/build/shr-core/tmp-glibc/work/nokia900-oe-linux-gnueabi/shr-image/2.0-r20/rootfs disable bluetooth.service
  Try to find location of bluetooth.service...
  Found bluetooth.service in /lib/systemd/system/bluetooth.service
  WantedBy=bluetooth.target found in bluetooth.service
  rmdir: failed to remove '/OE/build/shr-core/tmp-glibc/work/nokia900-oe-linux-gnueabi/shr-image/2.0-r20/rootfs/etc/systemd/system/bluetooth.target.wants': No such file or directory
  Disabled bluetooth.service for bluetooth.target.
  Disabled bluetooth.service for dbus-org.bluez.service.

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/systemd/systemd-systemctl/systemctl

index 2e632b00bc3e4e7b57952f996a3112e8b019ea72..6e163bd5c2632541d6bfb2cbe9b64b475dfdf76c 100755 (executable)
@@ -149,7 +149,7 @@ for service in $services; do
                                disable_service="$ROOT/etc/systemd/system/$r.wants/$service"
                        fi
                        rm -f $disable_service
-                       rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants
+                       [ -d $ROOT/etc/systemd/system/$r.wants ] && rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants
                        echo "Disabled ${disable_service##$ROOT/etc/systemd/system/$r.wants/} for $wanted_by."
                fi
        done