upstart

Puma restart fails on reboot using EC2 + Rails + Nginx + Capistrano

谁都会走 提交于 2019-12-07 08:34:28
问题 I have successfully used capistrano to deploy my rails app to Ubuntu EC2. Everything works great on deploy. Rails app name is deseov12 My issue is that Puma does not start on boot which will be necessary as production EC2 instances will be instantiated on demand. Puma will start when deploying via Capistrano, it will also start when running cap production puma:start on local machine. It will also start on server after a reboot if I run the following commands: su - deploy [enter password] cd

Foreman not working with NGINX

孤者浪人 提交于 2019-12-07 02:36:53
问题 I'm trying to use Foreman (version 0.31.0) to manage our application's processes but I'm not having much luck with nginx (nginx/1.0.10 + Phusion Passenger 3.0.11). Here's the relevant line from my Procfile: nginx: sudo /home/ubuntu/nginx/sbin/nginx When I start the app, Foreman reports that nginx is started and then immediately terminated: $ foreman start 21:18:28 nginx.1 | started with pid 27347 21:18:28 nginx.1 | process terminated 21:18:28 system | sending SIGTERM to all processes However,

daemonizing sidekiq with upstart script - is not working

坚强是说给别人听的谎言 提交于 2019-12-06 06:24:52
I'm trying to daemonize sidekiq using two upstart scripts following this example. Basically the workers service starts a fixed number of sidekiq services. The problem is that the sidekiq script fails at the line of code where I am starting sidekiq. I've tried to run the command directly in bash and it works fine. I tried all different commented lines and none works. So my question is what am I doing wrong? Where can I see the error messages? This is my modified sidekiq script: # /etc/init/sidekiq.conf - Sidekiq config # This example config should work with Ubuntu 12.04+. It # allows you to

Puma - Rails on linux // Restart when process dies

戏子无情 提交于 2019-12-05 22:34:56
Using puma on a rails app; it sometimes dies without any articular reason; also often dies (does not restart after being stopped) when deployed What would be a good way to monitor if the process died, and restart it right way ? Being called within a rails app; I'd be useful to have a way to defines it for any apps. I did not found any useable ways to do it (looked into systemd, other linux daemons… no success) Thanks if any feedback You can use puma control to start/stop puma server. If you know where puma.pid file placed (for Mac it's usually "#{Dir.pwd}/tmp/pids/puma.pid" ) you could do:

Puma restart fails on reboot using EC2 + Rails + Nginx + Capistrano

天大地大妈咪最大 提交于 2019-12-05 18:11:51
I have successfully used capistrano to deploy my rails app to Ubuntu EC2. Everything works great on deploy. Rails app name is deseov12 My issue is that Puma does not start on boot which will be necessary as production EC2 instances will be instantiated on demand. Puma will start when deploying via Capistrano, it will also start when running cap production puma:start on local machine. It will also start on server after a reboot if I run the following commands: su - deploy [enter password] cd /home/deploy/deseov12/current && ( export RACK_ENV="production" ; ~/.rvm/bin/rvm ruby-2.2.4 do bundle

Foreman not working with NGINX

安稳与你 提交于 2019-12-05 06:06:58
I'm trying to use Foreman (version 0.31.0) to manage our application's processes but I'm not having much luck with nginx (nginx/1.0.10 + Phusion Passenger 3.0.11). Here's the relevant line from my Procfile: nginx: sudo /home/ubuntu/nginx/sbin/nginx When I start the app, Foreman reports that nginx is started and then immediately terminated: $ foreman start 21:18:28 nginx.1 | started with pid 27347 21:18:28 nginx.1 | process terminated 21:18:28 system | sending SIGTERM to all processes However, nginx is actually running , even though Foreman reports otherwise. Similarly, if I export to Upstart:

Upstart script to run container won't manage lifecycle

不问归期 提交于 2019-12-05 04:26:31
问题 I have an upstart script (say, /etc/init/dtest.conf ) start on runlevel [2345] stop on runlevel [!2345] respawn script DID=$(docker.io run -d ubuntu /bin/bash -c "echo Starting;sleep 20;echo Stopping") docker.io attach $DID end script When issuing start dtest , the upstart logs show the proper cycle of "Starting ... Stopping" forever. However, if I issue a stop dtest , then it appears to exit properly, but the container will run for the remainder of the sleep time (as evidenced by running

Can I import a Golang package based on the OS I'm building for?

房东的猫 提交于 2019-12-04 14:57:31
Say I have a go project that based on which OS, and in some cases which distro, I want to use say a Systemd client package vs an Upstart client package vs a sysv client package vs a launchd client package. Is it possible to selectively import each package so I only import the one I need per OS/distro I'm building for? Or do I have to import each package for each OS/distro? Package build Build Constraints A build constraint, also known as a build tag, is a line comment that begins // +build that lists the conditions under which a file should be included in the package. Constraints may appear in

Unicorn service upstart script throws “-su: bundle: command not found”

余生颓废 提交于 2019-12-04 14:46:52
I recently created a VPS on DigitalOcean to host a rails app. I followed their guide to setup Unicorn with my application. https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-unicorn-and-nginx-on-ubuntu-14-04 A problem occurred when I ran sudo service unicorn_appxyz start . The error given was -su: bundle: command not found I traced the init.d script and pasted the evaluated server start up command in terminal and it works fine when executed under the user joe (the user which rbenv is install and the owner of the app). The evaluated command is su - joe -c cd /home

How to use foreman to export to upstart?

那年仲夏 提交于 2019-12-04 09:16:28
问题 I am trying to export my application to another process management format/system (specifically, upstart). In doing so, I have come across a number of roadblocks, mostly due to lacking documentation. As a non-root user, I ran the following command (as shown here): -bash> foreman export upstart /etc/init ERROR: Could not create: /etc/init I "could not create" the directory due to inadequate permissions, so I used sudo : -bash> sudo foreman export upstart /etc/init Password: ERROR: Could not