Sunday 19 February 2012

Trying to fix an init script

This morning I updated my pog website and went to church.

In the afternoon and first part of the evening I tried to modify the init script for nginx on my webserver as it wasn't working properly. The problem was that to check whether nginx was already running the script did status nginx, which gave a long list of pids as there are various users running nginx on the shared web server. Since it returned data, that meant the script thought nginx was already running, even when my instance of nginx wasn't running.

I'm pretty sure I've fixed it now (and also found and fixed some problems with my php-fpm init script). I changed the script so it gets the pid of my nginx from the pid file, then does a ps for that pid and greps for my nginx location. If that returns text, my nginx is running, otherwise it isn't.

For the rest of the evening I processed a pano and read some camera websites.

No comments: