A
A
Alexander2015-06-21 20:40:11
Nginx
Alexander, 2015-06-21 20:40:11

What happens when changing the readable file via lua in nginx?

There is a system that, depending on the request to nginx, gives the result through lua (fills in variables), and the result is read from a text file. The text file can be changed by another application at any time (or rather replaced via mv).
Actually the question is:
1) How to track this at the lua level (whether an exception happens), close the file.
2) Will such an error pull the fall of nginx itself
3) How can this be tested normally if the problem may not manifest itself immediately?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alexsens, 2015-06-22
@Alsbi

When nginx opens the file for reading, the OS will create a new link (hardlink) to it. When you rename or delete a file, you actually change the link (old) to the file, the open file will not change.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question