简体   繁体   中英

Ubuntu run Puma and Sidekiq in background as Daemonized processes

Two years ago I was running the following command:

bundle exec puma -C config/puma.rb -b unix:/home/user/site/shared/tmp/sockets/user-puma.sock -d
bundle exec sidekiq -d

But now, after some Ubuntu updates, the -d flag is deprecated and I can't start the Puma and Sidekiq processes to run in background.

I also tried running:

bundle exec puma -C config/puma.rb -b unix:/home/user/site/shared/tmp/sockets/user-puma.sock &
bundle exec sidekiq &

This works only while I'm logged on the SSH, when I close the SSH connection, all processes opened with & are closed.

How can I run Puma, Sidekiq and other processes in background as Daemons?

What works for me is setting up my own systemd service for sidekiq

A well-documented example file is in the sidekiq github repository

Along with this, I'd also recommend using monit to watch background processes... here's a recipe from Lugo Labs that I loosely base my deploys off of

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM