After installation of Oracle in silent mode, I am not able to run SQLPLUS - linux

Showing the error
/oracle/product/12.1.0/dbhome_1/bin/sqlplus: error while loading shared libraries: /oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1: file too short
[oracle#82eb40bf3cd2 ~]$ strace $ORACLE_HOME/bin/sqlplus
execve("/oracle/product/12.1.0/dbhome_1/bin/sqlplus", ["/oracle/product/12.1.0/dbhome_1/"...], 0x7ffd4df2e550 /* 23 vars */) = 0
brk(NULL) = 0xd63000
arch_prctl(0x3001 /* ARCH_??? */, 0x7fffa311c1b0) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/tls/haswell/x86_64/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/tls/haswell/x86_64", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/tls/haswell/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/tls/haswell", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/tls/x86_64/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/tls/x86_64", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/tls/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/tls", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/haswell/x86_64/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/haswell/x86_64", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/haswell/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/haswell", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/x86_64/libsqlplus.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/oracle/product/12.1.0/dbhome_1/lib/x86_64", 0x7fffa311b400) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/libsqlplus.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\374\1\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1546540, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f664e6da000
mmap(NULL, 3112424, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f664e1bc000
mprotect(0x7f664e2a6000, 2093056, PROT_NONE) = 0
mmap(0x7f664e4a5000, 61440, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xe9000) = 0x7f664e4a5000
close(3) = 0
openat(AT_FDCWD, "/oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "", 832) = 0
close(3) = 0
writev(2, [{iov_base="/oracle/product/12.1.0/dbhome_1/"..., iov_len=43}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="/oracle/product/12.1.0/dbhome_1/"..., iov_len=53}, {iov_base=": ", iov_len=2}, {iov_base="file too short", iov_len=14}, {iov_base="", iov_len=0}, {iov_base="", iov_len=0}, {iov_base="\n", iov_len=1}], 10/oracle/product/12.1.0/dbhome_1/bin/sqlplus: error while loading shared libraries: /oracle/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1: file too short
) = 153
exit_group(127) = ?
+++ exited with 127 +++

This error comes mostly due to missing rpm packages glib-devel on the system.
On my system the issue got resolved after below operations:
Installing the correct rpm for glib
Then run this command to recreate all the symlinks.
$ORACLE_HOME/bin/relink all
Try sqlplus now.

You are trying to install oracle on an unsupported platform. Your version of oracle 12.1.0.2 supports linux 7. At present the Oracle database is not supported on Linux 8.
Unofficially Oracle Database 19c Installation On Oracle Linux 8 (OL8)
Oracle Linux 7 and Red Hat Enterprise Linux 7 Support Information on Linux x86-64
Starting with Oracle Database 12c Release 1 (12.1.0.2), Oracle Linux 7
and Red Hat Enterprise Linux 7 are supported on Linux x86-64 systems.
Starting with Oracle Database 12c Release 1 (12.1.0.2), Oracle Linux 7
is supported on the following distributions for Linux x86-64:
Oracle Linux 7 with the Unbreakable Enterprise kernel:
4.1.12-61.el7uek.x86_64 or later
Oracle Linux 7 with the Unbreakable Enterprise kernel:
3.8.13-33.el7uek.x86_64 or later
Oracle Linux 7 with the Red Hat Compatible kernel:
3.10.0-123.el7.x86_64 or later
Operating System Checklist for Oracle Database 19c Installation on Linux
The following Linux x86-64 kernels are supported:
Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 4:
4.1.12-124.19.2.el7uek.x86_64 or later Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 5: 4.14.35-1818.1.6.el7uek.x86_64 or
later Oracle Linux 7.5 with the Red Hat Compatible kernel:
3.10.0-862.11.6.el7.x86_64 or later
Red Hat Enterprise Linux 7.5: 3.10.0-862.11.6.el7.x86_64 or later
SUSE Linux Enterprise Server 12 SP3: 4.4.162-94.72-default or later
SUSE Linux Enterprise Server 15: 4.12.14-23-default or later
Review the system requirements section for a list of minimum package
requirements.

Related

How to create/install a custom keyboard layout in Linux

I'm trying to use a custom keyboard layout variant on my linux machine. In the past, I used to modify the /usr/share/X11/xkb files (evdev.lst, evdev.xml, symbols/de) which worked well for years. But recently I switched my distro (now Opensuse Tumbleweed) which has some more "dynamics" in the xkb package thus overwriting my changes with almost every update :(
I'm well aware that changing files inside /usr/share/X11/xkb cannot be the recommended way as it's part of a maintained package. But did not manage to find a working alternative. As stated here https://lists.freedesktop.org/archives/wayland-devel/2020-January/041133.html, XKB should look in $HOME/.xkb as well as in $HOME/.config/xkb, but it seems, it doesnt:
$ setxkbmap -v 10 de colemak
Setting verbose level to 10
locale is C
Warning! Multiple definitions of keyboard layout
Using command line, ignoring X server
Warning! Multiple definitions of layout variant
Using command line, ignoring X server
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules: evdev
model: pc86
layout: de
variant: colemak
options: terminate:ctrl_alt_bksp,grp:alt_shift_toggle
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwertz)
types: complete
compat: complete
symbols: pc+de(colemak)+inet(evdev)+terminate(ctrl_alt_bksp)+group(alt_shift_toggle)+terminate(ctrl_alt_bksp)
geometry: pc(pc86)
Error loading new keyboard description
The same is happening when I use the -I command line argument with setxkbmap. strace confirms the output above:
$ strace setxkbmap -v 10 de colemak |& grep open
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libxkbfile.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libX11.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libxcb.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib64/libXau.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/run/user/1000/xauth_ZOJrbC", O_RDONLY) = 4
openat(AT_FDCWD, "./rules/evdev-C.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "./rules/evdev.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev-C.lst", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev.lst", O_RDONLY) = 4
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev-C", O_RDONLY) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/share/X11/xkb/rules/evdev", O_RDONLY) = 4
Any idea how to get custom keyboard layout running?
Any help appreciated :) Thank you!
Greetings

Pipe between bash 'yes' command and netcat breaks with nc: Address already in Use

I'm trying to write a simple script that loads my localhost network by setting up a netcat listener and piping random data to netcat broadcaster. My script is simple:
nc -l 2020 > /dev/null &
yes SOME_VERY_LARGE_STRING | nc localhost 2020 > /dev/null
Running each of those commands in different terminal windows has the desired effect. However, running from a bash script results in some data being transmitted before a SIGPIPE signal being sent to yes. This broken pipe can be verified by replacing the above with:
strace yes SOME_VERY_LARGE_STRING | nc localhost 2020 > /dev/null
which results in the following output:
execve("/usr/bin/yes", ["yes", "SOME_VERY_LARGE_STRING"], [/* 75 vars */]nc: Address already in use
) = 0
brk(0) = 0x1d53000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04f185b000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/home/eddy/OpenSource/ros_packages/devel/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/eddy/OpenSource/ros_packages/devel/lib/tls/x86_64", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/home/eddy/OpenSource/ros_packages/devel/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/eddy/OpenSource/ros_packages/devel/lib/tls", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/home/eddy/OpenSource/ros_packages/devel/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/eddy/OpenSource/ros_packages/devel/lib/x86_64", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/home/eddy/OpenSource/ros_packages/devel/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/home/eddy/OpenSource/ros_packages/devel/lib", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
open("/opt/ros/indigo/lib/tls/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/ros/indigo/lib/tls/x86_64", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/opt/ros/indigo/lib/tls/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/ros/indigo/lib/tls", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/opt/ros/indigo/lib/x86_64/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/ros/indigo/lib/x86_64", 0x7fff4531cc20) = -1 ENOENT (No such file or directory)
open("/opt/ros/indigo/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/opt/ros/indigo/lib", {st_mode=S_IFDIR|0755, st_size=16384, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=165844, ...}) = 0
mmap(NULL, 165844, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f04f1832000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P \2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1857312, ...}) = 0
mmap(NULL, 3965632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f04f1272000
mprotect(0x7f04f1430000, 2097152, PROT_NONE) = 0
mmap(0x7f04f1630000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1be000) = 0x7f04f1630000
mmap(0x7f04f1636000, 17088, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f04f1636000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04f1831000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04f182f000
arch_prctl(ARCH_SET_FS, 0x7f04f182f740) = 0
mprotect(0x7f04f1630000, 16384, PROT_READ) = 0
mprotect(0x605000, 4096, PROT_READ) = 0
mprotect(0x7f04f185d000, 4096, PROT_READ) = 0
munmap(0x7f04f1832000, 165844) = 0
brk(0) = 0x1d53000
brk(0x1d74000) = 0x1d74000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=7216688, ...}) = 0
mmap(NULL, 7216688, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f04f0b90000
close(3) = 0
fstat(1, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f04f185a000
write(1, "SOME_VERY_LARGE_STRING\nSOME_VERY"..., 4096) = -1 EPIPE (Broken pipe)
--- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=11094, si_uid=1000} ---
+++ killed by SIGPIPE +++
It would appear that netcat is failing with Address already in use. Why would that happen?

How does bash knows to read autocomple from /usr/lib/git-core/

I installed git-flow, which copied some bash scripts to /usr/lib/git-core/ which are now available in bash complete.
I know that bash reads the following directories looking for autocomplete scripts:
/etc/bash_completion.d/
/usr/share/bash-completion/
What makes bash aware to those new scripts?
I installed git-flow from the debian repositories, and I am trying to understand what makes this package ticks.
I did not succeed in finding where bash determines it needs to read this directory. Looking through /usr/share/bash-completion/completions/git did not help either.
update
Looking around, it seems that /usr/git-core/git and /usr/bin/git are the same binary file:
~ $ file /usr/bin/git
/usr/bin/git: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=4f634dadca99fb29ed72568d5604df087d6e6502, stripped
~ $ file /usr/lib/git-core/git
/usr/lib/git-core/git: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=4f634dadca99fb29ed72568d5604df087d6e6502, stripped
OK, given the hint from Etan, it seems, that what seems to be a bash completion is actually a git completion. As far why /usr/lib/git-core is search, strace shows that it's hard coded when configuring and building the package:
execve("/usr/bin/git", ["git", "help", "-a"], [/* 73 vars */]) = 0
brk(0) = 0xab4000
...
openat(AT_FDCWD, "/usr/lib/git-core", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
getdents(3, /* 169 entries */, 32768) = 6192
stat("/usr/lib/git-core/git-fetch-pack", {st_mode=S_IFREG|0755, st_size=1577256, ...}) = 0
stat("/usr/lib/git-core/git-web--browse", {st_mode=S_IFREG|0755, st_size=4398, ...}) = 0
stat("/usr/lib/git-core/git-upload-archive", {st_mode=S_IFREG|0755, st_size=1577256, ...}) = 0
stat("/usr/lib/git-core/git-credential-store", {st_mode=S_IFREG|0755, st_size=765192, ...}) = 0
...
When compiling the package from source with configure --prefix=/usr/local/bin/git the strace log is:
execve("/usr/local/git/bin/git", ["/usr/local/git/bin/git", "help", "-a"], [/* 73 vars */]) = 0
brk(0) = 0x2395000
...
openat(AT_FDCWD, "/usr/local/git/libexec/git-core", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
getdents(3, /* 159 entries */, 32768) = 5792
stat("/usr/local/git/libexec/git-core/git-fetch-pack", {st_mode=S_IFREG|0755, st_size=8448439, ...}) = 0
stat("/usr/local/git/libexec/git-core/git-web--browse", {st_mode=S_IFREG|0755, st_size=4398, ...}) = 0
stat("/usr/local/git/libexec/git-core/git-upload-archive", {st_mode=S_IFREG|0755, st_size=8448439, ...}) = 0
stat("/usr/local/git/libexec/git-core/git-credential-store", {st_mode=S_IFREG|0755, st_size=4146627, ...}) = 0
stat("/usr/local/git/libexec/git-core/git-p4", {st_mode=S_IFREG|0755, st_size=122122, ...}) = 0
stat("/usr/local/git/libexec/git-core/git-merge-tree", {st_mode=S_IFREG|0755, st_size=8448439, ...}) = 0
stat("/usr/local/git/libexec/git-core/git-mergetool", {st_mode=S_IFREG|0755, st_size=8377, ...}) = 0
The need to read /etc/bash_completion.d is built into bash which sources all scripts contained within this directory making any defined functionality available.
Each time you start a new terminal, this directory is re-read as part of the bash warmup procedure making all defined completions available to the shell.
Different vendors may have different directories read alongside /etc/bash_completion.d including /usr/share/bash-completion but this one is the minimum defined.
If you want to define your own completions, have a look at https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html.

read file Operation not permitted even for root

I downloaded a OctoPi and unziped the file in my local filesystem (EXT4):
$ unzip 2014-09-09-wheezy-octopi-0.10.0.zip
Just one file was unzipped:
-rwxrwxr-x 1 user user 3276800000 Oct 27 14:46 2014-09-09-wheezy-octopi-0.10.0.img
now I want to use image for SD card, but even cat file writes error (now as root, i tried that with user before):
# cat 2014-09-09-wheezy-octopi-0.10.0.img
cat: 2014-09-09-wheezy-octopi-0.10.0.img: Operation not permitted
I tried unzipping it to another location (different fs, USB stick) but it has the same behaviour.
also I tried the strace:
# strace cat 2014-09-09-wheezy-octopi-0.10.0.img
execve("/bin/cat", ["cat", "2014-09-09-wheezy-octopi-0.10.0."...], [/* 27 vars */]) = 0
brk(0) = 0x718000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1fb2a65000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=166255, ...}) = 0
mmap(NULL, 166255, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1fb2a3c000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\37\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1844160, ...}) = 0
mmap(NULL, 3949184, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1fb2480000
mprotect(0x7f1fb263a000, 2097152, PROT_NONE) = 0
mmap(0x7f1fb283a000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ba000) = 0x7f1fb283a000
mmap(0x7f1fb2840000, 17024, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1fb2840000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1fb2a3b000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1fb2a39000
arch_prctl(ARCH_SET_FS, 0x7f1fb2a39740) = 0
mprotect(0x7f1fb283a000, 16384, PROT_READ) = 0
mprotect(0x60b000, 4096, PROT_READ) = 0
mprotect(0x7f1fb2a67000, 4096, PROT_READ) = 0
munmap(0x7f1fb2a3c000, 166255) = 0
brk(0) = 0x718000
brk(0x739000) = 0x739000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3165552, ...}) = 0
mmap(NULL, 3165552, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1fb217b000
close(3) = 0
fstat(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 1), ...}) = 0
open("2014-09-09-wheezy-octopi-0.10.0.img", O_RDONLY) = -1 EPERM (Operation not permitted)
write(2, "cat: ", 5cat: ) = 5
write(2, "2014-09-09-wheezy-octopi-0.10.0."..., 352014-09-09-wheezy-octopi-0.10.0.img) = 35
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2570, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1fb2a64000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2570
read(3, "", 4096) = 0
close(3) = 0
munmap(0x7f1fb2a64000, 4096) = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpacsudo k/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, ": Operation not permitted", 25: Operation not permitted) = 25
write(2, "\n", 1
) = 1
close(1) = 0
close(2) = 0
exit_group(1) = ?
+++ exited with 1 +++
On different system (checked just one) I was able to read it.
I have Kubuntu 14.10 x64 with latest updates.
Linux mycomp 3.16.0-28-generic #38-Ubuntu SMP Fri Dec 12 17:37:40 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
Actually I write the image via pipes (it works):
unzip -p ... | pv | dd ...
but I want to know, why the file is not readable and where I do mistake.
....
Later I have the same experience with rapsbian:
wget -O 2014-12-24-wheezy-raspbian.zip http://downloads.raspberrypi.org/raspbian_latest
rename
mv 2014-09-09-wheezy-octopi-0.10.0.img initrd.gz
and then do unzip

ldconfig includes libraries from default path also when i have a customized ld-<me>.so.conf

I have cross compiled libraries and a linux loader.
I have placed a custom ld-.so.conf under /etc , The conf file has a path that contains all the cross compiled library and the loader.
But when i run ldconfig,
ldconfig -C /etc/ld-.so.cache -f /etc/ld-.so.conf
All the system libraries and their paths are present in the cache file.
I need the cache file generated to contain only my cross compiled libraries.
Strace of ldconfig operation is as below:
strace /opt/me/ldconfig -C /etc/ld-me.so.cache -f /etc/ld-me.so.conf
execve("/opt/me/ldconfig", ["/opt/me/ldc"..., "-C",
"/etc/ld-me.so.cache", "-f", "/etc/ld-me.so.conf"], [/* 38 vars */]) =
0
uname({sys="Linux", node="ip-172-31-32-236", ...}) = 0 brk(0)
= 0x10c1000 brk(0x10c2180) = 0x10c2180 arch_prctl(ARCH_SET_FS, 0x10c1860) = 0 brk(0x10e3180)
= 0x10e3180 brk(0x10e4000) = 0x10e4000 open("/usr/lib/locale/locale-archive", O_RDONLY) = 3 fstat(3,
{st_mode=S_IFREG|0644, st_size=99154480, ...}) = 0 mmap(NULL,
99154480, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f46155a4000 close(3)
= 0 open("/etc/ld-me.so.conf", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0640, st_size=25, ...}) = 0 mmap(NULL, 4096,
PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7f46155a3000 read(3, "/opt/me/lib\n", 4096) = 25 stat("/opt/me/lib",
{st_mode=S_IFDIR|0750, st_size=4096, ...}) = 0 read(3, "", 4096)
= 0 close(3) = 0 munmap(0x7f46155a3000, 4096) = 0 stat("/lib", {st_mode=S_IFDIR|0555, st_size=4096,
...}) = 0 stat("/lib64", {st_mode=S_IFDIR|0555, st_size=12288, ...}) =
0 stat("/usr/lib", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
stat("/usr/lib64", {st_mode=S_IFDIR|0555, st_size=12288, ...}) = 0
open("/opt/me/lib", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
Can anybody tell me why system libraries are getting added ?
Because that is the defined behavior of ldconfig:
ldconfig creates the necessary links and cache to the most
recent shared libraries found in the directories specified on the
command line, in the file /etc/ld.so.conf, and in the trusted
directories (/lib and /usr/lib). The cache is used by the run-time
linker, ld.so or ld-linux.so. ldconfig checks the header and
filenames of the libraries it encounters when
determining which versions should have their links updated.
The trusted directory list was probably updated with lib64 dirs sometime after the man page I cut'n'pasted from was written.
You could create a directory structure based on your conf file with symlinks or bind mounts pointing to the real directories and then use
-r directory to make ldconfig build based on empty versions of the system directories.

Resources