<p dir="ltr">Didn't cryptsetup recently get TC support? Could you use that (i.e. /etc/crypttab?<br>
On Jun 19, 2013 6:01 PM, "Peeters Simon" <<a href="mailto:peeters.simon@gmail.com">peeters.simon@gmail.com</a>> wrote:<br>
><br>
> 2013/6/19 Natanji <<a href="mailto:natanji@gmail.com">natanji@gmail.com</a>>:<br>
> > Hi everyone,<br>
> > I'm somewhat new to systemd and have a problem. I would like to run a<br>
> > custom script with systemd on startup that will ask me for a password<br>
> > and mount a Truecrypt volume with it. The script and unit file I wrote<br>
> > can be found below.<br>
> ><br>
> > Now, this setup does work *somewhat* - basically it will ask me for my<br>
> > Truecrypt password on startup and do the mounting as it should. But when<br>
> > I wait a few seconds during startup, entering the password no longer<br>
> > works. I just have a few seconds after the password prompt appearing to<br>
> > enter it; if I wait 5-10 seconds nothing will happen anymore.<br>
> ><br>
> > That seems like weird and unintended behaviour to me. Is this a bug, or<br>
> > can you point me in the right direction about what I'm doing wrong if I<br>
> > want some sort of keyboard interaction during system startup with<br>
> > systemd? I mean, that is a useful and sometimes needed feature, right?<br>
> ><br>
> ><br>
> ><br>
> > Unit file:<br>
> > -----------<br>
> > [Unit]<br>
> > Description=Mount Truecrypt-encrypted filesystems<br>
> > ConditionFileIsExecutable=/usr/bin/truecrypt<br>
> > Requires=truecrypt-unmount.service<br>
> > Before=display-manager.service<br>
> ><br>
> > [Service]<br>
> > Type=oneshot<br>
> > ExecStart=/etc/mount_truecrypt<br>
> > StandardInput=tty-force<br>
> > RemainAfterExit=yes<br>
> ><br>
> > [Install]<br>
> > WantedBy=multi-user.target<br>
> ><br>
> > /etc/mount_truecrypt:<br>
> > -----------<br>
> > #!/bin/bash<br>
> > sudo echo Please enter the password to mount your TrueCrypt volumes...<br>
> > stty -echo<br>
> > read password<br>
> > stty echo<br>
> > echo C:<br>
> > echo $password | sudo truecrypt -t -k ""<br>
> > --fs-options="rw,exec,users,async,uid=root,gid=users,umask=077,noatime"<br>
> > --mount-options=system --protect-hidden=no /dev/sda1 /media/C > /dev/null<br>
> > echo ...done.<br>
><br>
> It might be a bug in the tty-force handling, but this is not a usecase<br>
> for tty-force, you would be better of using systemd-ask-password<br>
><br>
> I sugest you drop the StandardInput=tty-force from the service file<br>
> and use this as /etc/mount_truecrypt</p>
<p dir="ltr">Didn't cryptsetup recently get TC support? Could you use that (i.e. /etc/crypttab?</p>
<p dir="ltr">Tom</p>