Why don't you try running nginx by hand, and seeing what's happening
if it restarts on it's own, or get's restarted by something else?
Bump up the default log file verbosity as well.
Could it be that the rotating of the log files is causing nginx to
restart and solarwinds is checking just as the change is happening but
before the run.pid file is updated properly?
Does Solarwinds show which PID it was expecting to see?
I'd also just remove the log rotation completely, let it fill up and
rotate it weekly. Esp if they're lightly loaded... would it matter?
John
Morgan> I only see one error in /var/log/nginx/error.log.1 and it's
Morgan> not related to the startup/shutdown. / var/log/nginx/error.log
Morgan> is empty. I should have mentioned that before, but that was
Morgan> definitely the first thing that I looked at. :)
Morgan> As for the monitoring system, it's Solarwinds running a script over the agent. The script is a
Morgan> nagios one, simplified version is as follows:
Morgan> #!/bin/sh
Morgan> # This program is free software; you can redistribute it and/or modify
Morgan> # but WITHOUT ANY WARRANTY; without even the implied warranty of
Morgan> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Morgan> # GNU General Public License for more details.
Morgan> #
Morgan> # You should have received a copy of the GNU General Public License
Morgan> # along with this program; if not, write to the Free Software
Morgan> # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Morgan> PROGNAME=`basename $0`
Morgan> VERSION="Version 1.1,"
Morgan> AUTHOR="2009, Mike Adolphs (
http://www.matejunkie.com/)"
Morgan> ST_OK=0
Morgan> ST_WR=1
Morgan> ST_CR=2
Morgan> ST_UK=3
Morgan> hostname="localhost"
Morgan> port=80
Morgan> path_pid=/var/run
Morgan> name_pid="nginx.pid"
Morgan> status_page="nginx_status"
Morgan> pid_check=1
Morgan> secure=0
Morgan> check_pid() {
Morgan> if [ -f "$path_pid/$name_pid" ]
Morgan> then
Morgan> retval=0
Morgan> else
Morgan> retval=1
Morgan> fi
Morgan> }
Morgan> if [ ${pid_check} = 1 ]
Morgan> then
Morgan> check_pid
Morgan> if [ "$retval" = 1 ]
Morgan> then
Morgan> echo "There's no pid file for nginx. Is nginx running? Please \
Morgan> also make sure whether your pid path and name is correct."
Morgan> exit $ST_CR
Morgan> fi
Morgan> fi
Morgan> So it's definitely catching the server bouncing, but I have no idea why. I checked dmesg and I
Morgan> don't see anything from the OOM killer; it doesn't seem to be running out of memory. (Although I
Morgan> will note these are t2.micro instances since as I mentioned before they're very lightly used.)
Morgan> If it were upstart or systemd, I might be able to get some further info out of those systems, but
Morgan> it's just a SysV init script. OS is Ubuntu 14.04 (we're in the process of moving things to 18.04,
Morgan> but are not far enough along to hit this particular setup yet).
Morgan> On Fri, Dec 7, 2018 at 1:15 PM Guus Snijders <
gsni...@gmail.com> wrote:
Morgan> Op vr 7 dec. 2018 22:02 schreef Morgan Blackthorne <
mor...@windsofstorm.net>:
Morgan> Confirmed that the pid file did change when it happened again, and that the pid file is
Morgan> accurate compared to ps.
Morgan> Perhaps a stupid question, but isn't there something in the nginx logs?
Morgan> Since the daemon appears to restart, perhaps there's some log message about why it shutdown or
Morgan> crashed in the first place...
Morgan> Mvg, Guus Snijders
Morgan> --
Morgan> This list provided by the League of Professional System Administrators
Morgan>
http://lopsa.org/
Morgan> ---
Morgan> You received this message because you are subscribed to the Google Groups "LOPSA Discussion"
Morgan> group.
Morgan> To unsubscribe from this group and stop receiving emails from it, send an email to
Morgan>
discuss+u...@lopsa.org.
Morgan> Visit this group at
https://groups.google.com/a/lopsa.org/group/discuss/.