2012-06-04 8 views
7

사용자로부터 입력을 받아서 인쇄해야하는 작은 데비안 패키지를 만들었습니다.데비안 시스템에 데비안 패키지를 설치할 때 입력을 읽는 방법

postinst 스크립트에서 사용자 "read"명령을 사용하려면 Debian 시스템에서 작동하지 않습니다. 정확한 이유는 모르겠지만 우분투 시스템에서 작동했습니다.

나중에 나는 데비안 시스템에서 템플릿 파일을 사용하여 "debconf"를 사용해야한다는 것을 알아 냈습니다.

템플릿 파일 :

Template: test/input 
Type: text 
Description: enter some text, which will be displayed 

는 postinst 스크립트를

Can't exec "postinst": No such file or directory at /usr/share/perl/5.10/IPC/Open3.pm line 168. <br>open2: exec of postinst configure failed at /usr/share/perl5/Debconf/ConfModule.pm line 59

사람이 내가 한 일을 알고 있습니까 :

db_get test/input 
    echo "you have entered ::$RET" >&2 

하지만 내 테스트 패키지를 설치할 때이 오류가 잘못된?

+0

, 내가 놓친 설정 스크립트와 설정 스크립트에 에코 문을 피하기 –

답변

1

귀하의 는 postinst 스크립트는 다음과 같아야합니다 : 난 내 자신의 문제를 해결 한

#!/bin/bash 

set -e 

. /usr/share/debconf/confmodule 

case "$1" in 
    configure) 
    db_get test/input 
    echo "you have entered ::$RET" >&2 
    ;; 
esac 
db_stop