RHEL 6 Install from RPM

From Rivendell Wiki

Jump to: navigation, search

Contents

Red Hat Enterprise Linux 6 Install from RPM

This guide goes over building RPMs for Rivendell for RHEL 6 using the MakeFile's built in rpm target. wiki copied and adapted from CentOS_6_Notes

Process

I started with a RHEL 6.3 default install, with the "Desktop" preset.

Most of the software build will be done as a regular user. In this guide the regular user is called 'rpmbuild', but use whatever user you like.

Sudo is used to run commands requiring root. You may need to add your user to the wheel group and enable users in the wheel group to run all commands.

# usermod -a -G wheel rpmbuild
# visudo
  • search for 'wheel' in the config file on or about line 96 and edit it so it looks like the following:
## Allows people in group wheel to run all commands
 %wheel ALL=(ALL)       ALL

Alternatively you can substitute su -c 'some command requiring root' if you don't want to configure sudo, or just run it from a shell that is logged in as root.

  • Update your system (and reboot if a new kernel is pulled in)
$ sudo yum update -y
$ wget http://www.rivendellaudio.org/ftpdocs/rivendell/rivendell-2.2.0.tar.gz

Repository Sources

  • RHN Supplementary and Optional Channels required for some devel packages (libsamplerate-devel for example) and for EPEL repo
$ sudo yum-config-manager --enable rhel-6-server-supplementary
$ sudo yum-config-manager --enable rhel-6-server-optional-rpms
  • EPEL required for rpmfusion, soundtouch{-devel}, et al.

Please visit here to get the newest 'epel-release' package for EL6: The newest version of 'epel-release' for EL6

  • Then it would be a command like the following, depending on version at the above link:
$ sudo yum install http://fedora-epel.mirror.lstn.net/6/i386/epel-release-6-7.noarch.rpm

Build Dependencies

Install devel RPMs

  • Core dependencies
$ yum install qt3-devel qt3-MySQL libXmu-devel qt-devel libXi-devel libsamplerate-devel libsndfile-devel cdparanoia-devel id3lib-devel libcurl-devel pam-devel soundtouch-devel
  • Audio encoders/decoders
$ sudo yum install libvorbis-devel flac-devel lame-devel twolame-devel libmad-devel 
  • Audio Drivers
$ yum install alsa-lib-devel jack-audio-connection-kit-devel

Audioscience HPI driver RPM build

$ wget http://www.audioscience.com/internet/download/drivers/released/v4/10/09/hpklinux-4.10.09.tar.bz2
$ tar -xvf hpklinux-4.10.09.tar.bz2
  • In hpklinux.spec.in change line 63 from this:
./configure --prefix=$RPM_BUILD_ROOT@LOCAL_PREFIX@
  • to this:
./configure --prefix=@LOCAL_PREFIX@
  • configure hpklinux
$ ./configure --with-rpmroot=$HOME/rpmbuild
  • install rpmdevtools and setup RPM build environment
$ sudo yum install rpmdevtools
$ rpmdev-setuptree
  • disable checking for rpaths from $HOME/.rpmmacros config file
  • Remove line 3:
%__arch_install_post   /usr/lib/rpm/check-rpaths   /usr/lib/rpm/check-buildroot
  • make the rpm:
$ make rpm
  • install the hpk kernel module rpm and hpk-devel rpm
$ sudo rpm -Uvh hpklinux-4.10.09_2.6.32-279.9.1.el6.x86_64-1.x86_64.rpm hpklinux-devel-4.10.09-1.x86_64.rpm
  • There will probably be an error if you don't actually have an Audioscience card as the kernel module is inserted, it should be safe to ignore:
FATAL: Error inserting asihpi (/lib/modules/2.6.32-279.9.1.el6.x86_64/extra/asihpi.ko): No such device
warning: %post(hpklinux-4.10.09-1.x86_64) scriptlet failed, exit status 1

Building

  • run the configure script to create the Makefile
$ cd $HOME/rivendell-2.2.0
$ ./configure --libexecdir=/var/www/html/
  • If you successfully installed all the development tools and libraries above you should see the following:
configure: 
configure: "|-----------------------------------------------------|"
configure: "|       *** RIVENDELL CONFIGURATION SUMMARY ***       |"
configure: "|-----------------------------------------------------|"
configure: "| Configured Audio Drivers:                           |"
configure: "|  Advanced Linux Sound Architecture (ALSA) ... Yes   |"
configure: "|                          AudioScience HPI ... Yes   |"
configure: "|                 JACK Audio Connection Kit ... Yes   |"
configure: "|                                                     |"
configure: "| Audio Codecs:                                       |"
configure: "|            FLAC Encoding/Decoding Support ... Yes   |"
configure: "|                     MPEG Decoding Support ... Yes   |"
configure: "|             MPEG Layer 2 Encoding Support ... Yes   |"
configure: "|             MPEG Layer 3 Encoding Support ... Yes   |"
configure: "|       OggVorbis Encoding/Decoding Support ... Yes   |"
configure: "|                                                     |"
configure: "| Optional Components:                                |"
configure: "|           Rivendell PAM pam_rd.so Support ... Yes   |"
configure: "|-----------------------------------------------------|"
configure: 
configure: 
configure: Now enter 'make' to build the software.
configure: 
  • The configure script generates a Makefile with wrong RPM_ROOT
  • On or about line 199 change this:
RPM_ROOT = /usr/src/packages
  • to this:
RPM_ROOT = /home/rpmbuild/rpmbuild
  • Build the RPMs:
$ make rpm
  • If all goes well you should end up with the following RPMs:
$ ls *rpm -1
rivendell-2.2.0-1.src.rpm
rivendell-2.2.0-1.x86_64.rpm
rivendell-devel-2.2.0-1.x86_64.rpm
rivendell-importers-2.2.0-1.x86_64.rpm
rivendell-select-2.2.0-1.x86_64.rpm

Installing

  • Install the rivendell RPM
$ sudo yum install rivendell-2.2.0-1.x86_64.rpm
  • An error related to shared libraries will result
/usr/local/bin/rdadmin: error while loading shared libraries: librd-2.2.0.so: cannot open shared object file: No such file or directory
  • Create the shared library config file manually:
$ echo "echo "/usr/local/lib64" > /etc/ld.so.conf.d/rivendell.conf" | sudo sh
  • Rerun ldconfig (rpm post script already ran it but it couldn't find the shared library librd)
$ sudo ldconfig
  • Install and start mysql server
$ sudo yum install mysql-server
$ sudo service mysqld start
  • Set the root user/pass for mysql
$ /usr/bin/mysql_secure_installation
  • run rdadmin and enter the mysql user and pass you just set
  • have fun!

Troubleshooting

QT configure fail

Symptom: When running ./configure...

checking for Qt... yes:
   QT_CXXFLAGS=-I/usr/lib64/qt-3.3/include -DQT_THREAD_SUPPORT
   QT_DIR=/usr/lib64/qt-3.3
   QT_LIBS=-L/usr/lib64/qt-3.3/lib -lqt-mt  -lSM -lICE  -lX11 -lXext -lXmu -lXt -lXi 
   QT_BIN=/usr/lib64/qt-3.3/bin
   QT_UIC=/usr/lib64/qt-3.3/bin/uic
   QT_MOC=/usr/lib64/qt-3.3/bin/moc
checking correct functioning of Qt installation... failure

Solution:

  • Make sure qt for the correct architecture is installed, along with qt-devel, qt-mysql, and the qt3-devel, qt3-MySQL
  • YOU NEED libXmu-devel installed!

Import Error

In RDlibrary when importing audio an error is seen

Import Error

Audio Converter Error: OK

This could be due to SELinux issues with /var/www/html/rdxport.cgi and/or /var/snd

Make sure setroubleshoot, setroubleshoot-server, setroubleshoot-plugins RPMs are installed and reboot and reproduce the error. setroubleshootd will launch and inform you how to fix the problem.

setgid needed on rdxport.cgi

After installing setroubleshoot and related RPMs I found the problem was related to setgid access needed by rdxport.cgi

The solution is to create a custom policy module that allows this access.

SELinux is preventing /var/www/html/rdxport.cgi from using the setgid capability.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that rdxport.cgi should have the setgid capability by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep rdxport.cgi /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:httpd_sys_script_t:s0
Target Context                system_u:system_r:httpd_sys_script_t:s0
Target Objects                 [ capability ]
Source                        rdxport.cgi
Source Path                   /var/www/html/rdxport.cgi
Port                          <Unknown>
Host                          aphrodite.dj.edm
Source RPM Packages           rivendell-2.2.0-1.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-155.el6_3.4.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     aphrodite.dj.edm
Platform                      Linux aphrodite.dj.edm 2.6.32-279.9.1.el6.x86_64
                              #1 SMP Fri Aug 31 09:04:24 EDT 2012 x86_64 x86_64
Alert Count                   1
First Seen                    Tue 09 Oct 2012 03:01:31 PM EDT
Last Seen                     Tue 09 Oct 2012 03:01:31 PM EDT
Local ID                      5b930dd7-7820-47ff-bfc3-5a9d1e78abaf

Raw Audit Messages
type=AVC msg=audit(1349809291.136:34784): avc:  denied  { setgid } for  pid=3053 comm="rdxport.cgi" capability=6  scontext=system_u:system_r:httpd_sys_script_t:s0 tcontext=system_u:system_r:httpd_sys_script_t:s0 tclass=capability


type=SYSCALL msg=audit(1349809291.136:34784): arch=x86_64 syscall=setgid success=no exit=EPERM a0=96 a1=96 a2=7fffc012d660 a3=7fffc012dcf0 items=0 ppid=2233 pid=3053 auid=4294967295 uid=48 gid=48 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=rdxport.cgi exe=/var/www/html/rdxport.cgi subj=system_u:system_r:httpd_sys_script_t:s0 key=(null)

Hash: rdxport.cgi,httpd_sys_script_t,httpd_sys_script_t,capability,setgid

audit2allow

#============= httpd_sys_script_t ==============
allow httpd_sys_script_t self:capability setgid;

audit2allow -R

#============= httpd_sys_script_t ==============
allow httpd_sys_script_t self:capability setgid;

mislabeled /var/snd

Relabel it as so:

$ sudo chcon -R -t  httpd_sys_content_t /var/snd

Rivendell RPM building bugs

  • configure script issue with /etc/redhat-release
  • continues to work and is safely ignorable
checking distribution... RedHat Enterprise
./configure: line 17505: test: Enterprise: integer expression expected
checking vorbis/vorbisfile.h usability... no
checking vorbis/vorbisfile.h presence... no
checking for vorbis/vorbisfile.h... no
./configure: line 17656: test: =: unary operator expected
Personal tools