From 028e3b3b1a8d15a9ab5a0c925ca32fd3851cfa36 Mon Sep 17 00:00:00 2001 From: lorenz Date: Wed, 8 Jan 2020 02:03:00 +0100 Subject: Avoid here-documents in systemd mount generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On some systems - openSUSE, for example - there is not yet a writeable temporary file system available, so bash bails out with an error, 'cannot create temp file for here-document: Read-only file system', on the here documents in zfs-mount-generator. The simple fix is to change these into a multi-line echo statement. Reviewed-by: Brian Behlendorf Reviewed-By: Richard Laager Reviewed-by: George Melikov Signed-off-by: Lorenz Hüdepohl Closes #9802 --- .../system-generators/zfs-mount-generator.in | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'etc') diff --git a/etc/systemd/system-generators/zfs-mount-generator.in b/etc/systemd/system-generators/zfs-mount-generator.in index 850396fb6..066896009 100755 --- a/etc/systemd/system-generators/zfs-mount-generator.in +++ b/etc/systemd/system-generators/zfs-mount-generator.in @@ -104,8 +104,13 @@ process_line() { fi # Generate the key-load .service unit - cat > "${dest_norm}/${keyloadunit}" << EOF -# Automatically generated by zfs-mount-generator + # + # Note: It is tempting to use a `< "${dest_norm}/${keyloadunit}" fi # Update the dependencies for the mount file to require the # key-loading unit. @@ -235,8 +239,11 @@ EOF # Create the .mount unit file. # By ordering before zfs-mount.service, we avoid race conditions. - cat > "${dest_norm}/${mountfile}" << EOF -# Automatically generated by zfs-mount-generator + # + # (Do not use `< "${dest_norm}/${mountfile}" # Finally, create the appropriate dependency ln -s "../${mountfile}" "${req_dir}" -- cgit v1.2.3