Hi, Ludovic Courtès skribis: > Following the Shepherd upgrade in commit > 400c9ed3d779308e56038305d40cd93acb496180, attempts to open non-root LUKS > devices from a Shepherd service fail with this cryptsetup message: > > Nothing to read on input. > > This is because standard input is now /dev/null so it cannot read the > passphrase. In Cryptsetup, the ‘tools_get_key’ function reads this: --8<---------------cut here---------------start------------->8--- if (tools_is_stdin(key_file)) { if (isatty(STDIN_FILENO)) { if (keyfile_offset) { log_err(_("Cannot use offset with terminal input.")); } else { if (!prompt && !crypt_get_device_name(cd)) snprintf(tmp, sizeof(tmp), _("Enter passphrase: ")); else if (!prompt) { backing_file = crypt_loop_backing_file(crypt_get_device_name(cd)); snprintf(tmp, sizeof(tmp), _("Enter passphrase for %s: "), backing_file ?: crypt_get_device_name(cd)); free(backing_file); } r = crypt_get_key_tty(prompt ?: tmp, key, key_size, timeout, verify, cd); } } else { log_dbg("STDIN descriptor passphrase entry requested."); /* No keyfile means STDIN with EOL handling (\n will end input)). */ r = crypt_keyfile_device_read(cd, NULL, key, key_size, keyfile_offset, keyfile_size_max, key_file ? 0 : CRYPT_KEYFILE_STOP_EOL); } } --8<---------------cut here---------------end--------------->8--- isatty(3) would return 0 when stdin is /dev/null; simply binding stdin to /dev/console: (with-input-from-file "/dev/console" (lambda () (system* "cryptsetup" …))) wouldn’t help, for reasons that are less clear to me¹. The attached patch solves the ‘cryptsetup open’ problem for the case when ‘cryptsetup’ is invoked from shepherd—e.g., for an encrypted /home. I’m now running the “encrypted-root-os” test. I’m not sure how to test fsck interactivity though; ideas welcome. If you’re reading this and would like to test it on the bare metal (worst case is it fails to boot and you have to reboot into the older generation), that’s also much appreciated. Feedback welcome! Thanks, Ludo’. ¹ This returns true: sudo strace -f -o ,,s guile -c '(with-input-from-file "/dev/console" (lambda () (system* "guile" "-c" "(pk (isatty? (current-input-port)))")))'