Too many open files
Posted: 09 Apr 2013 17:25
I have added an event shell script in the related js file:
way.devices[8].instances[0].commandClasses[48].data.level.bind(function() {
try {
system("sh /opt/notify.sh" + this.value );
} catch(err) {
debugPrint("Failed to execute command: " + err);
}
and after some time I will get in log:
Failed to execute command: Too many open files
Looking for the open files I see after not a very long time:
root@raspberrypi:/tmp# lsof | grep z-way-ser | grep -c FIFO
2635
full lines like this:
z-way-ser 26556 26560 root 158w FIFO 0,8 0t0 6266559 pipe
z-way-ser 26556 26560 root 159r FIFO 0,8 0t0 6267569 pipe
The shell script itself does nothing - all possible things hve removed...
notify.sh:
# any comment
exit
If there is anything inside it will be executed - this is not the problem.
I do not understand why here will be created such a lot of open pipes.
It seems that every call will open 5 pipes (and never close it).
Restarting Z-Way wil help, but after some time the same again.
Any idea? What here maybe wrong?
way.devices[8].instances[0].commandClasses[48].data.level.bind(function() {
try {
system("sh /opt/notify.sh" + this.value );
} catch(err) {
debugPrint("Failed to execute command: " + err);
}
and after some time I will get in log:
Failed to execute command: Too many open files
Looking for the open files I see after not a very long time:
root@raspberrypi:/tmp# lsof | grep z-way-ser | grep -c FIFO
2635
full lines like this:
z-way-ser 26556 26560 root 158w FIFO 0,8 0t0 6266559 pipe
z-way-ser 26556 26560 root 159r FIFO 0,8 0t0 6267569 pipe
The shell script itself does nothing - all possible things hve removed...
notify.sh:
# any comment
exit
If there is anything inside it will be executed - this is not the problem.
I do not understand why here will be created such a lot of open pipes.
It seems that every call will open 5 pipes (and never close it).
Restarting Z-Way wil help, but after some time the same again.
Any idea? What here maybe wrong?