[SOLVED] User input during rc.local?

General support questions
Post Reply
inthane
Posts: 3
Joined: 2013/05/07 16:54:39

[SOLVED] User input during rc.local?

Post by inthane » 2013/05/08 18:48:20

Greetings,

I'm attempting to mount an encrypted drive during the execution of the rc.local file. It prompts for a password, but upon the second keypress, it appears to be receiving a crlf (or whatever) and attempts to unlock the drive - failing, since I wasn't silly enough to encrypt it with a two character passcode. The actual code looks like this:

losetup /dev/loop0 /mnt/nas/dmcrypt.fs
cryptsetup luksOpen /dev/loop0 nasfs
mount /dev/mapper/nasf /mnt/share sync

(And yes, I recognize that this isn't sane - this was a POC before I start doing actual error checking)

Running /etc/rc.local manually after logging in succeeds, with a single error ("losetup: /dev/loop0: device is busy" - expected, since this was created during boot) that isn't blocking and the file system mounts just fine. Any thoughts about how to collect user input during startup?

(In case people are wondering about the use case, and might have some advice about how I could better structure things, we have a bunch of Iomega devices which we want to present as encrypted devices shared out over NFS. The devices themselves do not support NFS, so we're putting a VMWare appliance on the machine which mounts the Iomega device, then mounts the pregenerated dmcrypt file on the hard drive, then shares it out via NFS. No, installing FreeNAS isn't an option - the hardware doesn't support it, and no, we won't be buying new hardware. Yes, I tilt at windmills pretty often, and there's copious amounts of duct tape holding things together here, why do you ask?)

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

[SOLVED] User input during rc.local?

Post by gerald_clark » 2013/05/08 19:06:58

You cannot run interactive scripts from rc.local unless you first run 'plymouth quit'.

inthane
Posts: 3
Joined: 2013/05/07 16:54:39

Re: [SOLVED] User input during rc.local?

Post by inthane » 2013/05/08 19:34:48

Thanks, that fixed it!

Post Reply

Return to “CentOS 6 - General Support”