I’d like to understand a detail of how the dynamic loader creates mappings for ELF segments. Consider a tiny shared library linked with GNU ld. The program headers are: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align LOAD 0x000000 0x0000000000000000 0x0000000000000000 0x00095c 0x00095c R E 0x2000…
Printing full path of directories
I am trying to get full paths of folder and print them into a into a file. I have been using this command to get paths. But they are not proper. Ex. When trying to print path of Documents/Folder/Folder2 comes as Documents/folder2 instead of proper path. I have tried going over directory using for loop and pri…
How to detect when a process is terminated in Linux using C++?
The purpose is I want my program running on Linux to be terminated when some random process is terminated. I can get PID or process handle of the process that my program is to monitor. Are there any possible approaches that I could take? Answer Linux 5.3 introduced pidfd_open, which lets you get a file descri…
How can l start postgresql database using linux crontab?
postgresql database is starting in this way. but when I use linux crontab to start postgresql,it has failed. postgresql is not starting. I want to know why. Thank you! Answer You need to define which PostgreSQL instance to start. Try to add -D “PGDATA”. For example: If your Linux distribution is u…
Ubuntu initial configuration script errors
I’m newbie to linux and I’m trying to make an initial configuration script for basic users passwords, SSH rules and system config of Hostname & timezone as below, But I’m getting below errors, I couldn’t figure it out. Anyone could help me plz Thanks, Answer I’ve found this o…
PostgreSQL ERROR: could not access file “$libdir/postgis-2.5”
I’ve got a database with postgis installed, but it doesn’t work anymore: I found other answers which suggested running ALTER EXTENSION postgis UPDATE;, so I did, but it has no effect: Does anybody have any idea on how to solve this? (I’m on Ubuntu 20.04 with Posrgresql version 12.3. and I re…
cannot call sqlplus from linux where password contains $ dollar sign
I have spent hours trying various suggestions and combinations but for the life of me cannot get a call to sqlplus from direct linux command line or from a bash script to work with a password containing a $ I have tried these I have tried the same as above but putting before the $, and various other attempts
Find all files above a size and truncate?
Running cPanel on a server with various customer accounts under the /home directory. Many customers’ error_log files are exceeding a desired size (let’s say 100MB) and I want to create a cron job to run daily to truncate any files over a certain size. I know truncate can shrink files but it will e…
making a Hotel management system in BashScript
I am unable to correct the error. I have tried searching on Google but i can’t figure out what my output is referring to. Its giving a line number but the code is right there. “fi” is used at the end of IF statements in scriptfiles. This is my code I am attaching the output too Error while r…
Does the linux subsystem in windows also run when no one is logged in?
I am trying to get comfortable with hosting software on linux instead of windows. To try that, i want to use a linux system that runs on a windows machine. First, there is HyperV, from which i know will execute the linux VM in the background, even thou no one is logged in. Then there is the “Linux subsy…