You are not logged in.

#1 2012-10-28 14:48:03

nasosnik
Member
From: Athens - Greece
Registered: 2011-03-10
Posts: 27

Systemd truecrypt service no stdin

I have created a truecrypt unit according to the wiki, in order to mount an encrypted volume upon system boot. With initscripts i just used an entry at /etc/rc.local and /etc/rc.local.shutdown.

The problem is that the service starts as it should and prompts me for a password during boot, but it seems that it doesn't accept stdin from keyboard although i use the "StandardInput=tty-force" option. Any suggestions?

[Unit]
Description=Mount Truecrypt-encrypted filesystem
ConditionFileIsExecutable=/usr/bin/truecrypt
 
[Service]
Type=oneshot
ExecStart=/usr/bin/truecrypt -k "" --protect-hidden=no /path/to/file.tc /mount/point
StandardInput=tty-force
RemainAfterExit=yes
 
[Install]
WantedBy=multi-user.target

Offline

#2 2012-10-28 15:15:09

guelfi
Member
From: /home/guelfi
Registered: 2011-07-01
Posts: 111

Re: Systemd truecrypt service no stdin

I don't know whether this helps, but systemd provides a program named systemd-ask-password. Maybe you should write a script using this.

Offline

#3 2012-10-28 15:15:52

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Systemd truecrypt service no stdin

Offline

#4 2012-11-03 14:47:44

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: Systemd truecrypt service no stdin

I don't know why, but this script work son one of my Arch installs, and *not* on the other. The only real difference at that point would be the bootloader. You don't happen to be using grub-legacy?

Offline

#5 2012-11-08 23:00:12

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: Systemd truecrypt service no stdin

Has anyone figured this out? I've tried the truecrypt service and truecrypt mount variations of systemd services from the Arch wiki with no success. I've been trying to test them from a terminal with no success. With the service variant, I named it truecrypt@.service and tried enabling via truecrypt@dev-sda4.service and it doesn't think there's such a file.

I also tried using ExecStartPre=systemd-ask-password "Please enter truecrypt password" as well as the same option for ExecStartPost and had no success.

Really would like this to work...

Re. the bootloader, I'm on grub legacy. I can try on my other computer, which is using syslinux.

Offline

#6 2012-11-10 16:32:16

nasosnik
Member
From: Athens - Greece
Registered: 2011-03-10
Posts: 27

Re: Systemd truecrypt service no stdin

Natanji wrote:

I don't know why, but this script work son one of my Arch installs, and *not* on the other. The only real difference at that point would be the bootloader. You don't happen to be using grub-legacy?

I am indeed using grub-lagacy, but afaik it has nothing to do with stdin upon boot. Boot loader is responsible only for loading kernel into memory...

Offline

#7 2012-11-11 21:42:59

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: Systemd truecrypt service no stdin

All I can say is that it works on my laptop which has grub2 installed. But perhaps the difference is not grub2, but the simple fact of the laptop's keyboard being connected via PS/2 and not USB like with my desktop (which has grub-legacy and where the input does NOT work).

Offline

#8 2012-11-11 22:28:14

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: Systemd truecrypt service no stdin

Did anyone actually follow up the link falcondy provided? I noticed that the wiki still suggests a method which that thread recommends against (e.g. tty-force).


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2012-11-12 10:13:36

Natanji
Member
Registered: 2009-09-22
Posts: 133

Re: Systemd truecrypt service no stdin

I don't really know how to go without tty-force, since I have no clue how to use "systemd-ask-password" instead... some help would be greatly appreciated.

Offline

#10 2013-01-22 14:47:27

popso
Member
Registered: 2012-07-15
Posts: 17

Re: Systemd truecrypt service no stdin

It works !
The important part is to modify fstab because it stops the boot process to let you type your password.

Offline

Board footer

Powered by FluxBB