Answer the question
In order to leave comments, you need to log in
How to view the logs of a specific application in centos?
Good day.
Faced a strange problem. After rebooting the machine, systemctl status iptables shows that everything is fine and excellent. But there is no network on virtual machines on KVM, and it, in turn, is destroyed using iptables.
But if you force systemctl stop iptables && systemctl start iptables, then everything falls into place and everything starts working fine.
I have a feeling that the problem is that iptables does not initially start correctly.
Where can I see the logs for this case?
Does Centos log the operation of each individual application separately? Or is there some kind of file that is a dump of something like that? Or is there another way to see how the app has behaved since launch?
Thank you very much in advance:)
PS. There is also a firewall.sh file, which actually specifies the rules that should be applied automatically every time the system starts. Is it possible somehow to see a list of everything that is in autoload, on the topic of searching for this file there?
Answer the question
In order to leave comments, you need to log in
log
journalctl -u iptables.service
After loading I would look if the rules were applied. iptables -L -n
In Linux, as in Windows, there is no Autoload folder as such. However, there are several ways to execute a script on system boot. It is to register it in cron. The entry looks something like this
@reboot user script
or instead of user you write root, it depends on who you need to run the script under
. You can also write it in /etc/rc.local where the path to the script is simply indicated.
There are probably other ways, I can't remember.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question