Search code examples
ruby-on-railsubuntupuma

replacing status command of upstart in ubuntu 16


While implementing puma, I have updated ubuntu version from 14.04 to 16.04.

Prior service was based on upstart, basically workers and sidekiq started with upstart. However, the problem occurs when I try to deploy actual code.

During the deployment, prior code checked status of workers via code like below.

if capture('status workers') =~ /start/

I have not installed upstart in ubuntu 16.04 thereby deploy failed at this point. Is there anyway that I can substitute such command driven from upstart in ubuntu 16.04?

Also Kernel.capture which is shown above is also deprecated code. Is there any substitutions for these, please let me know.


Solution

  • You should use systemd utils in Ubuntu 16.04:

    Instead of using Kernel.capture, use Ruby Open3 methods - there's a good article on them.