stty: error occurs when installing rpm

Hello All,

when I install rpm

rpm --install rpm packagename

I got the following errors

stty:standard input:invalid argument
stty:standard input:invalid argument

I dont know what i have to do exactly.
I search on google for the same but not a particular standard solution is given

please help me to overcome this problem

Regards,
Amit

Usually this is because some user (maybe root) has some stty commands in their .profile or .bash_profile or .bashrc, usually something like stty erase ^H.

You can safely ignore those messages, however if you like to be tidy you can prevent them from coming up by changing them as follows:

# only use stty if stdin is a terminal
[[ -t 0 ]] && stty erase ^H

It is a good idea to do this as well if you have some software that analyses the output of some commands and does not expect these "stty:standard input:invalid argument" messages.

Helo thx for yr reply

I have changed
cd /home/sroot
.bashrc
.bash_profile
cd /etc

profile
bashrc

but still got the same error

Regards,
Amit

What RPM are you installing? Maybe it executes its install scripts under another user ID.

Helo thx for replying me.

I m installing my own build RPM .

I m making rpm on my build machine.

after that I install it from my installer script using root user

Regards,
Amit

What do you have in the %pre and %post sections of your spec file?

Helo thx for replying me.

I have following in the %pre

%prep
echo 'Prep' $RPM_BUILD_ROOT
%setup -q
%{__cat} <<EOF >%{_tmppath}/find_requires
#! /bin/sh
exec %{__find_requires} | /bin/egrep -v 'libclntsh.so.10.1' | /bin/egrep -v 'libnnz10.so'
exit 0
EOF
chmod +x %{_tmppath}/find_requires
%define _use_internal_dependency_generator 0
%define __find_requires %{_tmppath}/find_requires

%build
echo 'Build' $RPM_BUILD_ROOT
[ ${RPM_BUILD_ROOT} != "/" ] && rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT

I have following in the %post

%post
export SW_SOFTWARE_SPEC="%{name},COMPONENT,r=%{version}"
export FILESET="COMPONENT"
export PRODUCT="%{name}"
%{pdsdir}/shell/COMPONENT/postinstall && %{pdsdir}/shell/COMPONENT/configure

Regards,
Amit

%prep is not the same as %pre... maybe there is no %pre section?

It's possible that the %{pdsdir}/shell/COMPONENT/postinstall or .../configure are causing those error messages; have you checked them for stty or su username -c '...' commands?

right %pre section is not present in spec file.

and I have not check for stty command.
I dont know how to check for stty command
can u tell me how i check for stty ?

Regards,
Amit

Just look in those scripts and see if it is there. Or maybe use grep if they are very long.

Hi Annihilannic,
thx for yr reply.

I do grep on all those script for stty but its not found.
if you want to see all .profile then also i can send you.

Regards,
Amit

Try changing this line as follows:

sh -x %{pdsdir}/shell/COMPONENT/postinstall && sh -x %{pdsdir}/shell/COMPONENT/configure

Then try rebuilding and installing the RPM, and hopefully it will give us a clue about when the stty errors are being triggered.

Hello Annihilannic,

Thanks for yr reply.

I done sh -x %{pdsdir}/shell/COMPONENT/postinstall && sh -x %{pdsdir}/shell/COMPONENT/configure

I found one things that I have total 10 rpm package and I got this stty error message in particular one packages.

another observation is that under configure function I m running

different shell scripts using su - admin -c commands..

when I install this particular package I got the following messages.

rpm -install  DBASE-4.1.0.0.23-4.1.0.0.23-1.i386.rpm

export VDIR=/opt/avaya/pds
+ VDIR=/opt/avaya/pds
+ export VOICEDIR=/opt/avaya/pds
+ VOICEDIR=/opt/avaya/pds
+ export PATH=/usr/bin:/usr/rbin:/usr/sbin:/opt/avaya/pds/bin:/opt/avaya/pds/shell:::/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
+ PATH=/usr/bin:/usr/rbin:/usr/sbin:/opt/avaya/pds/bin:/opt/avaya/pds/shell:::/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
+ export ORACLE_HOME=/opt/dbase/OraHome1
+ ORACLE_HOME=/opt/dbase/OraHome1
+ exitval=0
++ /bin/basename /opt/avaya/pds/shell/DBASE/configure
+ FNAME=configure
+ print 'NOTE: Executing DBASE "configure"'

/bin/basename /opt/avaya/pds/shell/MTDBASE/configure
+ FNAME=configure
+ print 'NOTE: Executing MTDBASE "configure"'
/opt/avaya/pds/shell/MTDBASE/configure: line 279: print: command not found
+ case $FNAME in
+ configure
+ exitval=0
+ su - admin -c /opt/avaya/pds/etc/start_db
stty: standard input: Invalid argument
stty: standard input: Invalid argument
stdin: is not a tty
stty: standard input: Invalid argument

now tell me what should i do

Regards,
Amit

Well this is obviously the part that is causing the problem:

+ su - admin -c /opt/avaya/pds/etc/start_db
stty: standard input: Invalid argument
stty: standard input: Invalid argument
stdin: is not a tty
stty: standard input: Invalid argument

So have a look at the admin user's profile scripts, that is probably where you will find the stty commands. You can safely ignore those errors if you wish, but they look messy. You could also consider removing the - from the su command if you don't really need to load that user's profile. It is also possible, but unlikely, that the stty commands are in the start_db script.

Note also this error:

+ print 'NOTE: Executing MTDBASE "configure"'
/opt/avaya/pds/shell/MTDBASE/configure: line 279: print: command not found

print is a ksh-specific command, so if your scripts are not going to run under ksh then you should use echo instead.

you are right.
there is no stty command found in start_db .
In admin user .profile there are stty commands found .

like

alias reset='stty erase \^h kill \^u intr \^c'

stty erase \^h kill \^u intr ^C
stty cs8 -istrip -parity

so what action I need to take for this stty

anyway thx very much for yr support.
Regards,
Amit

I already explained what you should do in my post above.

Helo
thx for your support

Now problem is

I need to run start_db and other script as admin user

I changed admin profile where stty command as follow
if [ -t 0 ]
then
stty erase \^h kill \^u intr ^C
fi

but still got the same errors

stty: standard input: Invalid argument
stty: standard input: Invalid argument
stdin: is not a tty
stty: standard input: Invalid argument

One thing is sure that because of admin user profile loaded when these script are running thats why errors occurs.I checked that by removing - from su admin. But I want to run these scripts as admin user thats my requiremnts

Regards,
Amit

Even if you remove the - the scripts are still run as the admin user. I think that is your safest option if the scripts are working like that.