From 02a40901a96a1a8caba8f35f6b59a94b0f1330f2 Mon Sep 17 00:00:00 2001 From: torben Date: Tue, 22 Mar 2016 13:56:26 +0100 Subject: Improve error messages. --- .../dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'builder') diff --git a/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh index 16d85835..f0e54d4c 100755 --- a/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh +++ b/builder/dnbd3-rootfs/hooks/copy-dracut-systemd-files-into-newroot.sh @@ -42,9 +42,11 @@ for file in \ do cp "${systemd_system_unit_path}/${file}" \ "${new_systemd_system_unit_path}/${file}" - # ln returns an error if the link already exists - ln --symbolic "../${file}" \ - "${new_systemd_system_unit_path}/initrd.target.wants/${file}" + # "ln" returns an error if the link already exists. + source_path="../${file}" + target_path="${new_systemd_system_unit_path}/initrd.target.wants/${file}" + ln --symbolic "$source_path" "$targetPath" &>/dev/null || \ + logging.warn "Failed to link \"$source_path\" to \"$target_path\"." done } exceptions.catch -- cgit v1.2.3-55-g7522