restyskeleton
restyskeleton copied to clipboard
nginx.pid does not exist
Steps required for reproduction (if you know what I mean :P)
- Create a restyskeleton with
-d
flag. - Exit the auto watch mode by pressing CTRL - c on the terminal
- Make an illegal change in configuration file (it could be anything that breaks the configuration file like for example a single brace un closed
{
) - start openresty again in the watch mode (i.e with the -d and -w flags)
- Try to make edits to the configuration file.
The application should hang with the nginx: [error] open() "./logs/nginx.pid" failed (2: No such file or directory)
on the screen.
The correct behaviour
If the nginx process can't be started the watch should automatically exit and prompt the user to fix the breaking change. Watch must work only on a running nginx process.
FIX
The fix should be pretty easy. We just need to parse the data in on message handler and if the message is a pid not found
error we need to end the process by calling process.exit(1)
.