← Back to Upcase

Deploying to a managed VPS


(Flávio M Oota) #1

Hey guys!

My client decided that he wanted his server to be managed by the company that is hosting everything. So that means no more root for me. Which sucks because now everything I need to do I have to ask them.

I use capistrano 2 (because I didn’t have the guts to update to 3 yet) to deploy my apps and I need to run the setup command to create the syminks to the nginx.conf and the unicorn.sh that’s going to be at /etc/init.d but I can’t because there’s no sudo. For the nginx.conf they gave me a reasonable solution. But for the unicorn, I don’t know.

As the Unicorn Workers are managed by yourself anyway, its probably the most easiest way to ensure they get started on reboot to add a matching @reboot entry to your users crontab. Or if you need better service checking or have a lot of self managed daemons, you can also install a tool like monit into your /home and run it by yourself.

Any thoughts? Never used monit and I’m not sure how to use the other approach when deploying new versions or simply having to restart the server.

Thanks!


(Chad Pytel) #2

@massayoshi, yes Monit, God, or even the @reboot line in the crontab are all ok.

Monit or God are the most robust way to handle it, and what I would recommend.


(Flávio M Oota) #3

Hey, @cpytel!

So I could ditch the /etc/init.d/unicorn approach using God/Monit? Is that what it is?


(Chad Pytel) #4

Yes, you would only make sure Monit was started, and it will be responsible for making sure everything is started/restarted/running all the time.


(Flávio M Oota) #5

Awesome! Will look in to that!


(Flávio M Oota) #6

Hey @cpytel!

Could you give me a light on how I could run monit + unicorn without having to use the /etc/init.d approach? All of the solutions I could find until now were using it.

Thanks!


(Chad Pytel) #7

I’d say that is the preferred approach.

The only other way I’ve seen is to put Monit in the user’s crontab as @reboot to ensure it is running on restart.


(Flávio M Oota) #8

The problem is that since it’s a managed (stupid) VPS, I don’t have sudo nor they will put the file there for me.

You said it’s the preferred approach, so it’s possible to run they way I need?

Thanks!


(Chad Pytel) #9

I think you’d have to use the crontab then.


(Flávio M Oota) #10

Alright, will try that.

Thanks again!