"bad tty" & "file descriptor error" while building RPM on F13
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"bad tty" & "file descriptor error" while building RPM on F13
Hi,
I have an FC13 x86_64 server and having trouble building RPMs, but I don't think it's specifically an RPM problem. I think it's a tty management or other type of problem.
When spec files have a "%files -f filelist.txt", which contains the list of files for the RPM, it calls the /usr/lib/check-files script, which sorts the files that are supposed to be in the RPM and compares them with the files that are in the built RPM before they are packaged.
The trouble is that the sort fails. Here's the trace from the check-files script:
+ find /root/rpmbuild/BUILDROOT/sed-4.2.1-5.fc13.x86_64 -type f -o -type l
+ LC_ALL=C
+ sort
+ LC_ALL=C
+ sort
sort: stat failed: -: Bad file descriptor
+ diff -d /tmp/rpmv4Db1s /tmp/rpmPdDsKU
The above doesn't show that the output from sort is redirected into those /tmp files. The first sort succeeds because it reads data sent by the "find" in the same shell. The second sort fails because (I think) it cannot read data from stdin for some reason.
What could possibly cause this? I've checked various permissions, libraries, even used strace extensively, all of which is inconclusive.
This is one of my test server boxes, so this problem is something that I've caused, but I have no idea what.
libc controls input and output, correct? Could it somehow be a glibc problem, or a devpts problem? I can run a simple command and pipe it to sort with no problem. It appears to only be related to sub-shells.
I also replaced sort with cat and just tried to redirect stdin in that file to a temporary file, and that also fails.
I've tried running it with selinux disabled and that has no effect.
So I assume it expands these macros to create the temp files that are created by /usr/lib/rpm/check-files:
Code:
FILES_DISK=`mktemp $TMPDIR/rpmXXXXXX`
FILES_RPM=`mktemp $TMPDIR/rpmXXXXXX`
find $RPM_BUILD_ROOT -type f -o -type l | LC_ALL=C sort > $FILES_DISK
LC_ALL=C sort > $FILES_RPM
I assume the second sort receives its data from stdin passed to it by rpm, sorts them, then redirects it to a temporary file before comparing with the actual list from the files on the disk. Is this correct?
I really could use some help. I'd really hate to lose this whole system. I could end up reinstalling and making the same mistake again..
Hi, thanks for your help. This can't be the problem because the files aren't stored in /var/tmp:
Processing files: sed-4.2.1-5.fc13.x86_64
error: Could not open %files file /var/tmp/sed.lang: No such file or directory
It's not having a problem finding the files because when it is left as "%files -f %{name}.lang" it proceeds, but when using %{_tmppath} it quits, as shown above.
When compiling the bash SRPM, I receive a message like:
This is from the check for unpackaged files (/usr/lib/rpm/check-files), and I believe it is related. It prints this broken pipe message after every line it processes with sed.
Code:
+ /bin/sort
/bin/sort: stat failed: -: Bad file descriptor
+ diff -d /tmp/rpm60vSB7 /tmp/rpm9boU0c
+ grep '^< '
+ cut -c3-
+ read f
+ echo /root/rpmbuild/BUILDROOT/bash-4.1.7-1.x86_64/bin/bash
+ sed -e 's#^/root/rpmbuild/BUILDROOT/bash-4.1.7-1.x86_64# #g'
sed: couldn't flush stdout: Broken pipe
I believe this message is related. What could cause this?
How does sed and sort receive the data to stdin from the rpm process?
Interesting. Could you post your complete spec in BB code tags please?
I found a spec file that fails, and it doesn't have the "%files -f %{name}.lang" and still fails. It's from the rpm-4.8.1 SRPM. I've included the full spec and build log.
I think given that it's the spec included with the rpm package, chances are very good it's not a problem with how the spec is created. Note specifically the sort and "sh: no job control" errors.
Thanks,
Alex
Code:
Summary: hello -- hello, world rpm
Name: hello
Version: 1.0
Release: 1
Group: Utilities
License: GPL
Distribution: RPM test suite.
Vendor: Red Hat Software
Packager: Red Hat Software <bugs@redhat.com>
URL: http://www.redhat.com
Source0: hello-1.0.tar.gz
Excludearch: lsi
Excludeos: cpm
Provides: hi
Conflicts: goodbye
Obsoletes: howdy
Prefix: /usr
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
Simple rpm demonstration.
%prep
%setup -q
%build
make
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/usr/local/bin
make DESTDIR=$RPM_BUILD_ROOT install
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%post
%preun
%postun
%files
%defattr(-,root,root)
%doc FAQ
#%readme README
#%license COPYING
%attr(0751,root,root) /usr/local/bin/hello
%changelog
* Tue Oct 20 1998 Jeff Johnson <jbj@redhat.com>
- create.
Apparently you have tried building RPM by hand and because of that helper scripts exist in non-standard directories (/home/packman/rpmbuild/BUILD/rpm-4.8.1/tests/testing//usr/lib/rpm/check-files ?) that may lead to unexpected results. For instance I also see a %buildroot that resolves to "/usr/src/engarde/community-3.0.24/engarde/BUILD/rpm-4.8.1/" somewhere. The output you have shown above means you run all commands from the RPM test suite. More information should be available if you run with the "-dvx" args (see /home/packman/rpmbuild/BUILD/rpm-4.8.1/tests/rpmtests). I wonder if running 'rpmbuild' itself directly builds the package OK (run as 'rpmbuild -vv -bb' for more nfos) and why you are not running rpm-4.8.1-2.fc13.x86_64.rpm because that's what F13 x86_64 comes with?..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.