I’ve no idea what happened, but may be a look into the error log may
help.
What you can do to prevent this kind of issue is to use monitoring on
that server. I for one use use monit on my servers to make sure services
are running and will be restarted in case a service crashes.
Can I create a sh file that checks the status of nginx and run it with
cron
job? if nginx status becomes “dead”, then the sh file is going to
restart
nginx. if it can, how to sample his sh file? and how examples of “cron
job”?
Can I create a sh file that checks the status of nginx and run it with cron
job? if nginx status becomes “dead”, then the sh file is going to restart
nginx. if it can, how to sample his sh file? and how examples of “cron job”?
If you’re asking for example of how cron jobs work, I don’t think
you’re experienced enough to write scripts to monitor a daemon
robustly.
Please look into “monit” instead, if indeed your VPS environment seems
to kill off processes like nginx randomly. Personally, I’ve never seen
this happen, but I’m sure there are situations in which it can.
Solutions like monit are a band-aid, and not a universal panacea.
Jonathan
Jonathan M. // Oxford, London, UK
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.