rc.local com leitura não ecoará os pressionamentos de tecla

5

Estou usando o CentOS 6.4 e tenho um pequeno problema com o uso do arquivo read in /etc/rc.local . Ele permitirá a entrada do teclado, mas não ecoará nenhum dos pressionamentos da tecla durante a entrada. Isso é algo que funcionou bem no CentOS 5.5.

Alguém sabe o que está acontecendo aqui?

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
echo -n "name? "
read name
echo "Name: $name"
touch /var/lock/subsys/local

produz ( /var/log/boot.log ):

name? Name: john

    
por GoinOff 17.12.2013 / 22:53

1 resposta

2

Gostaria de saber se este é o seu problema?

Encontrei este tópico do fórum do CentOS intitulado: >.

trecho do problema

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.

A resposta aparente é desabilitar plymouth primeiro.

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

O que é o Plymouth?

trecho de Freedesktop.org

Plymouth is an application that runs very early in the boot process (even before the root filesystem is mounted!) that provides a graphical boot animation while the boot process happens in the background.

It is designed to work on systems with DRM modesetting drivers. The idea is that early on in the boot process the native mode for the computer is set, plymouth uses that mode, and that mode stays throughout the entire boot process up to and after X starts. Ideally, the goal is to get rid of all flicker during startup.

Resolvendo seu problema

Então, acredito que tudo o que você precisa fazer é antes de executar o comando read para usar o comando rc.local :

plymouth quit
    
por 18.12.2013 / 15:06