P
P
partisan422019-05-23 05:35:04
iptables
partisan42, 2019-05-23 05:35:04

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

2 answer(s)
V
vanoc, 2019-05-23
@partisan42

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.

E
Eugene, 2019-05-23
@yellowmew

The order of application may be violated.
Try adding sudo systemctl reload iptables to firewall.sh at the end or (if it doesn't work) sudo systemctl restart iptables
Otherwise , vanoc , in principle, wrote everything else that can be done

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question