restyskeleton icon indicating copy to clipboard operation
restyskeleton copied to clipboard

nginx.pid does not exist

Open brickcap opened this issue 7 years ago • 0 comments

Steps required for reproduction (if you know what I mean :P)

  1. Create a restyskeleton with -d flag.
  2. Exit the auto watch mode by pressing CTRL - c on the terminal
  3. Make an illegal change in configuration file (it could be anything that breaks the configuration file like for example a single brace un closed { )
  4. start openresty again in the watch mode (i.e with the -d and -w flags)
  5. 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).

brickcap avatar Mar 12 '17 12:03 brickcap