After codesys stop working I check is codesyscontrol service is running.
After command "service codesyscontrol restart" its start working properly.
I also copy the codesyscontrol log file.
What could be the reason and how to prevent it in the future?
I attach dmesg output from another raspberry also with license on runtime key. Situation with codesys stop was the same. This rpi was not rebooted, only codesysservice was restarted. This situation was about 17.01.2020. I hope this will help to investigate the problem.
Not so often, once every few weeks. What steps to take next time to diagnose the reason for the codesyscontrol stop?
I want to create bash script to check if codesyscontrol is running, if not then restart and write message in log, but command
```
systemctl is-active codesyscontrol.service
``` return "active" even if codesyscontrol service status is "active (exited)"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are you running visualization also on this Raspberry PI? I had a similar problem also and figured out that Chromium was crashing and stopping CodeSys. It was crashing every 2-4 weeks. I updated Chromium to the latest version and never saw it crashing again. What is interesting, that I had an Raspberry PI with earlier version of Raspbian/Chromium and it was working without problems. As I think it was a problem with specific version of Chromium. May be will be useful for somebody if it is not your case.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Visu is running on both raspberry. On both webvisu is accessible from internet on port 8080, on first one on main page is only button to login (more ofter codesyscontrol was stopping), on second one visu is without login requirements (only one time codesyscontrol was stop).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Automatic restart codesyscontrol service is not a good solution but better than none.
For this I create this script started from cron on every minute and log to file. It seems to work:
Your log file shows CODESYS 3.5.15.10.
There was a vulnerability reported in this version fixed in V3.5.15.20. You should definitely update to the latest version (now 3.5.15.30). https://www.codesys.com/security/security-reports.html
About logging, maybe wireshark?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After codesys stop working I check is codesyscontrol service is running.
After command "service codesyscontrol restart" its start working properly.
I also copy the codesyscontrol log file.
What could be the reason and how to prevent it in the future?
codesyscontrol.log.txt [272.81 KiB]
Hi,
is your license on an runtime key?
There is a message in the log .. could you give us a
dmesg
on cli?
BR
Edwin
Yes, license is on runtime key compact. Its connected directly to Raspberry USB port.
I attach dmesg output but rpi was rebooted after this fault.
dmesg.txt [17.64 KiB]
I attach dmesg output from another raspberry also with license on runtime key. Situation with codesys stop was the same. This rpi was not rebooted, only codesysservice was restarted. This situation was about 17.01.2020. I hope this will help to investigate the problem.
dmesg_2.txt [18.17 KiB]
Hi,
think this is not a licensing problem,
mem leak or what ever it is...
how often does this happen, hours, days or week...?
BR
Edwin
Not so often, once every few weeks. What steps to take next time to diagnose the reason for the codesyscontrol stop?
I want to create bash script to check if codesyscontrol is running, if not then restart and write message in log, but command
```
systemctl is-active codesyscontrol.service
``` return "active" even if codesyscontrol service status is "active (exited)"
Are you running visualization also on this Raspberry PI? I had a similar problem also and figured out that Chromium was crashing and stopping CodeSys. It was crashing every 2-4 weeks. I updated Chromium to the latest version and never saw it crashing again. What is interesting, that I had an Raspberry PI with earlier version of Raspbian/Chromium and it was working without problems. As I think it was a problem with specific version of Chromium. May be will be useful for somebody if it is not your case.
Have you made your webvisu 8080 directly accessible to the internet? Some of your log messages looks like it might be the case.
Visu is running on both raspberry. On both webvisu is accessible from internet on port 8080, on first one on main page is only button to login (more ofter codesyscontrol was stopping), on second one visu is without login requirements (only one time codesyscontrol was stop).
I suspect that's the cause. Either a well intentioned vulnerability scanner, or a malicious actor is DoS attacking your webvisu.
So that's the cause sorted, now what's the fix?
My first thought is a hardened proxy server that only forwards valid requests to the pi.
But you mentioned you are happy just to reset the CODESYS service. Maybe:
pgrep -x codesyscontrol >/dev/null
Automatic restart codesyscontrol service is not a good solution but better than none.
For this I create this script started from cron on every minute and log to file. It seems to work:
I there any way to log or count every connection to webvisu?
Your log file shows CODESYS 3.5.15.10.
There was a vulnerability reported in this version fixed in V3.5.15.20. You should definitely update to the latest version (now 3.5.15.30).
https://www.codesys.com/security/security-reports.html
About logging, maybe wireshark?