[systemd-devel] Text input on startup (tty-force) disabling after a few seconds

Tom Gundersen teg at jklm.no
Wed Jun 19 10:39:30 PDT 2013


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

Didn't cryptsetup recently get TC support? Could you use that (i.e.
/etc/crypttab?

Tom
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130619/639bbba8/attachment.html>


More information about the systemd-devel mailing list