Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I created a script which creates a chroot and sets up s://forum.tuteehub.com/tag/php">php-fpm and apache2 to make the site work. In my script I'm copying all required lib(s) to my chroot lib(s) dir(s) using this:
fileArray=$(ldd /usr/bin/s://forum.tuteehub.com/tag/php">php* 2>/dev/null | awk 'NF == 4 {print $3}; NF == 2 {print $1}' | s://forum.tuteehub.com/tag/sort">sort -u) for file in $fileArray do dirName="$(dirname $file)" [ ! -d "$serverDir$dirName" ] && mkdir -p "$serverDir$dirName" || : cp $file "$serverDir$dirName" done
but I saw that if I use a little script like this:
s://forum.tuteehub.com/tag/php">php print_r(gethostbynamel("google.com")); ?>
It doesn't resolve unless there is libnss_dns.so.1 in libs. Now my question is: what is the file I need to 'ldd' to copy libnss_dns to my chroot?
PS: I don't want to copy it manually because I want my script to be cross architecture.
There is no option you can supply to ldd and no ldd feature you can call upon to cause it to include libnss_dns.so.1 in the list of libraries to copy. That library is loaded dynamically at run time because of the contents of configuration files that have nothing to do with the dynamic linker (namely /etc/nsswitch.conf) and ldd simply cannot know what libraries the program might or might not load dynamically in this way.
ldd
libnss_dns.so.1
/etc/nsswitch.conf
You will find that there is probably going to be a whole assortment of other files that you need to copy in manually to make a working chroot: everything from /dev/null to locale configuration, depending on what you're using.
/dev/null
Unfortunately, getting a chroot just right is an inherently non-portable thing. That is, there are no standard APIs you can use to set one up.
chroot
(I think you don't mean "cross architecture" here: assuming you have a working procedure to set up a chroot on, say, SPARC, the exact same procedure should work just fine on, say, x86_64, given the same operating system.)
You might try to use something like debootstrap to set up a new chroot. At least it's tied to a package manager so it ensures that all the dependencies are present. Even then, debootstrap does leave several system files (like /etc/fstab) in a kind of TODO state.
debootstrap
/etc/fstab
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 9 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.