I’m writing a shared library based on libpthread.so. To build it, I use the following command: But when linking files that use libfoo.so, I have to specify the option -lpthread -lfoo not just -lfoo. In addition, ldd libfoo.so doesn’t show anything about libpthread.so. So, is there any way so that …
Tag: linux
How to add a member to task_struct to bypass “compiletime_assert”
I need to add members to task_struct in Linux kernel 4.8.0. However, when I did it and tried to build the kernel, the error message shows: How to get rid of such errors and build my kernel successfully? Answer The assertion you’re encountering is triggered by a macro (CHECK_MEMBER_AT_END_OF) that checks…
Understanding Linux write performance
I’ve been doing some benchmarking to try and understand write performance on Linux, and I don’t understand the results I got (I’m using ext4 on Ubuntu 17.04, though I’m more interested in understanding ext4 if anything, than I am in comparing filesystems). Specifically, I understand th…
How to stop a shell script correctly?
I’ve written a small bash script to start a program every 3 seconds. This script is executed on startup and it saves its PID into a pidfile: The problem is, I can’t terminate the shell script by calling start_gps-read.sh stop. There it should read the pidfile and stop the inital process (from star…
How do I run a Python Qt file in Ubuntu?
Here’s the sample code that I want to run: The file is saved as sample.py. The following command isn’t working: Answer You need to start the Qt event loop by calling app.exec_() once you have initialised the widgets and called show() on your main window.
Apache executes MATLAB binary on CentOS 7 with SELinux
I am trying to trigger the run of a pre compiled MATLAB program on a CentOS 7 server form within an Apache context. The system allowes the user to upload some files. Then some sanity checks are performed. Then the MATLAB program is called and it performes some MATLAB magic. I installed the MATLAB environment …
Command works in terminal but not as alias in profile.d
I have a problem regarding an alias file in /etc/profile.d/. This isn’t anything important. I’m just interested why it isn’t working as expected. So basically I have the file 00-alias.sh at the path mentioned above and I wanted to make a shortcut which reads a specific line of a file. So thi…
How to grep two IP addresses and increase the value of the last number?
I’m pretty new to Linux and writing scripts etc. I have this task where I need to find an IP-address from a database and then grep a bunch of files with this IP and the next one to see, if they have any presence there. Currently I have to first write: and then And I have to manually change the
shmat() Permission denied even i have read access
In my simple code: I already have read access, but I got “shmat: Permission denied”. Do I have permission to write? Answer From man shmat: If SHM_RDONLY is specified in shmflg, the segment is attached for reading and the process must have read permission for the segment. Otherwise the segment is a…
can i monitor four servers from one single net-data instance?
This is my one net data output also i can see other machinies this section but i want to see other machinies as below picture and it will redirect detailed page when i click any machine is that possible?? i searched on google but i am not able to find any answer. i am working on linux machine. Answer You