date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,375,515,548,000
I'm looking for a keyboard shortcut in tcsh to move the cursor back to the previous blank: not ESC+B which takes me back one word (for instance, in a path argument, to the previous path component) - I want to get to previous space or start of current path.
If you mean keyboard shortcut at the prompt of interactive bash shells, you could bind the shell-backward-word and shell-forward-word to some sequence of characters sent upon some key or combination of key presses. Like if pressing Ctrl-Left sends the sequence \e[1;5D on your terminal like it does in xterm, you could ...
tcsh shortcut to move the cursor back to previous space
1,375,515,548,000
Suppose I do something like: ln a_file_with_a_long_filename.pdf ~/path/to/a/new/hardlink/a_file_with_a_long_filename_slightly_modified.pdf Is there a way to refer to and expand a_file_with_a_long_filename.pdf if my cursor is at the end of the string ln a_file_with_a_long_filename.pdf ~/path/to/a/new/hardlink/ in zsh?...
This sounds like a fun code golf challenge. Here's one option: Run an innocuous command with the filename; enter enough of the filename to allow TAB-completion. : a_file<TAB> Use !!$ to refer to the last argument of the previous command: ln !!$ ~/path/to/a/new/hardlink/!!$ Thanks to zsh's helpful quoting, this is ...
Zsh refer to last element of current argument list and expand it
1,375,515,548,000
If I use PC-BSD with the default shell (Korn) then Ctrl+r doesn't work. Why won't it work? Ctrl-r was introduced to search your history in the late 1970s or early 80s and my BSD still can't do it (while Ubuntu can). Ctrl-r originates with Emacs doesn't it? When? 1975? 1983?
Ctrl+R works with ksh in emacs mode (ksh -o emacs or set -o emacs within ksh), and it was most probably the first shell to support it. Only it's not as interactive as in zsh or bash or tcsh's i-search-back widget. In ksh (both ksh88 and ksh93), you type Ctrl+RtextReturn. And Ctrl+RReturn to search again with the same ...
Why can't Korn Shell do ctrl-r?
1,375,515,548,000
This function can be used to help user input a modification of some text. function change { bash -c "read -ei \"$1\" temp && echo \$temp" } What is idiomatic zsh way to do something similar?
With the vared builtin. change () { local temp=$1 vared temp print -lr -- $temp } And if you want to use the string entered by the user later in your script, it's just temp='initial value' vared temp
Read a line with default input in zsh
1,305,731,391,000
From man file, EXAMPLES $ file file.c file /dev/{wd0a,hda} file.c: C program text file: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped /dev/wd0a: block special (0/0) /dev/hda: block special (3/0) $ file -s /dev/wd0{b,d} ...
If you compile an executable with gcc's -g flag, it contains debugging information. That means for each instruction there is information which line of the source code generated it, the name of the variables in the source code is retained and can be associated to the matching memory at runtime etc. Strip can remove thi...
What are stripped and not-stripped executables in Unix?
1,305,731,391,000
I have an executable linked like this: $ ldd a.out libboost_system-mt.so.1.47.0 => /usr/lib64/libboost_system-mt.so.1.47.0 (0x00007f4881f56000) libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007f4881cfb000) libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007f4881965000) librt.so.1 =>...
You can temporarily substitute a different library for this particular execution. In Linux, the environment variable LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for first, before the standard set of directories; this is useful when debugging a new library or using a nons...
Changing linked library for a given executable (CentOs 6)
1,305,731,391,000
Has anyone used the gold linker before? To link a fairly large project, I had to use this as opposed to the GNU ld, which threw up a few errors and failed to link. How is the gold linker able to link large projects where ld fails? Is there some kind of memory trickery somewhere?
The gold linker was designed as an ELF-specific linker, with the intention of producing a more maintainable and faster linker than BFD ld (the “traditional” GNU binutils linker). As a side-effect, it is indeed able to link very large programs using less memory than BFD ld, presumably because there are fewer layers of ...
What is the gold linker?
1,305,731,391,000
The man page for ld makes reference to AT&T’s Link Editor Command Language, however a Google search does not offer a satisfactory explanation as to what AT&T’s Link Editor Command Language is or was, other than pointing to said man pages, whereas I expect a Wikipedia page coming up in the first five results. It seems ...
The Link Editor Command Language appears to be described in the AT&T UNIX™ PC Model 7300 Unix System V Programmers Guide, chapter 17: The Link Editor. I found a copy of the Programmer's Guide (pdf) at http://www.tenox.net/docs/. The relevant section is on page 524 of the linked .pdf.
What is AT&T’s Link Editor Command Language?
1,305,731,391,000
I installed an application [ e.g. fdisk ]. But it required libraries for execution. I am looking for utility/tool which will help me to create a static binary from already installed binaries. So that I can use it anywhere. The only reliable tools that I found is ErmineLight from here , but this one is share-ware. Is...
If fdisk is just an example and your goal is really to make static executables from dynamic executables, try Elf statifier. There's even a comparison with Ermine (by the Ermine vendor, so caveat (non-)emptor). Note that If you have many executables, their combined size is likely to be more than the combined size of t...
Creating Static Binary
1,305,731,391,000
I want to remove some of the paths the linker uses to find .so libraries for testing purposes. I have found a way to add library paths: export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/path/to/library" Are there a variable similar to LD_LIBRARY_PATH that I can use to remove library paths such as /usr/local/lib or /usr/lib t...
You would be interested in removing library paths if a given shared library has embedded paths via the rpath feature. Those are added at the time the library is created by the linker. You can remove (or alter) those paths using chrpath, e.g., chrpath -d mylibraryfile.so Removing pathnames from the LD_LIBRARY_PATH va...
How to change the paths to shared libraries (.so files) for a single terminal instance
1,305,731,391,000
Would like to try this lld from LLVM. The doc on apt could be found here, but I don't know which package contains the lld executable. It seems the purpose of lld is to remove the system dependency, but clang doesn't have lld built-in. (Not yet?) Using the following example to test if lld is used. GNU-ld places some co...
Since January 2017, the LLVM apt repository includes lld, as do the snapshot packages available in Debian (starting with 4.0 in unstable, 5.0 in experimental). Since version 5, lld packages are available in Debian (lld-5.0 in stretch-backports, lld-6.0 in stretch-backports and Debian 10, lld-7 in Debian 9 and 10, lld-...
what's the name of ubuntu package contains llvm linker lld
1,305,731,391,000
My application loads custom code using dlopen on the fly. For common symbols, the global symbol table is used by default. However, I want to provide the functionality where - if the user has linked their so with -Bsymbolic-functions, I pass the RTLD_DEEPBIND flag to the dlopen function. Is there a way I can programm...
You can use the standard ELF program dump: dump -Lv libxxx.so | grep SYMBOLIC
Is there a way to check whether a .so has been compiled with -Bsymbolic-functions flag?
1,305,731,391,000
anisha@linux-y3pi:~/> google-earth ./googleearth-bin: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory anisha@linux-y3pi:~/> locate libGL /opt/google/earth/free/libGLU.so.1 /usr/lib64/libGL.so /usr/lib64/libGL.so.1 /usr/lib64/libGL.so.1.2 /usr/lib64/libGLU.s...
Like Renan said, this is the result of a 32/64 bit mismatch. On OpenSUSE, try zypper in Mesa-32bit to install the 32 bit version of the library. In general, if you have the 64 bit version, you can use rpm -qf to find the package containing the library: % rpm -qf /usr/lib64/libGLU.so.1 Mesa-7.11-11.4.2.x86_64 On OpenS...
error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory
1,305,731,391,000
I'm trying to understand how does symbol tables relate to the .data section in ELF. First some assumptions that I'm using as ground to start with. A symbol is a human readable (or "as written in the source file") representation of a function or a variable that is mapped to the actual binary value (that the CPU ...
The .data section contains the data itself, i.e. the four bytes which hold the int value 5. The .symtab section contains the symbols, i.e. the names given to various parts of the binary; the var_global_init symbol name points to the four bytes of storage in the .data section. That’s why you only see one entry: there i...
Symbol table in the .data section of ELF
1,305,731,391,000
I am attempting to assemble the assembly source file below using the following NASM command: nasm -f elf -o test.o test.asm This completes without errors and I then try to link an executable with ld: ld -m elf_i386 -e main -o test test.o -lc This also appears to succeed and I then try to run the executable: $ ./test...
You need to also link start up fragments like crt1.o and others if you want to call libc functions. The linking process can be very complicated, so you'd better use gcc for that. On amd64 Ubuntu, you can: sudo apt-get install gcc-multilib gcc -m32 -o test test.o You can see files and commands for the link by adding ...
Unable to run an executable built with NASM
1,305,731,391,000
$ file /lib/ld-linux.so.2 /lib/ld-linux.so.2: symbolic link to i386-linux-gnu/ld-2.27.so $ readlink -f /lib/ld-linux.so.2 /lib/i386-linux-gnu/ld-2.27.so $ file /lib/i386-linux-gnu/ld-2.27.so /lib/i386-linux-gnu/ld-2.27.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=7...
It is both, which is perfectly valid. The ld.so-style naming scheme is largely historical; the first dynamic linker in this style was SunOS 4’s, which was named ld.so (I have its history somewhere, I’ll clarify this once I’ve found it). But there are valid reasons for it to be named like a shared library rather than a...
Is ld.so an executable?
1,305,731,391,000
I am trying to compile a program of mine, that needs C++11 features and a newer version of boost than is installed on the target machine. I therefore compiled and installed gcc 4.9 to some local directory (/secured/local) with an in-tree build of all dependencies and the binutils. I then downloaded boost 1.55 and ran ...
Installing gcc puts a libstdc++.so.6 into both $PREXIF/lib and $PREFIX/lib64. Using the latter as RPATH for boost and my program solved the issue. Using only the former results in a fall-back to the system libstdc++.so.6.
how to specify the libstdc++.so.6 to use
1,305,731,391,000
I'm not very knowledgeable on this topic, and therefore can't figure out why the following command does not work: $ gfortran -o dsimpletest -O dsimpletest.o ../lib/libdmumps.a \ ../lib/libmumps_common.a -L/usr -lparmetis -lmetis -L../PORD/lib/ \ -lpord -L/home/eiser/src/scotch_5.1.12_esmumps/lib -lptesmumps -lpt...
I was able to solve this with the help of the comments, particular credit to @Mat. Since I wanted to compile the openmpi version, it helped to use mpif90 instead of gfortran, which, on my system, is $ mpif90 --showme /usr/bin/gfortran -I/usr/include -pthread -I/usr/lib/openmpi -L/usr/lib/openmpi -lmpi_f90 -lmpi_f77 ...
Why can't ld find this library?
1,305,731,391,000
In the past I have embedded resource files (images) into programs by first converting them to .o files using the GNU linker. For example: ld -r -b binary -o file.o file.svg Starting with FreeBSD 12, the default linker has changed from GNU's to LLVM's. Although the linker appears to understand the command line options...
It seems you need to add -z noexecstack (This was added for ELF binaries as well in LLD 7.0.0). The default is to have an executable stack region which is vulnerable to exploitation via stack memory. Your binary image does not have an executable stack and I believe that is why it fails. The error throws you off as it ...
Embedding binary data into an executable using LLVM tools
1,305,731,391,000
I have OpenSSL installed through the Homebrew package manager. I have found the library and header files I need. The headers are: /usr/local/Cellar/openssl/1.0.2h_1/include/openssl /usr/local/Cellar/openssl/1.0.2j/include/openssl /usr/local/Cellar/openssl/1.0.2k/include/openssl The library files are: /usr/lib/libssl...
It looks like you are trying to link against the openssl libraries installed with your os, rather than the homebrew libraries. Try to find where homebrew installed the 1.0.2k libraries. find /usr/local/Cellar/ -name "libssl.*" You should find something like /usr/local/Cellar/_path_of some_sort/libssl.a. Try to link...
How to link OpenSSL library in macOS using gcc?
1,305,731,391,000
I was curious if it's possible to build Linux kernel without GNU toolchain (gcc+autotools). I found out that it is possible: after applying patches from llvm.linuxfoundation.org, it was possible to build Linux kernel with clang. GNU linker was used. The alternative to ld is gold which is also part of GNU binutils. Pop...
As of 2018 lld seems mature enough to be used in production, not 100% compatible with bfd, but can be used as drop-in replacement in most cases. Update: recently, a new linker appeared, and it is under active development: mold.
What are the alternatives to GNU ld?
1,305,731,391,000
I'm not sure, whether the dynamic linker /usr/bin/ld is automatically invoked by the operating system, when the ELF file is loaded, or whether it's invoked by code embedded in the ELF file? When I use r2 to debug an ELF file, it stops at first instruction to be executed, which should be dynamic linker code, but I don'...
The kernel loads the dynamic loader (which isn’t /usr/bin/ld; see what are the executable ELF files respectively for static linker, dynamic linker, loader and dynamic loader?). When you run an ELF binary, the kernel uses its specific ELF binary loader; for dynamically-linked binaries, this looks for the interpreter sp...
Is the dynamic linker automatically invoked by the operating system or by code embedded in the ELF file?
1,305,731,391,000
Is there any relationship between the linking of binaries (as in dynamic or static linking) and symbolic links. Do they interact in any way, or share some history, or are these two completely orthogonal concepts that just happen to be called similarly?
Not at all. One involves redirecting all references to a file name ( any kind of file ) to a different file instead ( symlinks ), and the other involves building an executable image by copying code from a library into the executable ( static linking ) or referencing a dynamic library that contains the required code a...
Is there any relationship between linking binaries and symbolic links?
1,305,731,391,000
I have built Qt6 in an Alma8 based Docker container, with the Docker host being Fedora 35. Under some circumstances (described below), all Qt libs cannot load libQt6Core.so[.6[.2.4]]. But that file exists and the correct directory is searched for that file. Other Qt libs (e.g., libQt6Dbus.so) are found and loaded. E...
The question got answer in the Qt forums. Summary: The .so contains an ABI tag that denotes the minimum kernel version required. You can see this via objdump -s -j .note.ABI-tag libQt6Core.so.6.2.4. The result is in the last three blocks (0x03 0x11 0x00 -> 3.17.0 in my case). This information is placed there on purp...
Existing .so file cannot be loaded even though it exists, seems to depend on Docker host OS
1,305,731,391,000
If I run the command foo specifying a a different libc to use as follows: LD_LIBRARY_PATH=$PATH_TO_MY_CUSTOM_LIBC foo Is the globally defined libc used to run any of the command given above? For the sake of context: consider the situation where your libc is physically present and accessible on your machine, but cann...
No. Dynamic linking isn't part of the libc in the sense of /lib/libc.so.6, it is the functionality of the /lib/ld.so (both of them got a little bit changed file name and path in the last years, but the essence is the same). Yes, ld.so, the dynamic linker is a shared library as well. Loading it is the first thing what ...
Specifying local libc does call global libc?
1,305,731,391,000
I'm finding a bunch of stuff where working packages contain files where ldd returns "not found" for some libraries. For example... /usr/lib64/thunderbird/libprldap60.so libldap60.so => not found /usr/lib64/libreoffice/program/libofficebean.so libjawt.so => not found We have hundreds of users using Thunderbi...
The direct (perhaps obvious) answer is that the search path for the libraries you are looking at with ldd does not include the directories where the library's own dependencies are located. Normally, unless a library's dependencies are found in system-wide standard locations, the library should have been built with a r...
Why do some files of working packages return "not found" for some libraries of ldd's output?
1,305,731,391,000
I'm starting a project that requires an external shared library third-party.so. I've placed it in /usr/lib. However, when I run sudo ldconfig -v, it's not listed. ldconfig -p | grep third-party.so proves that it wasn't added to the cache. Does this mean that there is something wrong with the library? Or am I missing ...
An older colleague of mine took a look and gave the solution: the .so must have a lib prefix: libthird-party.so
Placed library in /usr/lib, but ldconfig doesn't put it in cache
1,305,731,391,000
I have a game I'm writing which recently required libjpeg. I wrote some code using libjpeg on some-other-machine and it worked as expected. I pulled the code to this machine and tried compiling and running it and have been getting the runtime error out of libjpeg: Wrong JPEG library version: library is 62, caller exp...
Please use LD_LIBRARY_PATH. Refer to these useful links as well: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html http://linuxmafia.com/faq/Admin/ld-lib-path.html
Linking issues with libjpeg
1,305,731,391,000
I have compiled a library and now I should run ldconfig. However, I would rather not modify /etc/ld.so.conf, nor any other system file. Is it possible to generate the cache somewhere else and then make it visible only while compiling selected programs? Or should I manually set LD_LIBRARY_PATH and LD_RUN_PATH for th...
You can check for option -f of ldconfig: -f conf Use conf instead of /etc/ld.so.conf. If you run: ldconfig -f custom.conf with user with enough privileges it will modify /etc/ld.so.cache. ld reads /etc/ld.so.cache and I don't think you can make it to read from different file. As you don't want to modify sys...
Using `ldconfig` while not touching system files
1,305,731,391,000
I have had this problem for a very long time, had several discussions with friends, and tried searching relating info online. All efforts were in vain so I decide to give a shot here. I have lots of files that I would like to annotate. Not necessarily are they pictures or documents, but also audio/video files. Now, I ...
Based on your question, it would be something like https://github.com/ljmdullaart/a-notate. Yes, it is written (by me) after you asked this question, and it is inspired on your question.
Annotating any files
1,305,731,391,000
I have .c, .h, and .1 files, how can I compile them together in one executable file. Everything clear with .c and .h files, but I have also .1 as I can see from the content it is used for manual, how can link them with program?
I have also .1 as I can see from the content it is used for manual Yes, these are written in groff markup. They aren't compiled, they're interpreted at runtime via man or some other viewer (using groff as a backend). The .1 actually denotes the manual section (see man man). When an executable is installed into a...
How to compile manual files .1
1,305,731,391,000
I'm trying to setup an environment for kernel module development in Linux. I've built the kernel in the home folder and would like to place the sources and binaries to the correct place so include correctly. The example for building the kernel module has the following includes: #include <linux/init.h> #include <linux/...
I generally approach this question like this. I'm on a Fedora 19 system but this will work on any distro that provides locate services. $ locate "linux/init.h" | grep include /usr/src/kernels/3.13.6-100.fc19.x86_64.debug/include/linux/init.h /usr/src/kernels/3.13.7-100.fc19.x86_64.debug/include/linux/init.h /usr/src/k...
Placement of kernel binary and sources for kernel module building?
1,305,731,391,000
A book I am reading refers to an include file that shows how a stack frame looks on one's UNIX system. In particular: /usr/include/sys/frame.h I am having trouble finding the modern equivalent. Anyone have an idea? I'm on Ubuntu 12.10.
A good answer was provided on Super User. Whether or not the files discussed are precise extensions of the legacy file my author refers to remains unknown. However, one will find most of the relevant knowledge in the ptrace.h file and the calling.h file located in the /.../asm/ directory. This presumes an x86 process...
Where is the frame.h located in modern Linux implementations? (ubuntu specifically)
1,305,731,391,000
So I have been reading about the preload feature of the dynamic liner (dl) and how it can be used to load a user specified, shared library (.so) using the LD_PRELOAD env variable, before all other shared libraries which are linked to an executable will be loaded. I was reading about it in context of privelage escalat...
is it, that the linker just loads the specified library in the env variable without checking if the app is even needing it ? Yes, that's the point of LD_PRELOAD: the libraries listed there are loaded before the program. LD_PRELOAD is a way to change the behavior of a program. why the function from my fake shared li...
LD_PRELOAD and the dynamic linker
1,305,731,391,000
Code: //a.c I don't use header files as this is just for demo purpose. extern void function_b(int num); void function_a(int num) { function_b(num) } //b.c void function_b(int num) { ... } //dll.c #include <dlfcn.h> int main() { void *handle_a; void *handle_b; void (*pfunc_a)(int); ... handle_...
The problem isn’t that the dynamic linker can’t resolve function_b, it’s that your second call to dlopen is incorrect: you need to include either RTLD_LAZY or RTLD_NOW, the other flags are complementary to those two. One of the following two values must be included in flags: Changing your b.so load to handle_b = dlo...
Why the dynamic linker couldn't resolve reference when a shared library has a dependency on other share library?
1,305,731,391,000
My intent is to place the text section at a specific location in memory (0x00100000). SECTIONS { . = 0x00100000; .text : { *(.text*) } } Although the linker does do this (note the 0x01000000 Addr field): $ readelf -S file.elf There are 12 section headers, starting at offset 0x104edc: ...
It turns out that telling the linker to emulate elf_i386 produced the output that I was looking for, though I do not understand why. Namely, invoke the linker with: $ ld -melf_i386 [...] Files produced with and without -melf_i386 appear to be mostly similar: with.elf: ELF 32-bit LSB executable, Intel 80386, versio...
GNU linker producing useless spacing between sections in ELF file
1,305,731,391,000
I was brave and tried to compile CUPS in a 32-bit Cygwin environment. I used the standard sources from the tarball. All went fine until linking. http://pastebin.com/QSKvLSmT Here's the end of the transcript: Compiling raster.c... raster.c:1: warning: -fPIC ignored for target (all code is position independent) Linking ...
Have a look at the CUPS port in cygwin-ports, they provide version 1.4.6 as of January 30th 2011. It patches quite a lot...
CUPS compilation fails on Cygwin
1,305,731,391,000
I'm having trouble compiling a simple, sample program against glib on Ubunutu. I get these errors. I can get it to compile but not link with the -c flag. Which I believe means I have the glib headers installed, but it's not finding the shared object code. See also the make file below. $> make re gcc -I/usr/includ...
glib is not your problem. This is: re.c:(.text+0xd6): undefined reference to `print_uppercase_words' What it's saying is you're calling a function print_uppercase_words, but it can't find it. And there's a reason. Look very closely. There's a typo: void print_upppercase_words(const gchar *string) After you fix t...
Linker errors when compiling against glib...?
1,311,339,680,000
I've got an app which won't link, giving error: /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlGetProp@LIBXML2_2.4.30' /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlFree@LIBXML2_2.4.30' /usr/lib64/libcroco-0.6.so.3: undefined reference to `xmlHasProp@LIBXML2_2.4.30' I've got libxml installed: lib...
The only thing I can think of is that the .so files aren't in a directory the linker looks for libraries in. Can you find out where the file libxml2.so resides, and then put that directory on the link command line with a -L ?
libxml linker error
1,311,339,680,000
This is my /etc/ld.so.conf /usr/local/lib64 /usr/local/lib include /etc/ld.so.conf.d/*.conf The directory /etc/ld.so.conf.d/ contains mysql-x86_64.conf which contains only this one line: /usr/lib64/mysql The /usr/lib64/mysql directory [listed in the .conf file] contains these files: total 45,961,216 drwxr-xr-x 2 ro...
ld.so.conf is the configuration file for ld.so, the runtime dynamic linker. ld ignores it, intentionally. It has its own defaults, supplemented by -L. Typically the search path is also determined by the compiler driving it — see gcc -print-search-dirs for GCC. LD_LIBRARY_PATH also only affects ld.so, not ld. See also ...
ld ignores ld.so.conf
1,311,339,680,000
GNU C compiler passes the wrong architecture name to the linker. For example gcc helloworld.i throws the error ld: unknown/unsupported architecture name: -arch arm. After some experimenting with LD, it seems armv7 is the architecture I should use. The compiling and assembling operations seem to work fine. It appears t...
You shouldn't be upgrading your toolchain piecemeal. The parts have to work together. The GNU tools allow so much variation that it is essential that the pieces be set up to work together, especially for a cross-compiler. If you need a newer ld for some reason, you should build up a complete toolchain to support it.
GCC: set architecture to pass to linker
1,311,339,680,000
I'm trying to build a rust program that involves diesel with postgresql on Fedora 31 and the build fails because the linker can't find libpq. As it's reproducible with gcc, I'm using gcc to keep the question shorter. gcc -L /lib64 -lpq /usr/bin/ld: cannot find -lpq ls /lib64 | grep libpq libpq.so.5 libpq.so.5.11 ldd...
-lpq causes the linker to look for libpq.so, with no soname suffix. To provide this on Fedora, you should install libpq-devel: sudo dnf install libpq-devel
ld cannot find library right in front of it
1,311,339,680,000
I'm trying to compile vapoursynth and have run into a linker issue which I don't understand how to solve. Here is what I have so far: I have compiled zimg from github github: buaazp/zimg and have a binary. I pulled vapoursynth from here github: vapoursynth/vapoursynth and I followed the instructions. When I try t...
It turns out I used the wrong zimg. The correct zimg is sekrit-twc/zimg.
Unable to compile vapoursynth: failed to link zimg [closed]
1,311,339,680,000
Apologies if this has already been answered; I am having trouble finding an existing post (either on SE or linux forums) which solves the issue. I need to install the package(s) that enables the -lSM and -lICE linker options for compiling some C/C++ code that uses plotting libraries (see here for an example: C Compili...
You are looking for libSM.so and libICE.so, provided by the libSM-devel and libICE-devel packages. Basically, if you are linking with -l<something>, look in /usr/lib64/lib<something>.so. An even faster result is to skip the step of finding the package name and run: yum install /usr/lib64/lib<something>.so
What Centos package contains the libraries for -lSM -lICE linker options?
1,311,339,680,000
I'm trying to make rcssmonitor and I get the following error: /usr/bin/ld: cannot find -laudio I'm using Linux Mint 17.2. with gcc 4.8.4.
On Ubuntu/Mint. You should be able to get libaudio using: apt-get install libaudio-dev
Linker error about -laudio
1,311,339,680,000
When I copy over a program and a few libraries it needs to another machine I get the "no version information available" when I run LDD on the program. I know why this is happening, I just want to know if its a big deal. Can I just ignore it? The program seems to execute and exhibits expected behavior. Could this come...
From the glibc sources for ldd if (...) { /* The file has no symbol versioning. I.e., the dependent object was linked against another version of this file. We only print a message if verbose output is requested. */ ... errstring = make_string ("no version information available ..."); ...
Dynamic linker "no version information available"
1,311,339,680,000
I'm adding c++ runtime and exception support to the Linux kernel. For that, I need to provide my own lib/gcc and lib/libstdc++instead of the standard libraries provided by the compiler. So, I am confused with the flags that are to be passed to the linker. In a normal kernel's top-level Makefile, LD = $(CROSS_COMPILE)...
These flags are defined in GCC’s spec files, so the best way to determine the differences between them is to look there: gcc -dumpspecs The relevant part is the link_command definition. This shows that -nostdlib, -nodefaultlibs and -nostartfiles have the following impact: %{!nostdlib:%{!nodefaultlibs:%:pass-through-...
Difference between the linker flags
1,311,339,680,000
I've got reasons for not wanting to rely on a specific build system. I don't mean to dis anybody's favorite, but I really just want to stick to what comes with the compiler. In this case, GCC. Automake has certain compatibility issues, especially with Windows. <3 GNU make is so limited that it often needs to be supple...
The main entry point is God. Be it a C or C++ source file, it is the center of the application. Only in the same way that nitrogen is the center of a pine tree. It is where everything starts, but there's nothing about C or C++ that makes you put the "center" of your application in main(). A great many C and C++ prog...
Compiling C/C++ code by way of including preprocessor build instructions in an actual C/C++ source file
1,311,339,680,000
I'm reading a textbook which describes how loader works: When the loader runs, it copies chunks of the executable object file into the code and data segments. Next, the loader jumps to the program’s entry point, which is always the address of the _start function.The _start function calls the system startup function...
The other function calls described in the linked answer give a synopsis of what needs to happen; the actual implementation details in the GNU C library are different, either using “constructors” (_dl_start_user), or explicitly in __libc_start_main. __libc_start_main also takes care of calling the user’s main, which i...
Does _start call my program's main function and other essential setup functions? [closed]
1,311,339,680,000
I'm trying to recompile my software for debian 8, but i have run into this strange issue of libgssappi refusing to link with anything. >~/torque_github$ gcc test.c -lgssapi /usr/bin/ld: cannot find -lgssapi collect2: error: ld returned 1 exit status The library is present in the system, as seen here: >~/torque_github...
You probably need to install the development-package libkrb5-dev or krb5-multidev: apt-get install libkrb5-dev and need the correct parameters for gcc (run krb5-config.mit gssrpc --libs to get them): gcc test.c -o test $(krb5-config.mit gssrpc --libs) which expands to (depending on the system): gcc test.c -o test -L...
Compiling package for debian 8 - linking issues
1,311,339,680,000
I manually compiled libpcre2 with debug symbols into /usr/local/lib and then deleted the version installed in /lib64. While I can still run commands as my user by first running export LD_LIBRARY_PATH=/usr/local/lib, running sudo still fails with the message sudo: error while loading shared libraries: libpcre2-8.so.0:...
Why the library is not getting used The dynamic linker will ignore LD_LIBRARY_PATH if the program to be loaded has setuid or setgid bit set, for security. Otherwise, there would be the old trick of using LD_LIBRARY_PATH or LD_PRELOAD to override an innocuous system/library call to do something else instead or in addit...
Can't run sudo after deleting libpcre2
1,311,339,680,000
Following manual describes dynamic linker/loader libs: The program ld.so handles a.out binaries, a format used long ago; ld-linux.so* handles ELF (/lib/ld-linux.so.1 for libc5, /lib/ld-linux.so.2 for glibc2), which everybody has been using for years now. I use Ubuntu 15.04 and I don't have ld.so. My system contains...
Your system doesn't have /lib/ld.so, so it isn't equipped for dynamically linked a.out executables. It could be equipped for statically linked a.out executables, if your kernel includes support for them; Ubuntu's doesn't (this requires the CONFIG_BINFMT_AOUT kernel configuration option). The a.out format has been obso...
dynamic linker/loader libs - missing ld.so
1,311,339,680,000
I am trying to build SimGear from the FlightGear project using the download_an_compile.sh script (which uses CMake to build the binaries). The build went fine so far, but when the script tried linking the built object file together to a library, I get tons of //usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2: warning: und...
At least in Debian (and derivatives thereof), a shared library's development files are split off into a separate binary package: If there are development files associated with a shared library, the source package needs to generate a binary development package named libraryname-dev, or if you need to support multiple ...
Weird linking issue with libldap using cmake
1,311,339,680,000
I am trying to compile a program(on Ubuntu 14.04 64 bit) that requires binutils with multiarch support(recommended version 2.20). I have installed binutils-multiarch 2.24 and the dev package from the distro repository. However, ld fails to find few functions(print_insn_big_arm, print_insn_big_mips, print_insn_little_a...
So everything was correctly installed. It turns out that the program expected libopcodes.so to be symlinked to the multi-arch version and not the regular version. Correcting the symlinks fixed the issue.
ld cannot find print_insn_big_mips(and few others) despite binutils-multiarch-dev installed
1,311,339,680,000
I have a small application that was tested on Linux and it worked. Now I would like to build the same code on FreeBSD. To build it on FreeBSD I needed to change a little my Makefile. Here is my amended version: CXX := gcc LDFLAGS += -L/usr/local/lib -R/usr/local/lib -L/usr/lib -R/usr/lib -L/usr/local/include -R/usr/lo...
I replaced gcc with c++ and now it works.
FreeBSD - problem with linking protobuf
1,418,601,686,000
I'm trying to run a game called "Dofus", in Manjaro Linux. I've installed it with packer, that put it under /opt/ankama folder. This folder ownership (and for every file inside it) is root user, and games group. As instructed by the installing package, I've added myself (user familia) in the games group (by not doing ...
First, when you add yourself to a group, the change is not applied immediately. The easiest thing is to logout and log back in. Then there are write permissions of data files (as mentioned already in some of the comments). However, the solutions are not good for security. Add a group for the game. Do not add any user...
Why do I get "Permission Denied" errors even though I have group permission?
1,418,601,686,000
I am trying to configure a CentOS 7 running in VirtualBox to send its audit logs to the host which is FreeBSD 10.3. Ideally, I'd like to receive the logs with FreeBSD's auditdistd(8) but for now I'd just like to be able to use netcat for that. My problem is that netcat doesn't get any data. Details When I run service...
I am not sure if everything here is needed to succeed. Nevertheless, this is a configuration which works so that I am able to receive Linux Audit logs with a netcat on FreeBSD. CentOS:/etc/audisp/audisp-remote.conf: remote_server = 192.168.56.1 port = 60 local_port = 60 transport = tcp mode = immediate queue_depth = ...
How to send audit logs with audisp-remote and receive them with netcat
1,418,601,686,000
We recently implemented some auditd rules in response to an external security audit. My colleague offered some input on them and suggested adding -f 2 to /etc/audit.rules. I can't think of an instance when I would want to induce a kernel panic outside of testing. Can anyone suggest real-world, production situations th...
auditctl -f 2 causes a panic, essentially, when the audit mechanism is unable to operate properly. There are high-security environments where proper access controls and full logging are critical, and if any logging fails, the system must be stopped (at that point, the technician on duty has already been paged). Financ...
Can someone give an example as to why I'd want to induce a kernel panic using auditd?
1,418,601,686,000
I'm aware of how to audit for changes to the /etc/sysconfig/iptables file in CentOS/RHEL 6 and earlier, but how do I audit for changes made only to the running configuration?
The following auditctl rule should suffice: [root@vh-app2 audit]# auditctl -a exit,always -F arch=b64 -F a2=64 -S setsockopt -k iptablesChange Testing the change: [root@vh-app2 audit]# iptables -A INPUT -j ACCEPT [root@vh-app2 audit]# ausearch -k iptablesChange ---- time->Mon Jun 1 15:46:45 2015 type=CONFIG_CHANGE m...
Audit on changes to the running iptables configuration
1,418,601,686,000
auditd sending logs to /var/logs/messages we want to disable it. How to do that? /etc/audisp/plugins.d/syslog.conf i changee active = no but still sending lots to syslog
Edit /etc/audisp/plugins.d and change args = LOG_INFOto this: args = local6 Then edit /etc/rsyslog.conf and add local6 to the "some catch-all log files" block so it's like this: *.=info;*.=notice;*.=warn;\ auth,authpriv.none;\ cron,daemon.none;\ mail,news.none;\ local6.none -...
Disable syslog logging for auditd
1,418,601,686,000
I'm tailing auditd.log and piping it into ausearch and then aureport, with the aim of getting a simple stream of modified files: tail -f /var/log/audit/audit.log | ausearch -k my_key | aureport -f --success -i While aureport seems to do the job of correlating and combining multiple records, it doesn't seem to merge th...
You can do ausearch -k my-key --format text or ausearch -k delete --format csv, without piping to aureport. You can filter by start-end dates (--start --end), uid (--uid 123), and result (--success yes|no)
Can aureport show the full path to files?
1,418,601,686,000
I recently installed the auditd package on my Debian machine. I did some testing with auditctl, creating a single rule to watch a directory, proved something, and then removed and purged auditd. Subsequently, I'm still seeing these entries in kern.log. May 1 08:29:55 trinity kernel: [5654985.963656] type=1325 audit(...
Audit entries are generated regardless some server is listening using audit_log_acct_message. As far as I know, syscall 102 is getuid() -- you can check using ausyscall 102 (I am afraid to install auditctl after all this :P). The audit message is not invoked by iptables itself, but somewhere in the kernel. You might g...
Identifying source of audit messages in kern.log
1,418,601,686,000
I am writing a parser for Linux Audit and I stumbled upon some weird cases which doesn't seem to comply with the standard. My reference is the Red Hat's documentation. A proper audit record should look like this: type=USER_CMD msg=audit(1464013671.517:403): pid=3569 uid=0 auid=1000 ses=7 msg='cwd="/root" cmd=123 term...
So I solved tiny a part of the problem - I found out that auditd start, ver=2.2 is valid. I failed to find any documentation though. The only document I have is an example from the Red Hat's manual: Example 7.5. Additional audit.log events The following Audit event records a successful start of the auditd daemon. The...
Undocumented format of Linux Audit log records
1,418,601,686,000
I have configured auditd to track some sensitive files on my system. Now I would to have a script that will be called each time auditd writes a line, with the $1 argument of that script being the line added. From what I read in the manual auditd has no such option. Is there a way to do this anyway? If I'll have a cron...
Using the tail command like so: tail -Fn0 /var/log/audit/audit.log | /sbin/script and /sbin/script is like so: while IFS= read -r line; do #something to do with $line variable when it comes done
how to run a script on auditd events?
1,418,601,686,000
So, I have this trio of audit log entries type=AVC msg=audit(1488396169.095:2624951): avc: denied { setrlimit } for pid=16804 comm="bash" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=process type=SYSCALL msg=audit(1488396169.095:2624951): arch=c000003e syscall=160 success=no ex...
So, in this case, we already know that the syscall in question was setrlimit. A search for setrlimit reveals there's a C library function by the same name that wraps the syscall. The function's documentation indicates that the first argument ("a0" in the SYSCALL line from the audit log) indicates the resource in quest...
How do I dissect an SELinux SYSCALL message?
1,418,601,686,000
I am creating a parser/converter from the Linux Audit format. As I was studying the format, looking at examples and reading the documentation I stumbled upon a problem. Can I be sure that the field names inside a single record are unique? For example, is a record like this one is legal / appear in real world impleme...
According to Steve Grubb's reply on the official mailing list (link to the email): Steve's answer: Is it possible that there are duplicate fields in a record? Sometimes. I've tried to fix those when it happens. The problem is that not everyone runs their audit code by this mail list so that we can check it to ...
Can I be sure that the name of a Linux Audit record's field is unique?
1,418,601,686,000
I'm using a RHEL machine with SELinux enabled. I'd like to change the logfile position of auditd to /mydir/log/audit.log. I can apply the security context system_u:object_r:auditd_log_t:s0 to this file. However, what should be the security context of the directory /mydir/log and parent directory /mydir since they're g...
You're mostly there, you're using the semanage command. Since you already know that there's a correct context on /var/log/audit, the easiest thing is to set up a local selinux filecontext equivalence. So you'd run something like this: semanage fcontext -a -e /var/log/audit /mydir/log This tells SELinux to add (-a) a...
SELinux security context of parent directories
1,418,601,686,000
I'm trying to figure out how to log/track when a user gets a Permission denied notice after attempting to access a file. I've read that adding a rule to /etc/audit/audit.rules can accomplish this. The only suggestion that I've seen mentioned appears to not work as intended. Or, at least, it does not do what I would li...
I've been tooling around and found that if I use success!=1 then audit.log will display entries that indicate success=no. This seems counter-intuitive to me since a non-zero exit code typically indicates a failure of some sort but !=1 could be anything including other failure exit codes as well as a success (0). Inter...
Using auditd to capture "permission denied" notices
1,418,601,686,000
I'm not able to redirect output of command into a file when ran with cronjob [root@mail /]# crontab -l */1 * * * * /sbin/ausearch -i > /rummy [root@mail /]# cat /rummy It's weird that when I dont give -i option , I'm able to redirect it very well. [root@mail /]# crontab -l */1 * * * * /s...
The command does not produce output, but runs ok. You can see this because the file rummy got created. The ausearch utility seems to expect a "search criteria", and the empty output could be due to you not providing one. See the ausearch manual on your system for further information. After a bit of reading of the aus...
cronjob not redirecting output of command when used with option
1,418,601,686,000
I was looking at Linux audit reports. Here is a log from ausearch. time->Mon Nov 23 12:30:30 2015 type=PROCTITLE msg=audit(1448281830.422:222556): proctitle=6D616E006175736561726368 type=SYSCALL msg=audit(1448281830.422:222556): arch=c000003e syscall=56 success=yes exit=844 a0=1200011 a1=0 a2=0 a3=7f34afa999d0 ite...
The nroff "executable" provided by groff is a shell script, e.g., #! /bin/sh # Emulate nroff with groff. # # Copyright (C) 1992, 1993, 1994, 1999, 2000, 2001, 2002, 2003, # 2004, 2005, 2007, 2009 # Free Software Foundation, Inc. # # Written by James Clark, maintained by Werner Lemberg. # This file is ...
auditctl comm vs. exe
1,418,601,686,000
I have written a script which is deployed just by putting it in a globally accessible location for all users. I want to log the usage of this script. Is there a way in Linux to find out how many times a file was read/accessed? And if possible to determine by who ? Edit: I do not have the root privileges, and auditd i...
Not with the default ext2/3/4 linux file system, I think your only solution is to log the usage of your file into a log file (but people could find that file and modify it. So my advice would be to use a small web service (PHP, Python or even perl that increment a value in a db so people could not change the value eas...
Monitor file access count by user
1,418,601,686,000
In RHEL5 and RHEL6, I could add audit=1 to start kernel-level auditing during boot before the boot process got as far as starting auditd. Now, in RHEL7, I can't find any mention of audit=1 as a kernel argument. Has anyone seen a definitive document on kernel/system auditing at boot time? Is just having the audit RPM i...
The RHEL 7.x documentation on auditing doesn't mention the kernel parameter at all (somehow I thought the RHEL 6.x documentation did mention it but I can't seem to find it now). The manual page for auditd (package audit-2.7.6-3.el7.x86_64) on a RHEL 7.4 system, however, has the following: A boot param of audit=1 shou...
Kernel / Boot auditing in RHEL 7?
1,418,601,686,000
I can run ausearch based on time: sudo ausearch --start '16:48:07' or date: sudo ausearch --start '05/07/2019' but not both: > sudo ausearch --start '05/07/2019 16:48:07' Invalid start time (05/07/2019 16:48:07). Hour, Minute, and Second are required. The man page clearly implies that you can specify date or time o...
The date and time should be separate arguments: sudo ausearch --start 05/07/2019 '16:48:07' I found an example online, but a more careful reader could have seen this in the man page: -ts, --start [start-date] [start-time] Search for events with time stamps equal to or after the given ...
ausearch how to specify both time and date
1,418,601,686,000
I want to monitor access to a file using audit, and hence added the following rule -w /home/test.txt -k monitoring-test I reloaded the rules (sudo service auditd restart) and modified the file /home/test.txt, however, the log does not create any events with that key: sudo ausearch -k monitoring-test returns only the ...
From the auditctl man page: DISABLED BY DEFAULT On many systems auditd is configured to install an -a never,task rule by default. This rule causes every new process to skip all audit rule processing. This is usually done to avoid a small performance overhead imposed by syscall auditing. If you want to use auditd, y...
audit does not record file events (but works for network events) in fedora
1,418,601,686,000
While I was playing a little with kernel audit system, I made a small C program: #include <stdio.h> #include <stdlib.h> int main(int argc, char** argv){ void *t; while(1){ t = malloc(1); free(t); } return 0; } And applied the following filters to audit...
Your program starts with an initial heap, and your one byte allocation fits within that heap. When you immediately free the allocated memory, the heap never needs to grow so you never see a corresponding system call. See How quickly/often are process memory measurements updated in the kernel? for a similar experiment....
No system call when malloc after free
1,418,601,686,000
I am writing a converter which takes Linux Audit logs as input. I tried to find the most recent dictionary file where all the valid names of the fields are defined. I've found such a file[1] but the main website[2] says: Specs The specifications have moved to github. The following will be left in place for a while an...
From your github link, follow "Audit Event Parsing Library" which has a link the the dictionary at https://github.com/linux-audit/audit-documentation/blob/master/specs/fields/field-dictionary.csv The raw CSV version is at https://raw.githubusercontent.com/linux-audit/audit-documentation/master/specs/fields/field-dicti...
Where can I find the most recent dictionary of standard Linux Audit event fields?
1,418,601,686,000
I have Amazon Linux 2023 running in a Docker container and I would like to be able to load some custom audit rules into the kernel and ensure they are persisted when the container restarts. I have added the rules to /etc/audit/rules.d/audit.rules and can see them when I cat that file and I'm trying to use augenrules -...
Feeding audit rules to the kernel is the host operating system's job, not the container's. There is no kernel in the container: only the host system has one. Your container does not appear to have any kind of init system either, although other containers could be set up with one. It is a bit misleading to say "I have ...
Why does augenrules refuse to run even when sudo is used?
1,418,601,686,000
I'd like to show that entering passwords via read is insecure. To embed this into a half-way realistic scenario, let's say I use the following command to prompt the user for a password and have 7z¹ create an encrypted archive from it: read -s -p "Enter password: " pass && 7z a test_file.zip test_file -p"$pass"; unset ...
What's insecure is not read(2) (the system call to read data from a file). It isn't even read(1) (the shell builtin to read a line from standard input). What's insecure is passing the password on the command line. When the user enters something that the shell reads with read, that thing is visible to the terminal and ...
Sniff password entered with read and passed as a command line argument
1,568,274,817,000
I have ran the following command on my RHEL 6 system to produce an audit report aureport --login --summary -i that produces the following output Login Summary Report ============================ total auid ============================ Warning - freq is non-zero and incremental flushing not selected. 458 unset 87 ro...
From reading the documentation, I think using the "--failed" option would show only failed events for the report you're running. The default behavior is to show both failures and successes. From the man page: --failed Only select failed events for processing in the reports. The default is both success and fai...
aureport interpretting report output
1,568,274,817,000
I couldn't find this elusive "unset" user in /etc/passwd and there is no mention of him in man aureport although she scored the most number of hits on my audit log: # aureport -u -i --summary --start today User Summary Report =========================== total auid =========================== 888 unset 222 root 55 ...
Based on the definition of auid from this SuSE page, titled: Understanding the Audit Logs and Generating Reports: auid The audit ID. A process is given an audit ID on user login. This ID is then handed down to any child process started by the initial process of the user. Even if the user changes his identity (f...
Who is user "unset" in aureport?
1,568,274,817,000
I'm trying to parse audit.log with rsyslog by using a bash script in order to transform the hex part of proctitle to ascii. However I do not get ressults: the file audit_ascii.log do not have lines with "proctitle" values. I tested the script and it is working fine so I guess the problem comes from my rsyslog.conf. rs...
Just stop the flow after the script redirected the changed log to another file. Then I take the new file as another input in rsyslog. Best solution I found
Rsyslog - Parsing audit.log / omprog change log value
1,568,274,817,000
OS sles 15, audit service enabled When I issue any command (for example, date or ls), I expect it to be logged in audit.log, something like this: type=SYSCALL msg=audit... type=EXECVE msg=audit(1718094805.867:24632): argc=1 a0="date" ... but these entries are not in audit.log There are other entries there, for example...
ERROR: type should be string, got "\nhttps://lowendbox.com/blog/how-to-audit-every-command-run-on-your-linux-system/\nbasically do this to put this rule in your /etc/audit/rules.d/audit.rules file\nauditctl -a exit,always -F arch=b32 -S execve -k allcmds\nauditctl -a exit,always -F arch=b64 -S execve -k allcmds\n\nbe aware the /var/log/audit/audit.log file might grow to gigabytes in a few minutes, and simply fill up whatever disk partition that folder is on.\nAnd I believe that will capture every command on a running system including all under the hood stuff. If you want every command done by a specific user, then it would be a matter of tailoring the rule to filter on a specific uid= such as\nauditctl -a exit,always -F arch=b32 -F uid=1234 -S execve -k allcmds\n\nor\nauditctl -a exit,always -F arch=b32 -F uid >=1000 -S execve -k allcmds\n\n"
Audit service does not audit commands
1,568,274,817,000
Are chown and chmod “write” -w type of an operation? I'm using auditd to watch folder permissions. There are different options read, write, execute, attributes. I just want to watch chmod or chown changes on the directory. Is chown/chmod a write type of operation on the system?
Those operations are a(=attribute change)
auditd / auditctl: Are chown and chmod “write” -w type of an operation?
1,392,108,880,000
In my CPU graph thingy, I have noticed recently that when compiling stuff I can never seem to reach 100% usage, it just keeps bobbing up and down around 60-70% max. Example: In contrast, this graph is completely opaque when done on my work computer. I want to get to the bottom of this and am using the stress utility ...
To debug problems with scheduling or applications performance on Linux, it is a good start to run task under perf stat. It reports statistics about the processor pipeline, its stalled cycles, or memory behaviour. Possible problems: Linux/Scheduler bug Intel HT is not keeping up with your threads Memory is not able to...
Why does my cpu never get past 60-70% cpu usage? Where is the bottleneck?
1,392,108,880,000
I am thinking of implementing a load balancing solution for personal use. What I want to do, is to maximize data throughput over mobile phone Internet connections. Let me be clear: I have data plan in my mobile phone and my family have their respective data plans in their phones, too. If I can connect up to 4 phones i...
To balance outgoing connections all you need is standard iptables and some policy routing. This does get a bit complex with 4 connections as you will need to reconfigure and rebalance the links as connections come and go. The raw iptables setup is Create a routing table for each connection ip rule add fwmark 10 tabl...
Implementing load balancing on any Linux distro
1,392,108,880,000
I'm reading about the differences between a load-balancer implemented at the DNS level vs having a single DNS entry which forwards to a load-balancer. I found this Q&A particularly useful: I'm getting the impression from the top answer that DNS based load-balancing isn't reliable. When I run nslookup on some big sites...
As the top answer in the link says, load balancing based DNS is not reliable; it also is known for not being able to distribute load evenly. When using DNS load-balancing techniques you are dependent both in caching choices done by intermediate DNS servers and by the client decisions. In case of a failure, if only us...
Do multiple entries for nslookup imply load-balancer via DNS?
1,392,108,880,000
I have a gitlab server on my local network and a server that I can ssh to from outside my network. Is there a way I can configure the server, that I can SSH into, so that when I use: ssh [email protected] It sends that to the Gitlab server on the local network? Kind of like an Nginx reverse proxy but with ssh. Edit: I...
HTTP servers like nginx are able to proxy based on the hostname because it is sent in the HTTP/1.1 Host header of the request. SSH does not have this concept of virtual hosts, the client not send the hostname at all. You have three options: Use port forwarding to make your gitlab server directly available. Make your ...
Reverse SSH Tunnel
1,392,108,880,000
I have two Apache instances behind a load balancer that I transfer the requests to, depending on the request type. Now what I want: when I get too many transactions from an IP address, I want to block that IP for few seconds and send back some response to the client that you have sent too many requests. So now the qu...
I would advise you to setup mod_evasive in Apache. From mod_evasive on Apache mod_evasive is an evasive maneuvers module for Apache that provides evasive action in the event of an HTTP DoS attack or brute force attack. It is also designed to be a detection and network management tool, and can be easily configur...
Using a load balancer instead of Apache to throttle transactions from specific IP's
1,392,108,880,000
I am conducting a kind of research in that I schedule multiple parallel applications (e.g., OpenMP/pthreaded applications) and execute the applications on specific (partitioned) cores on Linux-based multi-processor platforms. We can set CPU affinities for each application by using sched_setaffinity() system call. But,...
you should be able to disable the automated load-balancing by telling the kernel to only use the first N CPUs. e.g. adding the following to your boot-parameters, should effectively run the entire system on CPU #0 (as the system will only use a single CPU): maxcpus=1 then use taskset or similar to run your process on ...
setting (system-wide) CPU affinities for running processes on a Linux platform
1,392,108,880,000
I have a flat network (no routing yet) of 3 servers, each with a service (http, mysqld, doesn't matter) listening on 0.0.0.0 (ip_nonlocal_bind and ip_forward are on) and running keepalived. virtual_server 10.0.0.80 3306 { delay_loop 2 lb_algo rr lb_kind DR protocol TCP real_server 10.0.0.81 3306 { weigh...
Thank to the help in a serverfault.com question I was able to solve my issue. Short Answer: I add the virtual IPs to my dummy interface and ensure net.ipv4.conf.default.accept_source_route is 0. Long Answer: The purpose of a dummy interface is to easily disable/enable/failover keepalived without stopping and starting ...
keepalived virtual_server - only answering on box keepalived is on
1,392,108,880,000
In our test environment we've identified a strange HAProxy behavior. We're using the standard RHEL 7 provided haproxy-1.5.18-8.el7.x86_64 RPM. According to our understanding, the total number of accepted parallel connections is defined as maxconn*nbproc from global section of the haproxy.cfg. However if we define: max...
I've found the culprit. We were reading statistics from socket interface. However in our config, there is just 1 socket interface which binds to only one process. And therefore we can't get statistics from other processes. HAProxy unfortunately doesn't support aggregated statistics via socket interface (if it does, pl...
HAProxy ignores nbproc
1,392,108,880,000
I have installed nginx on RHEL and now I need to configure it to forward the requests to the actual server in the /etc/nginx/nginx.conf. My actual server is using a private IP address, will nginx forward requests to the private IP address?
Here you can find a doc how to do it: http://nginx.com/resources/admin-guide/reverse-proxy/ Generally use HTTP proxy, from the example: location /some/path/ { proxy_pass http://www.example.com/link/; } It means that if you go to yourserver.com/some/path/ the request will be forwaded to http://www.example.com/link...
How nginx receives requests from client and forwards it to the actual server?
1,392,108,880,000
I have a small network with a webserver and an OpenVPN Access Server (with own webinterface). I have only 1 public ip and want to be able to point subdomains to websites on the webserver (e.g. website1.domain.com, website2.domain.com) and point the subdomain vpn.domain.com to the web interface of the OpenVPN access se...
Your 443 server block is not configured for SSL requests. You need to add ssl to the listen directive and configure ssl_certificate and ssl_certificate_key. E.g. server { listen 443 ssl; ssl_certificate /path/to/ssl/certificate.pem; ssl_certificate_key /path/to/ssl/certificate.key; # ... You can find mor...
How to NGINX reverse proxy to backend server which has a self signed certificate?
1,392,108,880,000
Grasping at straws for search parameters and terminology. The key attribute to the JVM is the V for virtual (at least within the context of this question). How do you span a JVM across a cluster of machines with load balancing so that the JVM itself is distributed? sorta kinda like this: https://www.cacheonix.org/ar...
Elaborating on my comment and assuming that you aren't thinking of something very esoteric... Perhaps you're looking at that diagram and interpreting it as if the users are using an application that can talk to any JVM on the backend at any time during a session because of some kind of coordination between the JVMs. T...
distribute the JVM across a cluster of machines
1,392,108,880,000
I apologize in advance if this question is in a wrong forum, this is my first question here! My client has hosting with Aliyun Cloud (Alibaba Cloud in China). I've deployed a microsite to their servers, which has following structure: microsite.com -> CDN1 -> SLB -> 2x ECS -> DB ECS oss.microsite.com -> CDN2 -> OSS ECS...
OK we found out what was the issue, just so I close the question as there was no DDoS or any attack: Client IT has set their load balancer to, literarily, machinegun server instances, and all the traffic I saw in the access log was actually - health check. Now when they set it to some reasonable 2-3min per check, it's...
Constant concurrent connections drain my server storage
1,392,108,880,000
I set the LoadBalancer in Apache 2.4.6 (CentOS), it works well except one thing. When the user open the alias of Apache server, it anytime redirect the user to another server when click somewhere on website, which is not good for me. I would like to set the Apache in this way: If someone open the page (and the Apache ...
That sounds like your backend doesn't set jsessionid cookies? The docs suggest to start from the following example if your backend doesn't set cookies itself: Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED <Proxy "balancer://mycluster"> BalancerMember "http://192.168....
Apache load balancer always redirect
1,392,108,880,000
We are using mod_proxy to balance load between our backend servers . We have different setup and some of the backend servers either runs on tomcat\jboss. The balancer configuation is as follows BalancerMember http://server1:21080 min=1 max=1000 loadfactor=1 retry=1 timeout=240 route=tc_server1 BalancerMember http://...
Yes , set the retry value to some higher number. retry: Connection pool worker retry timeout in seconds. If the connection pool worker to the backend server is in the error state, Apache will not forward any requests to that server until the timeout expires. This enables to shut down the backend server for maintenance...
Understanding retry value in Apache Load Balancer Configuration
1,294,207,772,000
on our servers, typing sar show's the system load statistics for today starting at midnight, is it possible to show yesterdays statistics?
Usually, sysstat, which provides a sar command, keeps logs in /var/log/sysstat/ or /var/log/sa/ with filenames such as /var/log/sysstat/sadd where dd is a numeric value for the day of the month (starting at 01). By default, the file from the current day is used; however, you can change the file that is used with the ...
How do I get sar to show for the previous day?
1,294,207,772,000
Until recently I thought the load average (as shown for example in top) was a moving average on the n last values of the number of process in state "runnable" or "running". And n would have been defined by the "length" of the moving average: since the algorithm to compute load average seems to trigger every 5 sec, n w...
This difference dates back to the original Berkeley Unix, and stems from the fact that the kernel can't actually keep a rolling average; it would need to retain a large number of past readings in order to do so, and especially in the old days there just wasn't memory to spare for it. The algorithm used instead has th...
Why isn't a straightforward 1/5/15 minute moving average used in Linux load calculation?
1,294,207,772,000
Last Friday I upgraded my Ubuntu server to 11.10, which now runs with a 3.0.0-12-server kernel. Since then the overall performance has dropped dramatically. Before the upgrade the system load was about 0.3, but currently it is at 22-30 on an 8 core CPU system with 16GB of RAM (10GB free, no swap used). I was going to...
I found this thread on lkml that answers your question a little. (It seems even Linus himself was puzzled as to how to find out the origin of those threads.) Basically, there are two ways of doing this: $ echo workqueue:workqueue_queue_work > /sys/kernel/debug/tracing/set_event $ cat /sys/kernel/debug/tracing/trace_pi...
Why is kworker consuming so many resources on Linux 3.0.0-12-server?