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

Alvaro

On Tue, Jun 30, 2015 at 10:42 AM, Jake Wilson <[email protected]> wrote:
> 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?
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/669d59a4-6f26-4585-bd93-23799b6f7753%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/CAHqq0exFoEdueTT7oFoeYPd-Ls2r3VrEYRVBcjUOwiVX4vY5uA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to