LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 01-15-2020, 03:59 AM   #1
pipolin
LQ Newbie
 
Registered: Jan 2020
Posts: 3

Rep: Reputation: Disabled
Prelink error message on CentOS


That's the mail i often get when Anacron plays prelink on CentOS VM :


/etc/cron.daily/prelink:

/usr/bin/ldd: line 163: /lib/ld-linux.so.2: Permission denied


Impossible to identify an execution missing attribute on any file or any library involved on a binary. Any idea ?

See below :



# cd /lib
# ll ld-linux.so.2
lrwxrwxrwx. 1 root root 9 Apr 27 2012 ld-linux.so.2 -> ld-2.5.so
# ll ld-2.5.so
-rwxr-xr-x. 1 root root 130860 Apr 27 2012 ld-2.5.so


# cat /etc/cron.daily/prelink


#!/bin/sh

. /etc/sysconfig/prelink

renice +19 -p $$ >/dev/null 2>&1

if [ "$PRELINKING" != yes ]; then
if [ -f /etc/prelink.cache ]; then
echo /usr/sbin/prelink -uav > /var/log/prelink/prelink.log
/usr/sbin/prelink -uav >> /var/log/prelink/prelink.log 2>&1 \
|| echo Prelink failed with return value $? >> /var/log/prelink/prelink.log
rm -f /etc/prelink.cache
# Restart init if needed
[ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
fi
exit 0
fi

if [ ! -f /etc/prelink.cache -o -f /var/lib/prelink/force ] \
|| grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then
# If cache does not exist or is from older prelink versions or
# if we were asked to explicitely, force full prelinking
rm -f /etc/prelink.cache /var/lib/prelink/force
PRELINK_OPTS="$PRELINK_OPTS -f"
date > /var/lib/prelink/full
cp -a /var/lib/prelink/{full,quick}
elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
-a "`find /var/lib/prelink/full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \
= /var/lib/prelink/full ]; then
# If no more than PRELINK_NONRPM_CHECK_INTERVAL days elapsed from last prelink
# (be it full or quick) and no packages have been upgraded via rpm since then,
# don't do anything.
[ "`find /var/lib/prelink/quick -mtime -${PRELINK_NONRPM_CHECK_INTERVAL:-7} 2>/dev/null`" \
-a -f /var/lib/rpm/Packages \
-a /var/lib/rpm/Packages -ot /var/lib/prelink/quick ] && exit 0
date > /var/lib/prelink/quick
# If prelink without -q has been run in the last
# PRELINK_FULL_TIME_INTERVAL days, just use quick mode
PRELINK_OPTS="$PRELINK_OPTS -q"
else
date > /var/lib/prelink/full
cp -a /var/lib/prelink/{full,quick}
fi

echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink/prelink.log
/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink/prelink.log 2>&1 \
|| echo Prelink failed with return value $? >> /var/log/prelink/prelink.log
# Restart init if needed
[ -n "$(find `ldd /sbin/init | awk 'NF == 4 { print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u

exit 0

# cat /usr/bin/ldd
#! /bin/bash
# Copyright (C) 1996-2008, 2009, 2010 Free Software Foundation, Inc.
# This file is part of the GNU C Library.

# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

# The GNU C Library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.

# You should have received a copy of the GNU Lesser General Public
# License along with the GNU C Library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.


# This is the `ldd' command, which lists what shared libraries are
# used by given dynamically-linked executables. It works by invoking the
# run-time dynamic linker as a command and setting the environment
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.

# We should be able to find the translation right at the beginning.
TEXTDOMAIN=libc
TEXTDOMAINDIR=/usr/share/locale

RTLDLIST="/lib/ld-linux.so.2 /lib64/ld-linux-x86-64.so.2"
warn=
bind_now=
verbose=

while test $# -gt 0; do
case "$1" in
--vers | --versi | --versio | --version)
echo 'ldd (GNU libc) 2.12'
printf $"Copyright (C) %s Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
" "2010"
printf $"Written by %s and %s.
" "Roland McGrath" "Ulrich Drepper"
exit 0
;;
--h | --he | --hel | --help)
echo $"Usage: ldd [OPTION]... FILE...
--help print this help and exit
--version print version information and exit
-d, --data-relocs process data relocations
-r, --function-relocs process data and function relocations
-u, --unused print unused direct dependencies
-v, --verbose print all information
"
echo $"For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
"
exit 0
;;
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
--data-rel | --data-relo | --data-reloc | --data-relocs)
warn=yes
shift
;;
-r | --f | --fu | --fun | --func | --funct | --functi | --functio | \
--function | --function- | --function-r | --function-re | --function-rel | \
--function-relo | --function-reloc | --function-relocs)
warn=yes
bind_now=yes
shift
;;
-v | --verb | --verbo | --verbos | --verbose)
verbose=yes
shift
;;
-u | --u | --un | --unu | --unus | --unuse | --unused)
unused=yes
shift
;;
--v | --ve | --ver)
echo >&2 $"ldd: option \`$1' is ambiguous"
exit 1
;;
--) # Stop option processing.
shift; break
;;
-*)
echo >&2 'ldd:' $"unrecognized option" "\`$1'"
echo >&2 $"Try \`ldd --help' for more information."
exit 1
;;
*)
break
;;
esac
done

nonelf ()
{
# Maybe extra code for non-ELF binaries.
return 1;
}

add_env="LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now"
add_env="$add_env LD_LIBRARY_VERSION=\$verify_out"
add_env="$add_env LD_VERBOSE=$verbose"
if test "$unused" = yes; then
add_env="$add_env LD_DEBUG="$LD_DEBUG${LD_DEBUG:+,}unused""
fi

# The following use of cat is needed to make ldd work in SELinux
# environments where the executed program might not have permissions
# to write to the console/tty. But only bash 3.x supports the pipefail
# option, and we don't bother to handle the case for older bash versions.
if set -o pipefail 2> /dev/null; then
try_trace() {
eval $add_env '"$@"' | cat
}
else
try_trace() {
eval $add_env '"$@"'
}
fi

case $# in
0)
echo >&2 'ldd:' $"missing file arguments"
echo >&2 $"Try \`ldd --help' for more information."
exit 1
;;
1)
single_file=t
;;
*)
single_file=f
;;
esac

result=0
for file do
# We don't list the file name when there is only one.
test $single_file = t || echo "${file}:"
case $file in
*/*) :
;;
*) file=./$file
;;
esac
if test ! -e "$file"; then
echo "ldd: ${file}:" $"No such file or directory" >&2
result=1
elif test ! -f "$file"; then
echo "ldd: ${file}:" $"not regular file" >&2
result=1
elif test -r "$file"; then
test -x "$file" || echo 'ldd:' $"\
warning: you do not have execution permission for" "\`$file'" >&2
RTLD=
ret=1
for rtld in ${RTLDLIST}; do
if test -x $rtld; then
verify_out=`${rtld} --verify "$file"`
ret=$?
case $ret in
[02]) RTLD=${rtld}; break;;
esac
fi
done
case $ret in
1)
# This can be a non-ELF binary or no binary at all.
nonelf "$file" || {
echo $" not a dynamic executable"
result=1
}
;;
0|2)
try_trace "$RTLD" "$file" || result=1
;;
*)
echo 'ldd:' ${RTLD} $"exited with unknown exit code" "($ret)" >&2
exit 1
;;
esac
else
echo 'ldd:' $"error: you do not have read permission for" "\`$file'" >&2
result=1
fi
done

exit $result
# Local Variables:
# mode:ksh
# End:

# lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarchrinting-4.0-amd64rinting-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.2 (Final)
Release: 6.2
Codename: Final
 
Old 01-16-2020, 01:27 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,495

Rep: Reputation: 4312Reputation: 4312Reputation: 4312Reputation: 4312Reputation: 4312Reputation: 4312Reputation: 4312Reputation: 4312Reputation: 4312Reputation: 4312Reputation: 4312
duplicate of https://www.linuxquestions.org/quest...os-4175667690/
would be nice to use code tags otherwise hard to read.
I would say your installation is somehow corrupted. in general ldd should work.
 
Old 01-16-2020, 01:57 PM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 8,302
Blog Entries: 13

Rep: Reputation: 3696Reputation: 3696Reputation: 3696Reputation: 3696Reputation: 3696Reputation: 3696Reputation: 3696Reputation: 3696Reputation: 3696Reputation: 3696Reputation: 3696
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Prelink error message on CentOS pipolin Linux - Software 0 01-15-2020 05:45 PM
prelink configuration error :: fatal error: ac_nonexistent.h: No such file or direct jubitaneja Linux - Software 4 04-13-2012 09:55 AM
prelink,elfutils,winex,slack,error=21 and all that jazz SticklerThe1st Slackware 7 11-26-2004 09:01 AM
prelink error: `PT_GNU_STACK' undeclared vbbjq Slackware 7 08-23-2004 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration