You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vagra...@googlegroups.com
I packaged a custom CentOS 7 base box with nginx running on it. I packaged it as a local package.box file. To use the box, I created a new Vagrantfile, and for the provision, I use the shell commands to make some changes to the /etc/nginx/nginx.conf file (like including some vhost configs in my sync'ed directory). The last thing in my provisions is to restart nginx: nginx -s reload. However when my vagrant up gets to this part, I get the following error:
nginx: /run/nginx.pid failed (2 no such file or directory)
So I think what that means is that it's trying to reload nginx, but since the PID file doesn't exist that means that nginx wasn't running to begin with.
So what is going on here? When I package up the box, nginx is running, and is set to run on startup. But when I use the box in a new environment, it thinks that nginx isn't running and therefore throws the error when trying to reload it. What am I missing here exactly?
Alvaro Miranda Aguilera
unread,
Jun 30, 2015, 4:42:29 AM6/30/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vagra...@googlegroups.com
Hello,
if you are installing nginx from epel as you are using a rpm based
distro, you should use the service <service> command
before packing the box, you can do
chkconfig nginx on
service nginx status && service nginx stop
rm -fr /run/nginx.pid
And on the new box, you can do something like
service nginx status && service nginx reload || service nginx start