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.
Every few weeks, the php session folder of a machine changes to owner apache even though I'm using nginx. This breaks PHP applications, for example phpMyAdmin, with a session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)-Error.
apache
session_start(): open(SESSION_FILE, O_RDWR) failed: Permission denied (13)
I can fix it by manually issuing sudo chown -R nginx /var/lib/php/session/
sudo chown -R nginx /var/lib/php/session/
/var/log/yum.log
Apr 18 04:35:53 Aktualisiert: nginx.x86_64 1:1.14.0-1.el7_4.ngx
/etc/php.ini
drwxrwx---. 2 root apache 94 28. Mär 07:49 session
Why would (automatic) nginx-updates change the owner of the php session folder, thus breaking my applications?
there are several ways to approach this problem
If a package is suspected of causing some change, inspect the packages to see if any own the file in question; RPM contain a %files section that detail what files a given package is authoritative for. This can be queried for with rpm -ql. For example a brute force to find which package (if any) owns /etc/passwd might look like:
%files
rpm -ql
/etc/passwd
$ rpm -qa | while read p; do rpm -ql $p | grep -q /etc/passwd && echo $p; done setup-2.8.71-9.el7.noarch
This method however will not find files that are indirectly modified by a package; RPM contain scripts that can carry out arbitrary actions (or call arbitrary other bits of code that carry out the change being search for). These scripts can be listed with rpm -q --scripts and then that code inspected. It may help to limit the search to only those packages recently installed (check the logs for which ones these are) as there may be a lot of code to look through.
rpm -q --scripts
The linux kernel offers various kernel-based debugging facilities that can be instructed to tell you if something touches a given file. With this method suitable code for SystemTap or sysdig or whatever would be setup, and then you would wait for that to tell you what process has modified the file. For example with sysdig if something is modifying a directory you are interested in:
SystemTap
sysdig
# sysdig "fd.directory contains /var/lib/php"
should show details (which can be configured with the -p flag) on system calls involving that directory. This command will need to be left running somewhere, possibly in a tmux session or as a custom service so that it starts automatically until the offending code can be found. (Also you may need to limit the debug output, as kernel debugging may produce copious amounts of information if the search is too broad and the command left running for long periods of time.)
-p
tmux
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.